Hide

Problem A
Carrots

Languages en sv

Tor and his mother love carrots. Every day, they place a bowl with 40 carrots and then eat carrots continuously until the bowl is empty. If they are both ready to take a carrot when there is only one left, neither of them will take the last one.

\includegraphics[width=1.0\textwidth ]{morot.pdf}
Figure 1: Timetable for carrot eating in example 1 (top) and example 2 (bottom). In the second example, no one will take the last carrot.

Write a program that, given the number of seconds it takes for Tor and his mother to eat each carrot (both integers), calculates how many carrots each of them gets.

Input

The first and only line input contains the integers $T$ and $M$ ($1 \leq T, M \leq 100$), the time it takes for Tor and his mother respectively to eat a carrot, in seconds.

Output

Print two integers: first the number of carrots that Tor eats, followed by the number of carrots his mother eats.

Scoring

Your solution will be tested on a set of test groups, each worth a number of points. Each test group contains a set of test cases. To get the points for a test group you need to solve all test cases in the test group.

Group

Points

Constraints

$1$

$40$

Tor and his mother are never ready to eat a carrot at the same time after having eaten their first carrots.

$2$

$60$

No additional constraints.

Sample Input 1 Sample Output 1
5 3
15 25
Sample Input 2 Sample Output 2
2 4
26 13
Sample Input 3 Sample Output 3
19 18
19 21

Please log in to submit a solution to this problem

Log in