codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

530C.md (916B)


      1 Source: https://codeforces.com/problemset/problem/530/C
      2 
      3 C. Diophantine equation
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 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.
     22 
     23 Input
     24 
     25 The only line of input contains integers *A*, *B* and *C* (1 ≤ *A*, *B*, *C* ≤ 1000), separated with spaces.
     26 
     27 Output
     28 
     29 In 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.
     30 
     31 Examples
     32 
     33 Input
     34 
     35 ```
     36 3 5 35
     37 ```
     38 
     39 Output
     40 
     41 ```
     42 2  
     43 5 4  
     44 10 1
     45 ```
     46 
     47 Input
     48 
     49 ```
     50 3 35 5
     51 ```
     52 
     53 Output
     54 
     55 ```
     56 0
     57 ```