#B3914. Cookie Distribution
Cookie Distribution
Cookie Distribution
In the final exam held by Luogu Online School, the students achieved excellent results. In the exam, student Z ranked first while student yz ranked second. As a reward, the teacher decided to give them boxes of cookies without breaking any box. The teacher bought three boxes containing , , and cookies respectively. The cookies must be distributed between Z and yz, meaning each box is given intact to one of the two. The conditions for distribution are:
- Let the number of cookies given to Z be and to yz be . Then, .
- Among all distributions satisfying condition (1), the difference should be minimized.
Determine the number of cookies each student receives.
inputFormat
The input consists of a single line containing three positive integers , , and (each representing the number of cookies in one box), separated by spaces.
outputFormat
Output two integers separated by a space: the first is the number of cookies received by Z and the second is the number of cookies received by yz.
sample
1 5 3
5 4