PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000283. Bạn thích món ăn nóng chứ? (So You Like Your Food Hot?)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

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 ptp_t, the profit per pita p1p_1, and the profit per pizza p2p_2, find all pairs of nonnegative integers (x,y)(x,y) satisfying xp1+yp2=ptx p_1+y p_2=p_t, where xx is the number of pitas and yy is the number of pizzas.

Print the pairs in increasing order of xx. 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 pt,p1,p2p_t,p_1,p_2, each with exactly two digits after the decimal point.

Output

For each valid pair (x,y)(x,y), print a line containing xx and yy separated by one space, ordered by increasing xx. If there are no solutions, print a single line none.

Subtasks

  • Subtask 1 (20 points): 0≤pt≤20.000\le p_t\le20.00; 0.01≤p1,p2≤100.000.01\le p_1,p_2\le100.00; all amounts have two decimal places.
  • Subtask 2 (30 points): 0≤pt≤1000.000\le p_t\le1000.00; 0.01≤p1,p2≤100.000.01\le p_1,p_2\le100.00; all amounts have two decimal places.
  • Subtask 3 (50 points): 0≤pt≤10000.000\le p_t\le10000.00; 0.01≤p1,p2≤100.000.01\le p_1,p_2\le100.00; 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 xx pitas and yy pizzas are sold, then 20x+10y=10020x+10y=100, or 2x+y=102x+y=10. For x=0,1,2,3,4,5x=0,1,2,3,4,5, the corresponding values of yy are 10,8,6,4,2,010,8,6,4,2,0. Any larger xx would make yy negative.