302730: CF530C. Diophantine equation
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
C. Diophantine equationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output
You are given an equation A * X + B * Y = C, A, B, C are positive integer coefficients, X and Y are variables which can have positive integer values only. Output the number of solutions of this equation and the solutions themselves.
InputThe only line of input contains integers A, B and C (1 ≤ A, B, C ≤ 1000), separated with spaces.
OutputIn the first line of the output print the number of the solutions N. In the next N lines print the solutions, formatted as "XY", sorted in ascending order of X, one solution per line.
ExamplesInput3 5 35Output
2Input
5 4
10 1
3 35 5Output
0