d364. 10637 - Coprimes
Tags :
Accepted rate : 136人/156人 ( 87% ) [非即時]

Content

How many times must a man look up
Before he can see the sky?
Yes, 'n' how many ears must one man have
Before he can hear people cry?
Yes, 'n' how many deaths will it take till he knows
That too many people have died?
The answer, my friend, is blowin' in the wind,
The answer is blowin' in the wind.

Input

Output

Sample Input #1
4
40 6
8 3
5 2
3 1

Sample Output #1
Case 1:
1 1 1 1 1 35
1 1 1 1 5 31
1 1 1 1 7 29
1 1 1 1 11 25
1 1 1 1 13 23
1 1 1 1 17 19
1 1 1 3 5 29
1 1 1 3 11 23
1 1 1 5 9 23
1 1 1 5 11 21
1 1 1 5 13 19
1 1 1 7 11 19
1 1 1 7 13 17
1 1 1 9 11 17
1 1 3 5 7 23
1 1 3 5 11 19
1 1 3 5 13 17
1 1 3 7 11 17
1 1 5 7 9 17
1 1 5 9 11 13
1 3 5 7 11 13
Case 2:
1 1 6
1 2 5
1 3 4
Case 3:
1 4
2 3
Case 4:
3


Hint ：

DFS

Lucky 貓 翻譯

Tags:

[管理者： morris1028(碼畜) ]

 ID User Problem Subject Hit Post Date 25547 allllllan123...(God of Computer...) d364 484 2021-05-31 17:54 24726 hwjnctucsie9...(Barney Huang) d364 517 2021-03-18 16:48