In the event of technical difficulties with Szkopuł, please contact us via email at [email protected].
If you would like to talk about tasks, solutions or technical problems, please visit our Discord servers. They are moderated by the community, but members of the support team are also active there.
There are four currencies in Byteland. These are: denary, frank, grosz and taler. They are not convertible (i.e. one cannot exchange one currency into another) and this is a serious disadvantage for the inhabitants of Byteland. The Byteland Bank of Business (short BBB), due to mistake between currencies, has faced the view of bankruptcy. It had made several contracts on giving credits. All of the contracts are of the following form:
Write a program which:
In the first line of the standard input there is written one positive integer equal to the number of clients, . The clients are numbered from to . In each of the following lines there are written eight nonnegative integers. In the -th line () there are written integers , (, for ). Integers and denote respectively credit limit and current credit of client number in: denars (), francs (), groszes () and talers ().
Your program should write in the first and only line of the standard output four nonnegative integers separated by single spaces. They should denote the minimal amounts of money BBB needs in denars, francs, groszes and talers respectively.
For the input data:
4 3 2 1 2 0 2 0 1 2 4 1 8 1 2 1 1 3 2 0 3 1 0 0 1 3 0 1 2 1 0 0 1
the correct result is:
1 2 0 7
2 0 1 4
Task author: Marcin Kubica.