QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#837032#9883. Near Pairhos_lyricAC ✓2ms4132kbC++142.4kb2024-12-29 13:48:122024-12-29 13:48:14

Judging History

This is the latest submission verdict.

  • [2024-12-29 13:48:14]
  • Judged
  • Verdict: AC
  • Time: 2ms
  • Memory: 4132kb
  • [2024-12-29 13:48:12]
  • Submitted

answer

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

using Int = long long;

template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")


/*
  ask S, ~S
  (# edge in S) - (# edge in ~S)
  = (1/2) ((\sum[u \in S] deg(u)) - (\sum[u \in ~S] deg(u)))
  
  deg: K K+1 ... 2K-1 2K 2K ... 2K 2K 2K-1 ... K+1 K
  2K-deg: K K-1 ... 1 0 0 ... 0 0 1 ... K-1 K
  sum = K(K+1)
  (<= K+1) segments with sum <= K in each level
*/

int N, K, Q;

int ask(const string &s) {
  printf("? %s\n", s.c_str());
  fflush(stdout);
  int t;
  scanf("%d", &t);
  return t;
}

int calc(int m) {
  const int resL = ask(string(m, '1') + string(N - m, '0'));
  const int resR = ask(string(m, '0') + string(N - m, '1'));
  return (K*(K+1) + (m - (N-m)) * (2*K) - 2 * (resL - resR)) / 2;
}

vector<int> ans;
void rec(int l, int r, int fL, int fR) {
// cerr<<"[rec] "<<l<<" "<<r<<" "<<fL<<" "<<fR<<endl;
  if (fR - fL >= K) {
    if (l + 1 == r) {
      ans.push_back(l);
    } else {
      const int m = (l + r) / 2;
      const int fM = calc(m);
      rec(l, m, fL, fM);
      rec(m, r, fM, fR);
    }
  }
}

int main() {
  scanf("%d%d%d", &N, &K, &Q);
  rec(0, N, 0, K*(K+1));
  assert((int)ans.size() == 2);
  printf("! %d %d\n", ans[0] + 1, ans[1] + 1);
  fflush(stdout);
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

20000 1 60
4972
4972
1254
11254
295
15294
701
13200
966
12215
1098
11723
1174
11488
1144
11613
1156
11548
1153
11584
1155
11567
1153
11574
1153
11570
1153
11569
11235
1236
7774
2774
9423
1924
8584
2335
8183
2560
7975
2664
7879
2723
7928
2695
7904
2710
7914
2700
7919
2696
7915
2697
7916
2697

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 54 questions

Test #2:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

20000 1 60
4995
4995
1293
11292
2801
7800
3825
6324
4418
5668
4114
5990
3969
6156
4045
6076
4082
6036
4065
6058
4073
6046
4079
6043
4075
6045
4074
6045
11216
1217
7780
2780
9381
1881
10283
1533
10756
1383
10516
1454
10639
1421
10694
1399
10664
1409
10650
1414
10657
1411
10660
1410
10662
1410
10662
1...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 56 questions

Test #3:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

20000 2 90
9988
9991
2487
22486
595
30592
1426
26423
1923
24420
2205
23454
2347
22974
2282
23221
2243
23338
2227
23400
2236
23369
2239
23354
2237
23362
2237
23360
5628
15628
7620
12621
8745
11248
8182
11935
8442
11571
8588
11407
8516
11489
8548
11447
8532
11471
8524
11483
8520
11485
8521
11484

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 52 questions

Test #4:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

20000 2 90
9985
9984
2449
22448
620
30619
162
35159
351
32850
247
33998
201
34574
222
34283
236
34141
241
34072
238
34107
240
34091
239
34102
239
34104
22475
2477
15617
5618
12638
7639
11254
8755
10589
9342
10287
9664
10138
9825
10206
9739
10173
9784
10187
9758
10196
9747
10198
9743
10196
9745

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 54 questions

Test #5:

score: 0
Accepted
time: 1ms
memory: 4116kb

input:

20000 3 120
15006
15000
33724
3726
23444
8443
18951
11447
21108
9857
20034
10658
20550
10238
20833
10053
20964
9953
20899
10008
20864
10033
20845
10041
20850
10037
20848
10038
28336
5836
45943
945
52736
242
49276
531
47599
729
48431
625
48855
584
48644
604
48741
590
48686
595
48664
600
48672
599
486...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 54 questions

Test #6:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

20000 3 120
14948
14951
3706
33705
919
45918
216
52710
489
49235
688
47565
585
48395
641
47986
618
48197
603
48299
610
48246
615
48221
616
48213
615
48215
8355
23355
11442
18945
9836
21089
9060
22191
8707
22774
8524
23056
8621
22919
8663
22847
8687
22811
8695
22792
8690
22802
8691
22800
33805
3810

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 54 questions

Test #7:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

20000 4 150
19882
19890
5020
45020
1247
61243
311
70301
697
65691
485
67980
2800
52800
1945
56941
2321
54825
2116
55868
2029
56401
2071
56131
2093
56001
2111
55943
2103
55971
2106
55958
2107
55951
2109
55945
11180
31181
15256
25257
17503
22504
18679
21191
18060
21816
18371
21503
18532
21352
18599
21...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 60 questions

Test #8:

score: 0
Accepted
time: 2ms
memory: 3832kb

input:

20000 4 150
19966
19969
5049
45043
1261
61251
2845
52835
3898
48892
3372
50866
3615
49865
3484
50354
3551
50109
3583
49993
3566
50052
3578
50024
3580
50010
3580
50006
11261
31258
15306
25309
13209
28212
12228
29732
44964
4967
61198
1202
70296
302
75076
86
72650
164
71477
239
70889
271
71184
258
7103...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 62 questions

Test #9:

score: 0
Accepted
time: 2ms
memory: 3844kb

input:

20000 5 180
25108
25108
6291
56281
1565
76552
14107
39102
9754
47249
7919
51659
8784
49409
8349
50533
19253
31753
16568
35313
17910
33540
17244
34434
16908
34873
17073
34648
17153
34538
17201
34491
17176
34511
17186
34501
17190
34500
56259
6270
39102
14104
47307
9810
51692
7945
53975
7108
55107
6683...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 66 questions

Test #10:

score: 0
Accepted
time: 1ms
memory: 4128kb

input:

20000 5 180
25010
25005
6237
56232
1555
76545
386
87876
90
93825
211
90831
135
92315
108
93068
100
93445
106
93261
107
93162
107
93112
107
93097
107
93102
3463
65953
4790
61031
56260
6275
39102
14103
31601
19099
47359
9865
43134
11890
41073
12957
51735
8000
49564
8954
50635
8465
51168
8223
50901
834...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 66 questions

Test #11:

score: 0
Accepted
time: 2ms
memory: 3844kb

input:

20000 6 210
30027
30026
7529
67517
1916
91904
466
105451
107
112587
16969
46958
22947
37940
26338
33837
24614
35863
25449
34826
25889
34330
26104
34083
25997
34216
25944
34277
25967
34246
25954
34263
25958
34255
25963
34248
67471
7475
91854
1869
79150
4154
85389
2899
82208
3474
80673
3811
79916
3984...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 70 questions

Test #12:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

20000 6 210
30054
30049
7637
67623
1904
91890
497
105476
1065
98547
16948
46935
22966
37953
26375
33862
28191
31940
27288
32903
27755
32434
27976
32187
28082
32065
28133
32002
28106
32029
28119
32018
28124
32011
28126
32007
67622
7628
46900
16906
37972
22972
42347
19847
44592
18348
45728
17618
45148...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 74 questions

Test #13:

score: 0
Accepted
time: 1ms
memory: 3780kb

input:

20000 7 240
34987
34990
8646
78641
2144
107127
558
123032
1232
114962
4838
92325
6599
85338
19660
54655
26748
44243
30693
39443
78571
8588
54664
19681
44247
26757
39465
30725
37177
32819
36053
33879
35522
34440
35254
34718
35127
34871
35050
34934
35015
34969
34999
34981
34991
34987
49316
23083
46751...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 68 questions

Test #14:

score: 0
Accepted
time: 1ms
memory: 3824kb

input:

20000 7 240
34953
34964
8741
78741
2206
107194
552
123024
1243
114965
1695
111059
1456
113004
1351
113984
1406
113493
1432
113260
1421
113382
1426
113317
1428
113291
1429
113278
1431
113266
4945
92440
3425
99663
4150
96020
4528
94214
4725
93319
4834
92889
4783
93111
4814
93009
4800
93058
4804
93041
...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 60 questions

Test #15:

score: 0
Accepted
time: 1ms
memory: 4128kb

input:

20000 8 270
39884
39880
9982
89961
2478
122449
5605
105576
7689
97668
6594
101581
6092
103575
5848
104579
5715
105062
5789
104840
5742
104953
5729
105012
5734
104985
5736
104971
5737
104964
22431
62415
30480
50474
26285
56270
28374
53376
27335
54833
26829
55566
27090
55203
27210
55028
27145
55121
90...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 86 questions

Test #16:

score: 0
Accepted
time: 0ms
memory: 4124kb

input:

20000 8 270
39939
39948
10003
89988
2499
122474
610
140584
162
150130
5617
105592
7631
97616
6585
101568
7087
99584
6837
100574
6951
100072
6895
100336
6864
100457
6880
100393
6887
100368
6887
100360
22386
62380
15566
75554
30483
50484
35071
45072
37435
42444
38691
41204
39330
40595
39638
40287
3948...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 78 questions

Test #17:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

20000 9 300
45025
45047
11401
101395
2882
137847
734
158199
179
168894
48
174391
6461
118946
4515
128243
3646
133008
3239
135409
3061
136622
3155
136027
3106
136334
3090
136489
3100
136409
3103
136385
3100
136400
8723
109960
25341
70338
34513
57018
39617
50889
37029
53918
38327
52416
38972
51657
392...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 66 questions

Test #18:

score: 0
Accepted
time: 0ms
memory: 3828kb

input:

20000 9 300
44963
44965
11223
101197
2781
137749
709
158169
25306
70293
17557
85031
21283
77511
23300
73912
24291
72104
23789
73006
23541
73460
23414
73684
23472
73562
23510
73510
23518
73491
23512
73503
34420
56919
29622
63365
101354
11384
70489
25503
57017
34526
85235
17750
93171
14445
89138
16037...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 66 questions

Test #19:

score: 0
Accepted
time: 1ms
memory: 3816kb

input:

20000 10 330
50088
50078
12542
112512
3133
153086
7047
132004
9614
122071
11057
117287
10325
119675
9976
120886
9795
121476
28332
78302
38386
63365
44013
56492
46996
53246
45515
54874
46250
54049
46619
53643
112370
12404
78192
28203
63269
38268
70536
33035
74351
30610
76297
29436
77217
28796
77682
2...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 104 questions

Test #20:

score: 0
Accepted
time: 1ms
memory: 3860kb

input:

20000 10 330
49999
49981
12533
112493
3090
153035
7043
132000
4861
142310
28073
78042
38232
63208
112316
12331
77971
27953
94404
19415
85983
23472
90164
21419
92241
20376
93308
19899
92777
20139
153049
3096
131922
6950
121893
9408
126829
8114
124342
8737
125566
8411
124939
8564
124638
8653
124790
86...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 76 questions

Test #21:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

20000 1 60
4980
4980
1279
11279
308
15307
706
13206
498
14248
395
14770
446
14510
429
14648
441
14583
435
14617
432
14633
433
14625
432
14630
432
14632
11221
1222
7779
2779
9411
1911
10288
1538
10751
1378
10507
1445
10632
1415
10567
1427
10598
1420
10616
1418
10623
1416
10619
1417
10620
1417

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 54 questions

Test #22:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

20000 1 60
5017
5017
1254
11254
296
15296
70
17570
12
18762
2
19378
0
19687
0
19531
1
19455
0
19494
0
19514
0
19523
0
19520
0
19522
11282
1283
7838
2838
9466
1967
8621
2372
8212
2589
8035
2723
8121
2654
8073
2683
8096
2669
8083
2676
8077
2680
8076
2682
8076
2681

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 54 questions

Test #23:

score: 0
Accepted
time: 1ms
memory: 4080kb

input:

20000 1 60
5034
5033
11284
1285
7873
2873
6357
3857
5659
4409
5341
4716
5495
4559
5418
4638
5377
4674
5393
4653
5384
4664
5381
4670
5383
4669
5382
4670
9477
1977
10353
1604
9887
1763
10117
1682
10000
1721
9946
1744
9968
1729
9957
1737
9962
1732
9963
1730
9963
1731

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 50 questions

Test #24:

score: 0
Accepted
time: 1ms
memory: 4112kb

input:

20000 1 60
5052
5053
1229
11228
2847
7847
1977
9476
2390
8640
2176
9052
2078
9265
2123
9154
2153
9106
2167
9082
2172
9068
2169
9075
2167
9079
2167
9081
3893
6393
4456
5706
4754
5381
4594
5532
4674
5456
4714
5419
4691
5436
4680
5444
4685
5440
4681
5441
4683
5441
4684
5440

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 52 questions

Test #25:

score: 0
Accepted
time: 1ms
memory: 3816kb

input:

20000 1 60
4964
4965
1252
11252
340
15340
84
17583
184
16434
136
17012
107
17294
120
17151
124
17077
130
17045
134
17029
135
17020
135
17017
135
17019
2788
7789
1925
9426
1556
10307
1396
10772
1468
10532
1513
10421
1531
10362
1520
10390
1525
10376
1522
10383
1521
10388
1521
10389

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 52 questions

Test #26:

score: 0
Accepted
time: 1ms
memory: 3772kb

input:

20000 1 60
4986
4986
1263
11263
326
15325
725
13224
963
12212
1109
11734
1186
11499
1220
11378
1198
11434
1190
11465
1193
11449
1191
11457
1191
11462
1191
11460
1191
11458
11214
1215
7786
2786
9442
1943
8598
2348
9013
2139
9226
2040
9331
1990
9284
2020
9308
2007
9295
2014
9287
2016
9286
2018
9287
2017

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 56 questions

Test #27:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

20000 1 60
4931
4932
1268
11269
339
15339
98
17598
25
18775
5
19380
14
19078
8
19227
10
19152
9
19191
8
19210
8
19219
8
19215
8
19214
712
13212
975
12226
846
12723
776
12965
742
13086
759
13026
753
13060
746
13073
744
13081
742
13082
743
13082

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 50 questions

Test #28:

score: 0
Accepted
time: 1ms
memory: 3828kb

input:

20000 1 60
4986
4986
1223
11223
292
15291
656
13156
454
14203
558
13684
499
13937
477
14070
491
14006
495
13973
492
13990
492
14000
492
14003
492
14002
11247
1247
15309
309
17576
77
16423
174
15862
238
16138
203
16003
223
16071
213
16104
208
16122
206
16129
204
16126
206
16128
206
16129
205

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 56 questions

Test #29:

score: 0
Accepted
time: 1ms
memory: 4076kb

input:

20000 1 60
5042
5042
1272
11272
305
15304
727
13226
976
12225
1133
11758
1194
11507
1232
11390
1212
11448
1201
11476
1207
11462
1210
11455
1211
11452
1211
11450
1212
11449
11259
1260
7842
2842
9482
1982
10354
1604
10802
1429
10580
1519
10466
1560
10522
1538
10550
1529
10536
1535
10527
1536
10525
153...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 56 questions

Test #30:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

20000 1 60
5058
5058
1231
11230
2824
7823
3843
6343
3322
7072
3070
7446
2952
7640
2886
7730
2854
7775
2871
7755
2860
7764
2856
7770
2855
7772
2856
7771
11262
1263
7874
2875
6407
3907
7119
3369
7490
3116
7673
2987
7776
2934
7819
2899
7845
2885
7858
2878
7866
2877
7861
2878
7860
2878

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 54 questions

Test #31:

score: 0
Accepted
time: 2ms
memory: 3788kb

input:

20000 10 330
50036
50048
12587
112568
3111
153072
734
175689
175
187620
406
181621
286
184621
230
186125
204
186870
7034
132001
9646
122122
28181
78164
38296
63300
32977
70470
30529
74280
35578
66831
36921
65054
37605
64185
112383
12425
78143
28177
63253
38276
56419
43935
70476
33009
66779
35572
650...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 88 questions

Test #32:

score: 0
Accepted
time: 2ms
memory: 3860kb

input:

20000 10 330
49866
49840
12476
112438
3066
153018
7025
131977
9533
121985
10946
117168
10248
119580
10618
118390
10783
117785
10707
118099
10743
117945
10729
118021
10733
117995
10732
118004
28046
78009
38166
63133
112462
12479
78050
28042
63208
38182
70502
32986
66790
35524
68582
34206
67685
34869
...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 98 questions

Test #33:

score: 0
Accepted
time: 2ms
memory: 3832kb

input:

20000 10 330
50082
50083
12537
112507
3151
153111
771
175725
7112
132082
4906
142366
5970
137200
5436
139786
5164
141074
5034
141714
5092
141402
5058
141558
5074
141484
5063
141533
5062
141542
28171
78149
38372
63354
44010
56492
46992
53253
45454
54826
44743
55665
45100
55252
44915
55457
45013
55355...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 68 questions

Test #34:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

20000 10 330
50058
50067
12432
112408
3194
153148
6989
131955
4898
142357
9493
121969
8201
126929
28074
78065
19482
94468
15743
103219
17615
98851
18520
96636
18981
95547
18753
96099
18633
96379
18567
96513
18541
96587
18533
96619
18524
96630
38251
63247
44008
56507
46995
53264
45483
54862
46233
540...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 80 questions

Test #35:

score: 0
Accepted
time: 1ms
memory: 3864kb

input:

20000 10 330
50003
49997
12593
112567
3076
153037
760
175711
1735
164186
2342
158553
2712
155803
2902
154433
2981
153732
3028
153389
3008
153559
3022
153473
3024
153445
3022
153463
7014
131988
4810
142279
28223
78216
19597
94587
15890
103370
17674
98924
16746
101106
17202
100012
16959
100539
17066
1...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 74 questions

Test #36:

score: 0
Accepted
time: 0ms
memory: 4132kb

input:

20000 10 330
49968
49966
12545
112517
3093
153047
7067
132023
9583
122047
28125
78116
19531
94517
15847
103333
14147
107884
112363
12384
78113
28117
94429
19443
86074
23578
90220
21484
92315
20469
91267
20981
90751
21235
90995
21109
90864
21178
90795
21209
90772
21226
90757
21231
153103
3150
131965
...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 72 questions

Test #37:

score: 0
Accepted
time: 2ms
memory: 4092kb

input:

20000 10 330
50054
50051
12489
112452
3088
153035
6969
131932
4786
142249
3888
147611
3489
150325
28175
78157
19556
94537
15799
103280
14068
107809
13289
110138
13671
108972
13463
109541
38341
63323
44054
56551
41147
59899
39762
61634
39074
62496
39402
62054
39241
62293
39156
62398
39204
62346
39216...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 88 questions

Test #38:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

20000 10 330
50009
50000
12441
112409
3169
153132
809
175764
214
187669
42
193757
8
196843
4
198389
7
197612
7
197232
8
197033
8
196933
8
196903
8
196913
27878
77868
19395
94382
15720
103199
14030
107765
112448
12480
78212
28221
63253
38253
94478
19497
86077
23596
82134
25906
103339
15868
98840
1761...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 78 questions

Test #39:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

20000 10 330
49951
49950
12505
112470
3069
153029
771
175731
166
187616
421
181631
574
178664
679
177210
27996
77982
19442
94419
15790
103257
17567
98794
18506
96623
18038
97715
17809
98266
17700
98547
17754
98411
17723
98470
17734
98441
17737
98434
38218
63217
32983
70477
112383
12414
78070
28079
6...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 88 questions

Test #40:

score: 0
Accepted
time: 1ms
memory: 3928kb

input:

20000 10 330
50021
50014
12331
112293
3146
153098
7006
131967
28068
78039
38175
63162
32969
70440
35578
66825
34279
68640
33619
69530
33932
69073
33778
69309
33856
69197
33817
69248
33836
69227
33838
69219
112443
12461
78191
28193
94548
19566
86189
23700
153028
3063
131874
6897
142213
4743
175723
77...

output:

? 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok 68 questions