#GL0000283. Bạn thích món ăn nóng chứ? (So You Like Your Food Hot?)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Bạn thích món ăn nóng chứ? (So You Like Your Food Hot?)
So You Like Your Food Hot?
Source: Kattis
Version: Phuoc Hung OJ Extended
Problem Statement
Peter sells pitas and pizzas. After a fire, his records only reveal the total profit from the previous month. He still knows the exact profit earned on each pita and pizza.
Given the total profit , the profit per pita , and the profit per pizza , find all pairs of nonnegative integers satisfying , where is the number of pitas and is the number of pizzas.
Print the pairs in increasing order of . If no valid pair exists, print lowercase none. All monetary values are exact dollar-and-cent amounts.
Input
A single line contains three decimal amounts , each with exactly two digits after the decimal point.
Output
For each valid pair , print a line containing and separated by one space, ordered by increasing . If there are no solutions, print a single line none.
Subtasks
- Subtask 1 (20 points): ; ; all amounts have two decimal places.
- Subtask 2 (30 points): ; ; all amounts have two decimal places.
- Subtask 3 (50 points): ; ; all amounts have two decimal places.
Examples
Input
100.00 20.00 10.00
Output
0 10
1 8
2 6
3 4
4 2
5 0
Explanation
If pitas and pizzas are sold, then , or . For , the corresponding values of are . Any larger would make negative.