QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#502943#5638. A Rational Sequence (Take 3)xiaowuc1100 ✓1ms3616kbC++171.6kb2024-08-03 15:36:282024-08-03 15:36:28

Details

Tip: Click on the bar to expand more detailed information

Pretests


Final Tests

Test #1:

score: 100
Accepted
time: 1ms
memory: 3616kb

input:

1000
1 1
2 4
3 11
4 1431655765
5 128
6 127
7 213
8 204
9 256
10 255
11 341
12 460
13 512
14 511
15 853
16 716
17 1024
18 1023
19 1365
20 1228
21 2048
22 2047
23 3413
24 3276
25 4096
26 4095
27 5461
28 7372
29 8192
30 8191
31 13653
32 11468
33 16384
34 16383
35 21845
36 19660
37 32768
38 32767
39 546...

output:

1 1/1
2 1/3
3 5/2
4 2178309/1346269
5 1/8
6 7/1
7 34/21
8 12/29
9 1/9
10 8/1
11 55/34
12 17/41
13 1/10
14 9/1
15 89/55
16 29/70
17 1/11
18 10/1
19 144/89
20 41/99
21 1/12
22 11/1
23 233/144
24 70/169
25 1/13
26 12/1
27 377/233
28 99/239
29 1/14
30 13/1
31 610/377
32 169/408
33 1/15
34 14/1
35 987/61...

result:

ok 1000 lines