Problem O: 求二元一次方程 2x+5y=100 的所有正整数解

Problem O: 求二元一次方程 2x+5y=100 的所有正整数解

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 456  Solved: 411
[Submit] [Status] [Web Board] [Creator:]

Description

通常二元一次方程有无穷多个解,但在限定了条件后,如本题中限定了 x 和 y 必须是正整数,解的个数就是有限的。

#include <stdio.h>
int main(int argc, char *argv[])
{
    for (x=1; x<=100; x++)
        for (y=1; y<=100; y++)
            if (  ) {
                printf("%d %d\n", x, y);
            }
    return 0;
}

Input

本题没有输入

Output

本题有若干组解,在每行输出一组解,两个数之间以空格来分隔

Sample Output

5 18
10 16
15 14
20 12
25 10
30 8
35 6
40 4
45 2