QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#121575#41. Worm WorriesNOI_AK_ME100 ✓139ms6024kbC++232.6kb2023-07-08 14:52:082023-07-08 14:52:12

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-08 14:52:12]
  • 评测
  • 测评结果:100
  • 用时:139ms
  • 内存:6024kb
  • [2023-07-08 14:52:08]
  • 提交

answer

#include <map>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <random>
#include <algorithm>
std::mt19937 rnd(time(NULL));
int n, m, k;
struct Node {
    int x, y, z;
    Node(int _x = 0, int _y = 0, int _z = 0) {
        x = _x, y = _y, z = _z;
    }
    friend Node operator +(const Node &a, const Node &b) {
        return Node(a.x + b.x, a.y + b.y, a.z + b.z);
    }
    friend Node operator *(const Node &a, int b) {
        return Node(a.x * b, a.y * b, a.z * b);
    }
    friend bool operator <(const Node &a, const Node &b) {
        return a.x == b.x ? (a.y == b.y ? a.z < b.z : a.y < b.y) : a.x < b.x;
    }
};
const Node d[6] = {Node(1, 0, 0), Node(-1, 0, 0), Node(0, 1, 0), Node(0, -1, 0), Node(0, 0, 1), Node(0, 0, -1)};
std::map<Node, int> mp;
int query(Node a) {
    if (a.x < 1 || a.x > n || a.y < 1 || a.y > m || a.z < 1 || a.z > k) {
        return 0;
    }

    if (mp.count(a) > 0)
        return mp[a];

    printf("? %d %d %d\n", a.x, a.y, a.z);
    fflush(stdout);
    scanf("%d", &mp[a]);
    return mp[a];
}
Node solve(Node a) {
    double x = (3 - sqrt(5)) / 2;
    int val = query(a);

    for (int i = 0; i < 6; ++i) {
        int tmp = query(a + d[i]);

        if (tmp <= val)
            continue;

        int left = 1, right;

        switch (i) {
        case 0:
            right = n - a.x;
            break;

        case 1:
            right = a.x;
            break;

        case 2:
            right = m - a.y;
            break;

        case 3:
            right = a.y;
            break;

        case 4:
            right = k - a.z;
            break;

        default:
            right = a.z;
        }

        int l = left + floor((right - left) * x), r = right - floor((right - left) * x);

        while (l < r) {
            int u = query(a + d[i] * l), v = query(a + d[i] * r);

            if (u <= v && val <= v)
                left = l + 1, l = r, r = right - floor((right - left) * x);
            else
                right = r - 1, r = l, l = left + floor((right - left) * x);
        }

        while (left < right) {
            int mid = (left + right) / 2;
            int u = query(a + d[i] * mid), v = query(a + d[i] * (mid + 1));

            if (u <= v && val <= v)
                left = mid + 1;
            else
                right = mid;
        }

        return solve(a + d[i] * left);
    }

    return a;
}
int main() {
    scanf("%d%d%d%*d", &n, &m, &k);
    Node ans;
    ans.x = rnd() % n + 1, ans.y = rnd() % m + 1, ans.z = rnd() % k + 1;
    ans = solve(ans);
    printf("! %d %d %d", ans.x, ans.y, ans.z);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 1ms
memory: 3132kb

input:

1000000 1 1 10000
19815
19815
19815

output:

? 758468 1 1
? 758469 1 1
? 758467 1 1
! 758468 1 1

result:

ok ok, 3/10000 queries

Test #2:

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

input:

1000000 1 1 10000
778278
778279
870535
927554
962793
984572
998032
1006351
1011492
1014670
1016634
1017848
1018598
1019061
1019348
1019525
1019634
1019702
1019744
1019770
1019786
1019796
1019802
1019806
1019808
1019809
1019810

output:

? 758468 1 1
? 758469 1 1
? 850725 1 1
? 907744 1 1
? 942983 1 1
? 964762 1 1
? 978222 1 1
? 986541 1 1
? 991682 1 1
? 994860 1 1
? 996824 1 1
? 998038 1 1
? 998788 1 1
? 999251 1 1
? 999538 1 1
? 999715 1 1
? 999824 1 1
? 999892 1 1
? 999934 1 1
? 999960 1 1
? 999976 1 1
? 999986 1 1
? 999992 1 1
?...

result:

ok ok, 27/10000 queries

Test #3:

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

input:

1000000 1 1 10000
261343
261342
261344
551052
730103
840762
909153
951421
977544
993689
1003667
1009834
1013645
1016001
1017457
1018357
1018913
1019257
1019469
1019600
1019681
1019731
1019762
1019781
1019793
1019800
1019805
1019808
1019810
1019809

output:

? 758468 1 1
? 758469 1 1
? 758467 1 1
? 468759 1 1
? 289708 1 1
? 179049 1 1
? 110658 1 1
? 68390 1 1
? 42267 1 1
? 26122 1 1
? 16144 1 1
? 9977 1 1
? 6166 1 1
? 3810 1 1
? 2354 1 1
? 1454 1 1
? 898 1 1
? 554 1 1
? 342 1 1
? 211 1 1
? 130 1 1
? 80 1 1
? 49 1 1
? 30 1 1
? 18 1 1
? 11 1 1
? 6 1 1
? 3...

result:

ok ok, 30/10000 queries

Test #4:

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

input:

1000000 1 1 10000
45094839
45094739
45094939
74065739
91970839
103036739
109875839
114102639
116714939
118329439
86248277
117712739
118710539
118946139
86483777
118856139
119001739
119036139
119057339
86504977
119049239
86513077
119054239
119059339
200322608
86514277
119060039
86514677
119060339
865...

output:

? 758468 1 1
? 758469 1 1
? 758467 1 1
? 468759 1 1
? 289708 1 1
? 179049 1 1
? 110658 1 1
? 68390 1 1
? 42267 1 1
? 26122 1 1
? 16144 1 1
? 32289 1 1
? 22311 1 1
? 19955 1 1
? 18499 1 1
? 20855 1 1
? 19399 1 1
? 19055 1 1
? 18843 1 1
? 18711 1 1
? 18924 1 1
? 18792 1 1
? 18874 1 1
? 18823 1 1
? 188...

result:

ok ok, 31/10000 queries

Test #5:

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

input:

1000000 1 1 10000
312370
312370
312370

output:

? 758468 1 1
? 758469 1 1
? 758467 1 1
! 758468 1 1

result:

ok ok, 3/10000 queries

Subtask #2:

score: 22
Accepted

Test #6:

score: 22
Accepted
time: 3ms
memory: 3140kb

input:

1000000 1 1 35
50280516
50310516
34434003
100840104
104416853
25352854
36264917
64512089
90651934
68053137
53894545
79016731
81916853
14458520
95806853
5848520
101116853
2578520
103156853
1318520
103936853
104716853
104896853
1138520
104836853
1078520
104866853
104926853

output:

? 758468 1 1
? 758469 1 1
? 850725 1 1
? 907744 1 1
? 942983 1 1
? 964762 1 1
? 929523 1 1
? 951302 1 1
? 937842 1 1
? 946161 1 1
? 941019 1 1
? 944197 1 1
? 942233 1 1
? 943447 1 1
? 942696 1 1
? 943160 1 1
? 942873 1 1
? 943051 1 1
? 942941 1 1
? 943009 1 1
? 942967 1 1
? 942993 1 1
? 942999 1 1
?...

result:

ok ok, 28/35 queries

Test #7:

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

input:

1000000 1 1 35
19815
19815
19815

output:

? 758468 1 1
? 758469 1 1
? 758467 1 1
! 758468 1 1

result:

ok ok, 3/35 queries

Test #8:

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

input:

1000000 1 1 35
778278
778279
870535
927554
962793
984572
998032
1006351
1011492
1014670
1016634
1017848
1018598
1019061
1019348
1019525
1019634
1019702
1019744
1019770
1019786
1019796
1019802
1019806
1019808
1019809
1019810

output:

? 758468 1 1
? 758469 1 1
? 850725 1 1
? 907744 1 1
? 942983 1 1
? 964762 1 1
? 978222 1 1
? 986541 1 1
? 991682 1 1
? 994860 1 1
? 996824 1 1
? 998038 1 1
? 998788 1 1
? 999251 1 1
? 999538 1 1
? 999715 1 1
? 999824 1 1
? 999892 1 1
? 999934 1 1
? 999960 1 1
? 999976 1 1
? 999986 1 1
? 999992 1 1
?...

result:

ok ok, 27/35 queries

Test #9:

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

input:

1000000 1 1 35
261343
261342
261344
551052
730103
840762
909153
951421
977544
993689
1003667
1009834
1013645
1016001
1017457
1018357
1018913
1019257
1019469
1019600
1019681
1019731
1019762
1019781
1019793
1019800
1019805
1019808
1019810
1019809

output:

? 758468 1 1
? 758469 1 1
? 758467 1 1
? 468759 1 1
? 289708 1 1
? 179049 1 1
? 110658 1 1
? 68390 1 1
? 42267 1 1
? 26122 1 1
? 16144 1 1
? 9977 1 1
? 6166 1 1
? 3810 1 1
? 2354 1 1
? 1454 1 1
? 898 1 1
? 554 1 1
? 342 1 1
? 211 1 1
? 130 1 1
? 80 1 1
? 49 1 1
? 30 1 1
? 18 1 1
? 11 1 1
? 6 1 1
? 3...

result:

ok ok, 30/35 queries

Test #10:

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

input:

1000000 1 1 35
45094839
45094739
45094939
74065739
91970839
103036739
109875839
114102639
116714939
118329439
86248277
117712739
118710539
118946139
86483777
118856139
119001739
119036139
119057339
86504977
119049239
86513077
119054239
119059339
200322608
86514277
119060039
86514677
119060339
865148...

output:

? 758468 1 1
? 758469 1 1
? 758467 1 1
? 468759 1 1
? 289708 1 1
? 179049 1 1
? 110658 1 1
? 68390 1 1
? 42267 1 1
? 26122 1 1
? 16144 1 1
? 32289 1 1
? 22311 1 1
? 19955 1 1
? 18499 1 1
? 20855 1 1
? 19399 1 1
? 19055 1 1
? 18843 1 1
? 18711 1 1
? 18924 1 1
? 18792 1 1
? 18874 1 1
? 18823 1 1
? 188...

result:

ok ok, 31/35 queries

Test #11:

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

input:

1000000 1 1 35
109084601
109084501
109084701
138055501
155960601
167026501
173865601
178092401
180704701
182319201
86545601
181702501
182700301
182935901
86781101
182845901
182991501
183025901
183047101
86802301
183039001
86810401
183044001
183049101
200619932
86811601
183049801
86812001
183050101
8...

output:

? 758468 1 1
? 758469 1 1
? 758467 1 1
? 468759 1 1
? 289708 1 1
? 179049 1 1
? 110658 1 1
? 68390 1 1
? 42267 1 1
? 26122 1 1
? 16144 1 1
? 32289 1 1
? 22311 1 1
? 19955 1 1
? 18499 1 1
? 20855 1 1
? 19399 1 1
? 19055 1 1
? 18843 1 1
? 18711 1 1
? 18924 1 1
? 18792 1 1
? 18874 1 1
? 18823 1 1
? 188...

result:

ok ok, 31/35 queries

Test #12:

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

input:

1000000 1 1 35
45094839
45094739
45094939
74065739
91970839
103036739
109875839
114102639
116714939
118329439
86248277
117712739
118710539
118946139
86483777
118856139
119001739
119036139
119057339
86504977
119049239
86513077
119054239
119059339
200322608
86514277
119060039
86514677
119060339
865148...

output:

? 758468 1 1
? 758469 1 1
? 758467 1 1
? 468759 1 1
? 289708 1 1
? 179049 1 1
? 110658 1 1
? 68390 1 1
? 42267 1 1
? 26122 1 1
? 16144 1 1
? 32289 1 1
? 22311 1 1
? 19955 1 1
? 18499 1 1
? 20855 1 1
? 19399 1 1
? 19055 1 1
? 18843 1 1
? 18711 1 1
? 18924 1 1
? 18792 1 1
? 18874 1 1
? 18823 1 1
? 188...

result:

ok ok, 31/35 queries

Test #13:

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

input:

1000000 1 1 35
109084601
109084501
109084701
138055501
155960601
167026501
173865601
178092401
180704701
182319201
86545601
181702501
182700301
182935901
86781101
182845901
182991501
183025901
183047101
86802301
183039001
86810401
183044001
183049101
200619932
86811601
183049801
86812001
183050101
8...

output:

? 758468 1 1
? 758469 1 1
? 758467 1 1
? 468759 1 1
? 289708 1 1
? 179049 1 1
? 110658 1 1
? 68390 1 1
? 42267 1 1
? 26122 1 1
? 16144 1 1
? 32289 1 1
? 22311 1 1
? 19955 1 1
? 18499 1 1
? 20855 1 1
? 19399 1 1
? 19055 1 1
? 18843 1 1
? 18711 1 1
? 18924 1 1
? 18792 1 1
? 18874 1 1
? 18823 1 1
? 188...

result:

ok ok, 31/35 queries

Test #14:

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

input:

1000000 1 1 35
35347210
35347099
35347322
71648026
100478216
123530302
142181137
157602728
170935601
183911554
128768782
178043931
188964585
193824680
175842227
191640405
195661162
197316162
199227314
186458879
198273374
194273773
198789904
199647911
200312370
196647081
199883464
197912875
200041106...

output:

? 758468 1 1
? 758469 1 1
? 758467 1 1
? 468759 1 1
? 289708 1 1
? 179049 1 1
? 110658 1 1
? 68390 1 1
? 42267 1 1
? 26122 1 1
? 16144 1 1
? 32289 1 1
? 22311 1 1
? 19955 1 1
? 18499 1 1
? 20855 1 1
? 19399 1 1
? 19055 1 1
? 18843 1 1
? 18711 1 1
? 18924 1 1
? 18792 1 1
? 18874 1 1
? 18823 1 1
? 188...

result:

ok ok, 31/35 queries

Test #15:

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

input:

1000000 1 1 35
75955584
75955332
75955836
141310276
172749132
187773101
194870835
198154274
199610098
200190164
190168470
200006482
200271891
200304805
199906485
200294304
200309582
200311624
200312334
200238720
200312135
200306270
200312272
200312361
200312370
200311005
200312367
200311987
20031236...

output:

? 758468 1 1
? 758469 1 1
? 758467 1 1
? 468759 1 1
? 289708 1 1
? 179049 1 1
? 110658 1 1
? 68390 1 1
? 42267 1 1
? 26122 1 1
? 16144 1 1
? 32289 1 1
? 22311 1 1
? 19955 1 1
? 18499 1 1
? 20855 1 1
? 19399 1 1
? 19055 1 1
? 18843 1 1
? 18711 1 1
? 18924 1 1
? 18792 1 1
? 18874 1 1
? 18823 1 1
? 188...

result:

ok ok, 31/35 queries

Test #16:

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

input:

1000000 1 1 35
312370
312370
312370

output:

? 758468 1 1
? 758469 1 1
? 758467 1 1
! 758468 1 1

result:

ok ok, 3/35 queries

Subtask #3:

score: 12
Accepted

Test #17:

score: 12
Accepted
time: 1ms
memory: 3132kb

input:

200 200 1 4000
19815
19815
19815
19815
19815

output:

? 68 55 1
? 69 55 1
? 67 55 1
? 68 56 1
? 68 54 1
! 68 55 1

result:

ok ok, 5/4000 queries

Test #18:

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

input:

200 200 1 4000
19932
19933
19983
20014
20034
20046
20053
20058
20061
20063
20064
20065
20120
20154
20176
20189
20197
20202
20205
20207
20208
20209
20208

output:

? 68 55 1
? 69 55 1
? 119 55 1
? 150 55 1
? 170 55 1
? 182 55 1
? 189 55 1
? 194 55 1
? 197 55 1
? 199 55 1
? 200 55 1
? 200 56 1
? 200 111 1
? 200 145 1
? 200 167 1
? 200 180 1
? 200 188 1
? 200 193 1
? 200 196 1
? 200 198 1
? 200 199 1
? 200 200 1
? 199 200 1
! 200 200 1

result:

ok ok, 23/4000 queries

Test #19:

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

input:

200 200 1 4000
312370
312370
312370
312370
312370

output:

? 68 55 1
? 69 55 1
? 67 55 1
? 68 56 1
? 68 54 1
! 68 55 1

result:

ok ok, 5/4000 queries

Test #20:

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

input:

200 200 1 4000
1312372
1312371
1312371
1316813
1321808
1312372
1312372
1321821
1323441
1323446
1323449
1323451
1323452
1323453
1312372
1323454
1323643
1323820
1323990
1312372
1312372
1312372
1323988
1323991
1312372
1323992
1312372
1316721
1322293
1322306
1323898
1323903
1312372
1312372
1323993
13239...

output:

? 68 55 1
? 69 55 1
? 67 55 1
? 68 56 1
? 68 111 1
? 68 145 1
? 68 89 1
? 68 124 1
? 68 132 1
? 68 137 1
? 68 140 1
? 68 142 1
? 68 143 1
? 68 144 1
? 69 144 1
? 67 144 1
? 42 144 1
? 25 144 1
? 15 144 1
? 9 144 1
? 19 144 1
? 13 144 1
? 17 144 1
? 14 144 1
? 14 145 1
? 14 143 1
? 14 89 1
? 14 54 1
...

result:

ok ok, 202/4000 queries

Test #21:

score: 0
Accepted
time: 3ms
memory: 3140kb

input:

200 200 1 4000
1494365
1494364
1494364
44313297
101635973
1494365
1494365
101570973
107360973
109795973
111220973
111890973
1494365
1494365
111895973
112145973
112300973
57440973
112240973
112340973
1494365
112325973
112350973
112355973
112360973
1494365
112365973
44788297
35873297
48053297
11722597...

output:

? 68 55 1
? 69 55 1
? 67 55 1
? 68 56 1
? 68 111 1
? 68 145 1
? 68 89 1
? 68 124 1
? 68 102 1
? 68 97 1
? 68 94 1
? 68 92 1
? 68 91 1
? 68 93 1
? 69 92 1
? 119 92 1
? 150 92 1
? 170 92 1
? 138 92 1
? 158 92 1
? 163 92 1
? 155 92 1
? 160 92 1
? 161 92 1
? 162 92 1
? 162 93 1
? 162 91 1
? 162 57 1
? 1...

result:

ok ok, 96/4000 queries

Test #22:

score: 0
Accepted
time: 9ms
memory: 3164kb

input:

200 200 1 4000
1019813
1019812
1019812
1035930
1037545
1019813
1037523
1037558
1037566
1019813
1037563
1037568
1019813
1037567
1037569
1037619
1035026
1037599
1037631
1037078
1037626
1037634
1037364
1037633
1019813
1019813
1037635
1037685
1034730
1037666
1037698
1036854
1037693
1019813
1037696
10376...

output:

? 68 55 1
? 69 55 1
? 67 55 1
? 68 56 1
? 68 111 1
? 68 145 1
? 68 89 1
? 68 124 1
? 68 132 1
? 68 137 1
? 68 129 1
? 68 134 1
? 68 135 1
? 68 133 1
? 69 134 1
? 119 134 1
? 150 134 1
? 99 134 1
? 131 134 1
? 138 134 1
? 126 134 1
? 134 134 1
? 136 134 1
? 133 134 1
? 135 134 1
? 134 135 1
? 134 133...

result:

ok ok, 755/4000 queries

Test #23:

score: 0
Accepted
time: 3ms
memory: 3152kb

input:

200 200 1 4000
1322610
1322609
1322609
166213980
174288980
1322610
174178980
174353980
174393980
1322610
174378980
174403980
1322610
174398980
174408980
174658980
161693980
174558980
174718980
171953980
174693980
174733980
173383980
174728980
1322610
1322610
174738980
174988980
160213980
174893980
1...

output:

? 68 55 1
? 69 55 1
? 67 55 1
? 68 56 1
? 68 111 1
? 68 145 1
? 68 89 1
? 68 124 1
? 68 132 1
? 68 137 1
? 68 129 1
? 68 134 1
? 68 135 1
? 68 133 1
? 69 134 1
? 119 134 1
? 150 134 1
? 99 134 1
? 131 134 1
? 138 134 1
? 126 134 1
? 134 134 1
? 136 134 1
? 133 134 1
? 135 134 1
? 134 135 1
? 134 133...

result:

ok ok, 235/4000 queries

Subtask #4:

score: 19
Accepted

Test #24:

score: 19
Accepted
time: 1ms
memory: 3132kb

input:

1000 1000 1 3500
19815
19815
19815
19815
19815

output:

? 468 55 1
? 469 55 1
? 467 55 1
? 468 56 1
? 468 54 1
! 468 55 1

result:

ok ok, 5/3500 queries

Test #25:

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

input:

1000 1000 1 3500
21163
21164
21385
21524
21608
21661
21694
21714
21726
21734
21739
21742
21744
21745
21744
21746
21770
21786
21796
21802
21806
21808
21809
21808

output:

? 418 65 1
? 419 65 1
? 640 65 1
? 779 65 1
? 863 65 1
? 916 65 1
? 949 65 1
? 969 65 1
? 981 65 1
? 989 65 1
? 994 65 1
? 997 65 1
? 999 65 1
? 1000 65 1
? 1000 66 1
? 1000 64 1
? 1000 40 1
? 1000 24 1
? 1000 14 1
? 1000 8 1
? 1000 4 1
? 1000 2 1
? 1000 1 1
? 999 1 1
! 1000 1 1

result:

ok ok, 24/3500 queries

Test #26:

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

input:

1000 1000 1 3500
312370
312370
312370
312370
312370

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 64 1
! 418 65 1

result:

ok ok, 5/3500 queries

Test #27:

score: 0
Accepted
time: 3ms
memory: 3244kb

input:

1000 1000 1 3500
1426732
1312371
1312371
1426733
1568725
1655363
1701167
1713512
1719054
1312372
1312372
1312372
1719062
1717803
1719059
1719064
1719065
1312372
1312372
1719066
1678193
1380104
1719752
1719486
1678051
1719681
1719797
1312372
1719793
1677991
1719795
1312372
1719796
1719798
1723013
172...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 780 1
? 418 865 1
? 418 917 1
? 418 949 1
? 418 897 1
? 418 929 1
? 418 909 1
? 418 904 1
? 418 912 1
? 418 907 1
? 418 906 1
? 418 905 1
? 419 906 1
? 417 906 1
? 258 906 1
? 159 906 1
? 319 906 1
? 357 906 1
? 296 906 1
? 33...

result:

ok ok, 117/3500 queries

Test #28:

score: 0
Accepted
time: 7ms
memory: 3148kb

input:

1000 1000 1 3500
31462697
1494364
1494364
31462897
81609297
81017697
44386097
81380897
1494365
81506497
1494365
81576097
81631897
81640497
1494365
81631297
1494365
1494365
81640297
81640697
83415697
1494365
1494365
83482497
83498697
80266173
83500497
83501497
83492697
83501097
1494365
83501297
83501...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 281/3500 queries

Test #29:

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

input:

1000 1000 1 3500
26434205
1619933
1619933
26434535
160716550
156726597
49265047
159131715
1619934
159995767
1619934
160482387
160876720
160937835
1619934
160872459
1619934
1619934
160936413
160939257
176563456
1619934
1619934
177347032
177540903
124714687
177562540
177574570
177468917
177569757
1619...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 147/3500 queries

Test #30:

score: 0
Accepted
time: 9ms
memory: 3268kb

input:

1000 1000 1 3500
31462697
1494364
1494364
31462897
81609297
81017697
44386097
81380897
1494365
81506497
1494365
81576097
81631897
81640497
1494365
81631297
1494365
1494365
81640297
81640697
83415697
1494365
1494365
83482497
83498697
80266173
83500497
83501497
83492697
83501097
1494365
83501297
83501...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 281/3500 queries

Test #31:

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

input:

1000 1000 1 3500
26434205
1619933
1619933
26434535
160716550
156726597
49265047
159131715
1619934
159995767
1619934
160482387
160876720
160937835
1619934
160872459
1619934
1619934
160936413
160939257
176563456
1619934
1619934
177347032
177540903
124714687
177562540
177574570
177468917
177569757
1619...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 147/3500 queries

Test #32:

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

input:

1000 1000 1 3500
31462697
1494364
1494364
31462897
81609297
81017697
44386097
81380897
1494365
81506497
1494365
81576097
81631897
81640497
1494365
81631297
1494365
1494365
81640297
81640697
83415697
1494365
1494365
83482497
83498697
80266173
83500497
83501497
83492697
83501097
1494365
83501297
83501...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 281/3500 queries

Test #33:

score: 0
Accepted
time: 4ms
memory: 3140kb

input:

1000 1000 1 3500
26434205
1619933
1619933
26434535
160716550
156726597
49265047
159131715
1619934
159995767
1619934
160482387
160876720
160937835
1619934
160872459
1619934
1619934
160936413
160939257
176563456
1619934
1619934
177347032
177540903
124714687
177562540
177574570
177468917
177569757
1619...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 147/3500 queries

Test #34:

score: 0
Accepted
time: 8ms
memory: 3132kb

input:

1000 1000 1 3500
31462697
1494364
1494364
31462897
81609297
81017697
44386097
81380897
1494365
81506497
1494365
81576097
81631897
81640497
1494365
81631297
1494365
1494365
81640297
81640697
83415697
1494365
1494365
83482497
83498697
80266173
83500497
83501497
83492697
83501097
1494365
83501297
83501...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 281/3500 queries

Test #35:

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

input:

1000 1000 1 3500
26434205
1619933
1619933
26434535
160716550
156726597
49265047
159131715
1619934
159995767
1619934
160482387
160876720
160937835
1619934
160872459
1619934
1619934
160936413
160939257
176563456
1619934
1619934
177347032
177540903
124714687
177562540
177574570
177468917
177569757
1619...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 147/3500 queries

Test #36:

score: 0
Accepted
time: 3ms
memory: 3144kb

input:

1000 1000 1 3500
31462697
1494364
1494364
31462897
81609297
81017697
44386097
81380897
1494365
81506497
1494365
81576097
81631897
81640497
1494365
81631297
1494365
1494365
81640297
81640697
83415697
1494365
1494365
83482497
83498697
80266173
83500497
83501497
83492697
83501097
1494365
83501297
83501...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 281/3500 queries

Test #37:

score: 0
Accepted
time: 3ms
memory: 3256kb

input:

1000 1000 1 3500
26434205
1619933
1619933
26434535
160716550
156726597
49265047
159131715
1619934
159995767
1619934
160482387
160876720
160937835
1619934
160872459
1619934
1619934
160936413
160939257
176563456
1619934
1619934
177347032
177540903
124714687
177562540
177574570
177468917
177569757
1619...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 147/3500 queries

Test #38:

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

input:

1000 1000 1 3500
31462697
1494364
1494364
31462897
81609297
81017697
44386097
81380897
1494365
81506497
1494365
81576097
81631897
81640497
1494365
81631297
1494365
1494365
81640297
81640697
83415697
1494365
1494365
83482497
83498697
80266173
83500497
83501497
83492697
83501097
1494365
83501297
83501...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 281/3500 queries

Test #39:

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

input:

1000 1000 1 3500
26434205
1619933
1619933
26434535
160716550
156726597
49265047
159131715
1619934
159995767
1619934
160482387
160876720
160937835
1619934
160872459
1619934
1619934
160936413
160939257
176563456
1619934
1619934
177347032
177540903
124714687
177562540
177574570
177468917
177569757
1619...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 147/3500 queries

Test #40:

score: 0
Accepted
time: 7ms
memory: 3268kb

input:

1000 1000 1 3500
31462697
1494364
1494364
31462897
81609297
81017697
44386097
81380897
1494365
81506497
1494365
81576097
81631897
81640497
1494365
81631297
1494365
1494365
81640297
81640697
83415697
1494365
1494365
83482497
83498697
80266173
83500497
83501497
83492697
83501097
1494365
83501297
83501...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 281/3500 queries

Test #41:

score: 0
Accepted
time: 4ms
memory: 3252kb

input:

1000 1000 1 3500
26434205
1619933
1619933
26434535
160716550
156726597
49265047
159131715
1619934
159995767
1619934
160482387
160876720
160937835
1619934
160872459
1619934
1619934
160936413
160939257
176563456
1619934
1619934
177347032
177540903
124714687
177562540
177574570
177468917
177569757
1619...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 286 1
? 418 508 1
? 418 371 1
? 418 456 1
? 418 403 1
? 418 436 1
? 418 415 1
? 418 410 1
? 418 407 1
? 418 412 1
? 418 409 1
? 418 411 1
? 419 410 1
? 417 410 1
? 258 410 1
? 159 410 1
? 319 410 1
? 220 410 1
? 197 410 1
? 18...

result:

ok ok, 147/3500 queries

Test #42:

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

input:

1000 1000 1 3500
1322610
1322609
1322609
97354142
24762942
30166542
53150542
1322610
42615342
1322610
48842542
1322610
51388942
1322610
1322610
53598942
1322610
1322610
53598742
53599142
53630942
1322610
53618742
53638542
1322610
53635542
1322610
53637342
54546542
55005342
1322610
1322610
55005142
5...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 780 1
? 418 865 1
? 418 728 1
? 418 813 1
? 418 760 1
? 418 793 1
? 418 772 1
? 418 785 1
? 418 777 1
? 418 782 1
? 418 783 1
? 418 781 1
? 419 782 1
? 417 782 1
? 258 782 1
? 159 782 1
? 319 782 1
? 220 782 1
? 197 782 1
? 23...

result:

ok ok, 390/3500 queries

Test #43:

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

input:

1000 1000 1 3500
1322610
1322609
1322609
97354142
24762942
30166542
53150542
1322610
42615342
1322610
48842542
1322610
51388942
1322610
1322610
53598942
1322610
1322610
53598742
53599142
53630942
1322610
53618742
53638542
1322610
53635542
1322610
53637342
54546542
55005342
1322610
1322610
55005142
5...

output:

? 418 65 1
? 419 65 1
? 417 65 1
? 418 66 1
? 418 422 1
? 418 644 1
? 418 780 1
? 418 865 1
? 418 728 1
? 418 813 1
? 418 760 1
? 418 793 1
? 418 772 1
? 418 785 1
? 418 777 1
? 418 782 1
? 418 783 1
? 418 781 1
? 419 782 1
? 417 782 1
? 258 782 1
? 159 782 1
? 319 782 1
? 220 782 1
? 197 782 1
? 23...

result:

ok ok, 390/3500 queries

Test #44:

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

input:

1000 1000 1 3500
1322609
87273780
1322609
1322609
49925942
72227942
89375142
101009942
1322609
1322609
103881942
1322609
1322609
104607942
1322609
1322609
104608142
104666342
104702342
104724742
104738542
104747142
1322610
104743742
104749142
104750342
104751142
104751542
1322610
104751342
104751742...

output:

? 5 237 1
? 6 237 1
? 385 237 1
? 621 237 1
? 766 237 1
? 856 237 1
? 912 237 1
? 946 237 1
? 967 237 1
? 933 237 1
? 954 237 1
? 959 237 1
? 951 237 1
? 956 237 1
? 957 237 1
? 955 237 1
? 956 238 1
? 956 529 1
? 956 709 1
? 956 821 1
? 956 890 1
? 956 933 1
? 956 959 1
? 956 916 1
? 956 943 1
? 95...

result:

ok ok, 219/3500 queries

Test #45:

score: 0
Accepted
time: 10ms
memory: 3252kb

input:

1000 1000 1 3500
1322609
87273780
1322609
1322609
49925942
72227942
89375142
101009942
1322609
1322609
103881942
1322609
1322609
104607942
1322609
1322609
104608142
104666342
104702342
104724742
104738542
104747142
1322610
104743742
104749142
104750342
104751142
104751542
1322610
104751342
104751742...

output:

? 5 237 1
? 6 237 1
? 385 237 1
? 621 237 1
? 766 237 1
? 856 237 1
? 912 237 1
? 946 237 1
? 967 237 1
? 933 237 1
? 954 237 1
? 959 237 1
? 951 237 1
? 956 237 1
? 957 237 1
? 955 237 1
? 956 238 1
? 956 529 1
? 956 709 1
? 956 821 1
? 956 890 1
? 956 933 1
? 956 959 1
? 956 916 1
? 956 943 1
? 95...

result:

ok ok, 219/3500 queries

Test #46:

score: 0
Accepted
time: 6ms
memory: 3264kb

input:

1000 1000 1 3500
1322609
87273780
1322609
1322609
49925942
72227942
89375142
101009942
1322609
1322609
103881942
1322609
1322609
104607942
1322609
1322609
104608142
104666342
104702342
104724742
104738542
104747142
1322610
104743742
104749142
104750342
104751142
104751542
1322610
104751342
104751742...

output:

? 5 237 1
? 6 237 1
? 385 237 1
? 621 237 1
? 766 237 1
? 856 237 1
? 912 237 1
? 946 237 1
? 967 237 1
? 933 237 1
? 954 237 1
? 959 237 1
? 951 237 1
? 956 237 1
? 957 237 1
? 955 237 1
? 956 238 1
? 956 529 1
? 956 709 1
? 956 821 1
? 956 890 1
? 956 933 1
? 956 959 1
? 956 916 1
? 956 943 1
? 95...

result:

ok ok, 219/3500 queries

Test #47:

score: 0
Accepted
time: 5ms
memory: 3228kb

input:

1000 1000 1 3500
1322609
87273780
1322609
1322609
49925942
72227942
89375142
101009942
1322609
1322609
103881942
1322609
1322609
104607942
1322609
1322609
104608142
104666342
104702342
104724742
104738542
104747142
1322610
104743742
104749142
104750342
104751142
104751542
1322610
104751342
104751742...

output:

? 5 237 1
? 6 237 1
? 385 237 1
? 621 237 1
? 766 237 1
? 856 237 1
? 912 237 1
? 946 237 1
? 967 237 1
? 933 237 1
? 954 237 1
? 959 237 1
? 951 237 1
? 956 237 1
? 957 237 1
? 955 237 1
? 956 238 1
? 956 529 1
? 956 709 1
? 956 821 1
? 956 890 1
? 956 933 1
? 956 959 1
? 956 916 1
? 956 943 1
? 95...

result:

ok ok, 219/3500 queries

Test #48:

score: 0
Accepted
time: 4ms
memory: 3244kb

input:

1000 1000 1 3500
1322609
87273780
1322609
1322609
49925942
72227942
89375142
101009942
1322609
1322609
103881942
1322609
1322609
104607942
1322609
1322609
104608142
104666342
104702342
104724742
104738542
104747142
1322610
104743742
104749142
104750342
104751142
104751542
1322610
104751342
104751742...

output:

? 5 237 1
? 6 237 1
? 385 237 1
? 621 237 1
? 766 237 1
? 856 237 1
? 912 237 1
? 946 237 1
? 967 237 1
? 933 237 1
? 954 237 1
? 959 237 1
? 951 237 1
? 956 237 1
? 957 237 1
? 955 237 1
? 956 238 1
? 956 529 1
? 956 709 1
? 956 821 1
? 956 890 1
? 956 933 1
? 956 959 1
? 956 916 1
? 956 943 1
? 95...

result:

ok ok, 219/3500 queries

Subtask #5:

score: 14
Accepted

Test #49:

score: 14
Accepted
time: 0ms
memory: 3120kb

input:

100 100 100 100000
19815
19815
19815
19815
19815
19815
19815

output:

? 5 37 36
? 6 37 36
? 4 37 36
? 5 38 36
? 5 36 36
? 5 37 37
? 5 37 35
! 5 37 36

result:

ok ok, 7/100000 queries

Test #50:

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

input:

100 100 100 100000
19915
19916
19951
19975
19988
19998
20002
20006
20008
20009
20010
20011
20034
20050
20059
20065
20069
20071
20072
20073
20072
20072
20074
20087
20096
20101
20105
20107
20108
20107
20107

output:

? 5 37 36
? 6 37 36
? 41 37 36
? 65 37 36
? 78 37 36
? 88 37 36
? 92 37 36
? 96 37 36
? 98 37 36
? 99 37 36
? 100 37 36
? 100 38 36
? 100 61 36
? 100 77 36
? 100 86 36
? 100 92 36
? 100 96 36
? 100 98 36
? 100 99 36
? 100 100 36
? 99 100 36
? 100 100 37
? 100 100 35
? 100 100 22
? 100 100 13
? 100 1...

result:

ok ok, 31/100000 queries

Test #51:

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

input:

100 100 100 100000
312370
312370
312370
312370
312370
312370
312370

output:

? 5 37 36
? 6 37 36
? 4 37 36
? 5 38 36
? 5 36 36
? 5 37 37
? 5 37 35
! 5 37 36

result:

ok ok, 7/100000 queries

Test #52:

score: 0
Accepted
time: 4ms
memory: 3220kb

input:

100 100 100 100000
1322609
1322610
1322609
1322609
1322610
1322610
1322610
73173542
73202342
1322609
1322609
73202742
73143142
73130342
73165142
73162742
73204342
73203542
73169942
73203942
1322610
73204742
73205142
1322610
73205542
73211542
73215942
73218342
73219942
73220742
1322607
73220342
73221...

output:

? 5 37 36
? 6 37 36
? 41 37 36
? 65 37 36
? 78 37 36
? 88 37 36
? 92 37 36
? 96 37 36
? 98 37 36
? 99 37 36
? 97 37 36
? 98 38 36
? 98 61 36
? 98 77 36
? 98 52 36
? 98 46 36
? 98 42 36
? 98 40 36
? 98 44 36
? 98 41 36
? 98 43 36
? 99 42 36
? 100 42 36
? 100 43 36
? 100 41 36
? 100 26 36
? 100 15 36
...

result:

ok ok, 179/100000 queries

Test #53:

score: 0
Accepted
time: 6ms
memory: 3208kb

input:

100 100 100 100000
1619933
1619934
1619933
1619933
1619934
1619934
1619934
94664757
94729584
1619933
1619933
94730484
94596371
94567590
94645857
94640457
94734087
94732286
94656656
94733186
1619934
94734988
94735888
1619934
94736789
94750301
94760210
94765616
94769219
94771021
1619931
94770120
94771...

output:

? 5 37 36
? 6 37 36
? 41 37 36
? 65 37 36
? 78 37 36
? 88 37 36
? 92 37 36
? 96 37 36
? 98 37 36
? 99 37 36
? 97 37 36
? 98 38 36
? 98 61 36
? 98 77 36
? 98 52 36
? 98 46 36
? 98 42 36
? 98 40 36
? 98 44 36
? 98 41 36
? 98 43 36
? 99 42 36
? 100 42 36
? 100 43 36
? 100 41 36
? 100 26 36
? 100 15 36
...

result:

ok ok, 179/100000 queries

Test #54:

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

input:

100 100 100 100000
400854976
400854977
400855012
400855012
400854999
400855022
400866107
400855017
400855023
400855019
400855022
400855020
400866106
400855020
400866108
400854996
400854981
400855006
400855012
400866116
400855018
400855014
400855017
400855015
400855017
400866117
400854997
400854984
4...

output:

? 5 37 36
? 6 37 36
? 41 37 36
? 65 37 36
? 78 37 36
? 55 37 36
? 50 37 36
? 46 37 36
? 52 37 36
? 48 37 36
? 51 37 36
? 49 37 36
? 50 38 36
? 50 36 36
? 50 37 37
? 50 37 61
? 50 37 76
? 50 37 51
? 50 37 45
? 50 37 41
? 50 37 39
? 50 37 43
? 50 37 40
? 50 37 42
? 51 37 41
? 49 37 41
? 31 37 41
? 18 ...

result:

ok ok, 2609/100000 queries

Subtask #6:

score: 23
Accepted

Test #55:

score: 23
Accepted
time: 0ms
memory: 3120kb

input:

500 500 500 150000
19815
19815
19815
19815
19815
19815
19815

output:

? 5 237 36
? 6 237 36
? 4 237 36
? 5 238 36
? 5 236 36
? 5 237 37
? 5 237 35
! 5 237 36

result:

ok ok, 7/150000 queries

Test #56:

score: 0
Accepted
time: 3ms
memory: 3116kb

input:

500 500 500 150000
21006
21005
21007
21008
21010
21009
21011
21111
21173
21212
21236
21251
21260
21265
21269
21271
21272
21273
21272
21272
21274
21287
21296
21301
21305
21307
21308
21307
21307

output:

? 5 237 36
? 6 237 36
? 4 237 36
? 3 237 36
? 1 237 36
? 2 237 36
? 1 238 36
? 1 338 36
? 1 400 36
? 1 439 36
? 1 463 36
? 1 478 36
? 1 487 36
? 1 492 36
? 1 496 36
? 1 498 36
? 1 499 36
? 1 500 36
? 2 500 36
? 1 500 37
? 1 500 35
? 1 500 22
? 1 500 13
? 1 500 8
? 1 500 4
? 1 500 2
? 1 500 1
? 2 500...

result:

ok ok, 29/150000 queries

Test #57:

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

input:

500 500 500 150000
312370
312370
312370
312370
312370
312370
312370

output:

? 5 237 36
? 6 237 36
? 4 237 36
? 5 238 36
? 5 236 36
? 5 237 37
? 5 237 35
! 5 237 36

result:

ok ok, 7/150000 queries

Test #58:

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

input:

500 500 500 150000
1494364
1494363
1494363
67600557
1494364
1494364
1494365
1494364
1494364
1494364
1494364
1494364
1494364
1494365
1494364
1494364
1494364
67202406
1494365
50261997
50262327
50262558
50262774
50262789
50262798
50262804
50262807
50262810
1494365
1494365
1494365
50262813
62077170
6194...

output:

? 366 321 355
? 367 321 355
? 365 321 355
? 366 322 355
? 366 389 355
? 366 433 355
? 366 458 355
? 366 475 355
? 366 449 355
? 366 465 355
? 366 455 355
? 366 461 355
? 366 457 355
? 366 460 355
? 366 459 355
? 367 460 355
? 365 460 355
? 366 460 356
? 366 460 411
? 366 460 445
? 366 460 467
? 366 ...

result:

ok ok, 460/150000 queries

Test #59:

score: 0
Accepted
time: 12ms
memory: 3208kb

input:

500 500 500 150000
1322609
1322608
1322608
40726126
1322609
1322609
1322610
1322609
1322609
1322609
1322609
1322609
1322609
1322610
1322609
1322609
1322609
40327975
1322610
23387566
23387896
23388127
23388343
23388358
23388367
23388373
23388376
23388379
1322610
1322610
1322610
23388382
35202739
3507...

output:

? 366 321 355
? 367 321 355
? 365 321 355
? 366 322 355
? 366 389 355
? 366 433 355
? 366 458 355
? 366 475 355
? 366 449 355
? 366 465 355
? 366 455 355
? 366 461 355
? 366 457 355
? 366 460 355
? 366 459 355
? 367 460 355
? 365 460 355
? 366 460 356
? 366 460 411
? 366 460 445
? 366 460 467
? 366 ...

result:

ok ok, 460/150000 queries

Test #60:

score: 0
Accepted
time: 6ms
memory: 3156kb

input:

500 500 500 150000
1619933
1619932
1619932
34045711
1619933
1619933
1619934
1619933
1619933
1619933
1619933
1619933
1619933
1619934
1619933
1619933
1619933
33539342
1619934
13251380
13251754
13252016
13252260
13252277
13252288
13252294
13252298
13252301
1619934
1619934
1619934
13252305
27152236
2699...

output:

? 366 321 355
? 367 321 355
? 365 321 355
? 366 322 355
? 366 389 355
? 366 433 355
? 366 458 355
? 366 475 355
? 366 449 355
? 366 465 355
? 366 455 355
? 366 461 355
? 366 457 355
? 366 460 355
? 366 459 355
? 367 460 355
? 365 460 355
? 366 460 356
? 366 460 411
? 366 460 445
? 366 460 467
? 366 ...

result:

ok ok, 460/150000 queries

Test #61:

score: 0
Accepted
time: 6ms
memory: 3272kb

input:

500 500 500 150000
1312371
1312370
1312370
1312372
1312371
1312371
1312372
1312371
1312371
1312371
1312371
1312371
1312371
1312372
1312371
1312371
1312371
21169099
1312372
21057226
1312372
21057251
21057267
1312372
1312372
21100589
1312372
1312372
1312372
21100590
6933977
1312372
6896199
1312372
131...

output:

? 366 321 355
? 367 321 355
? 365 321 355
? 366 322 355
? 366 389 355
? 366 433 355
? 366 458 355
? 366 475 355
? 366 449 355
? 366 465 355
? 366 455 355
? 366 461 355
? 366 457 355
? 366 460 355
? 366 459 355
? 367 460 355
? 365 460 355
? 366 460 356
? 366 460 411
? 366 460 445
? 366 460 467
? 366 ...

result:

ok ok, 393/150000 queries

Test #62:

score: 0
Accepted
time: 94ms
memory: 5532kb

input:

500 500 500 150000
400585604
400585603
400585605
400585744
400585831
400585885
400585918
400585938
400585951
400585953
400585948
400585956
400585954
400585955
400585955
400585955
400585957
400586079
400586155
400586202
400586219
400586201
400586220
400586213
400586224
400586223
400586222
400586225
4...

output:

? 366 321 355
? 367 321 355
? 365 321 355
? 226 321 355
? 139 321 355
? 85 321 355
? 52 321 355
? 32 321 355
? 19 321 355
? 11 321 355
? 6 321 355
? 14 321 355
? 16 321 355
? 13 321 355
? 15 321 355
? 14 322 355
? 14 320 355
? 14 198 355
? 14 122 355
? 14 75 355
? 14 46 355
? 14 28 355
? 14 57 355
?...

result:

ok ok, 37309/150000 queries

Test #63:

score: 0
Accepted
time: 114ms
memory: 5024kb

input:

500 500 500 150000
399942367
399942366
399942368
399942501
399942585
399942636
399942668
399942678
399942666
399942680
399942675
399942683
399942681
399942682
399942682
399942684
399942844
399942943
399942883
399942905
399942921
399942928
399942936
399942937
399942941
399942941
399942943
399942942
3...

output:

? 351 80 311
? 352 80 311
? 350 80 311
? 217 80 311
? 133 80 311
? 82 80 311
? 50 80 311
? 30 80 311
? 18 80 311
? 38 80 311
? 43 80 311
? 35 80 311
? 33 80 311
? 36 80 311
? 34 80 311
? 35 81 311
? 35 241 311
? 35 340 311
? 35 402 311
? 35 302 311
? 35 364 311
? 35 325 311
? 35 349 311
? 35 334 311...

result:

ok ok, 30330/150000 queries

Test #64:

score: 0
Accepted
time: 139ms
memory: 6024kb

input:

500 500 500 150000
399768859
399768858
399768860
399768966
399769034
400267122
399769098
399769059
399769085
399769069
399769079
399769073
399769077
400267121
399769076
399769075
399769073
399769075
400267123
399769023
399768992
399769043
399769055
399769062
399769067
400267126
400267124
399769069
4...

output:

? 281 415 132
? 282 415 132
? 280 415 132
? 174 415 132
? 106 415 132
? 66 415 132
? 40 415 132
? 81 415 132
? 55 415 132
? 71 415 132
? 61 415 132
? 67 415 132
? 63 415 132
? 65 415 132
? 64 415 132
? 66 416 132
? 66 414 132
? 66 415 133
? 66 415 131
? 66 415 81
? 66 415 50
? 66 415 101
? 66 415 11...

result:

ok ok, 46318/150000 queries

Test #65:

score: 0
Accepted
time: 115ms
memory: 5632kb

input:

500 500 500 150000
400007850
400007851
400007898
400007791
400007956
400007915
400007939
400007940
400007954
400007950
400007960
400527814
400007956
400527813
400527815
400527816
400008108
400008203
400008051
400008014
400007993
400007979
400007970
400007965
400527800
400007960
400527817
400527818
4...

output:

? 50 104 80
? 51 104 80
? 222 104 80
? 329 104 80
? 156 104 80
? 115 104 80
? 181 104 80
? 140 104 80
? 166 104 80
? 150 104 80
? 160 104 80
? 162 104 80
? 164 104 80
? 161 104 80
? 163 104 80
? 163 105 80
? 163 255 80
? 163 350 80
? 163 198 80
? 163 161 80
? 163 140 80
? 163 126 80
? 163 117 80
? 1...

result:

ok ok, 38956/150000 queries