QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#882685#9734. Identify ChordrbtreeWA 71ms3584kbC++265.7kb2025-02-05 10:42:232025-02-05 10:42:26

Judging History

This is the latest submission verdict.

  • [2025-02-05 10:42:26]
  • Judged
  • Verdict: WA
  • Time: 71ms
  • Memory: 3584kb
  • [2025-02-05 10:42:23]
  • Submitted

answer

#include "bits/stdc++.h"
constexpr int __FREAD__ = 0;
constexpr char __FIN__[] = "";
constexpr char __FOUT__[] = "";
constexpr bool MTS = true;
constexpr bool SPC_MTS = false;
#define _LOAD_4(a, b, c, d, ...) d
#define _ALL_0(arg) begin(arg), end(arg)
#define _ALL_1(arg, l) (begin(arg) + (l)), end(arg)
#define _ALL_2(arg, l, r) (begin(arg) + (l)), (begin(arg) + (r) + 1)
#define ALL(...) _LOAD_4(__VA_ARGS__, _ALL_2, _ALL_1, _ALL_0)(__VA_ARGS__)

// :/

using namespace std;
using tp = long long int;
[[maybe_unused]] constexpr tp ZERO = 0, ONE = 1, INF = -1ull >> 2;
int WITHERING(int);
void MIST(int, char*[]);

template <typename _Ty> class _Lambda_t { _Ty lexp;public:template<typename __Ty
>_Lambda_t(__Ty&&lexp):lexp(static_cast<__Ty&&>(lexp)){}template<typename...__Ty
>decltype(auto)operator()(__Ty&&...args){return lexp(std::ref(*this),static_cast
<__Ty&&>(args)...); } }; template <typename _Ty> decltype (auto) lexp(_Ty&&l_exp
) {return _Lambda_t<typename std::decay<_Ty>::type>(static_cast<_Ty&&>(l_exp));}
struct SPLITMIX { static uint64_t splitmix(uint64_t x){x+=0x9e3779b97f4a7c15;x=(
x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; x = (x ^ (x>>27))*0x94d049bb133111eb;return
x ^ (x >> 31); } size_t operator()(uint64_t x) const { static const uint64_t o =
chrono::steady_clock::now().time_since_epoch().count(); return splitmix(x+o);}};
template <typename _Ty> auto vcc(_Ty init, size_t s) { return std::vector<_Ty>(s
, init); } template <typename _Ty, typename... __Ty> auto vcc(_Ty init, size_t s
, __Ty... o) {auto ret=vcc(init,o...);return std::vector<decltype(ret)>(s,ret);}
template <typename _Ty1, typename _Ty2> bool ckmax(_Ty1& a, const _Ty2& b) { if(
a < b) { a = b; return true; } return false; } template <typename _Ty1, typename
_Ty2> bool ckmin(_Ty1& a, const _Ty2& b){if(b<a){a=b;return true;}return false;}
void RAW(char&x){if(__FREAD__!=0){static char buf[__FREAD__];static char*s=buf,*
e=buf;if(s==e){s=buf;e=buf+fread(buf,1,__FREAD__,stdin);if(s==e){x=EOF;return;}}
x = *s++; } else x = getchar(); } void bin(char& c){for(RAW(c);c==' '||c == '\n'
|| c == '\r'; RAW(c)); } void bin(std::string& x) { char c; for(RAW(c);c==' '||c
== '\n' || c == '\r'; RAW(c)); x = c; for (RAW(c); c!=' '&&c!='\n'&&c!='\r';RAW(
c)) x.push_back(c); } template <typename Ty> void bin(Ty& x) { bool sign = false
;char c; for (RAW(c); c < '0' || c > '9'; RAW(c)) if (c == '-') sign = true; for
(x = 0; '0' <= c && c <= '9'; RAW(c)) x = x * 10 + (c & 15); if (sign) x = -x; }
template <typename...> using bin_void_t =void;template<typename T,typename=void>
struct bin_it :std::false_type{};template<typename T>struct bin_it<T,bin_void_t<
typename std::iterator_traits<T>::iterator_category>>:std::true_type{};template<
typename T>struct bin_it<T*,void>:std::true_type{};template<typename T,typename=
typename std::enable_if<bin_it<T>::value>::type>void bin(T s,T e){while(s!=e)bin
(*s++);}template<typename...>struct bin_or:std::false_type{};template<typename T
, typename... O> struct bin_or<T,O...>:std::conditional<T::value,std::true_type,
bin_or<O...>>::type {}; template <typename... T>typename std::enable_if<!bin_or<
bin_it<typename std::decay<T>::type>...>::value, void>::type bin(T& ...x) {void(
(int[]) { 0, (bin(&x, &x + 1), 0) ... }); } tp bin() { tp x; cin>>x; return x; }
int main(int argc, char* argv[]) { int t = 0, _t = 1; if(MTS&&!SPC_MTS) bin(_t);
MIST(argc, argv); while(t<_t||SPC_MTS){if(WITHERING(++t)!=0)return 0;}return 0;}
#ifdef XCODE
#define bg(...){cout<<"["<<__LINE__<<'@'<<++_LT[__LINE__]<<':';BG(__VA_ARGS__);}
size_t _LT[21777]; template<typename _Type>void BG(const _Type&_cur){cout<<' '<<
_cur << ']' <<" <<:"<<std::endl;}template<typename _Type,typename... _Other>void
BG(const _Type& _cur, const _Other& ..._other) {cout<< ' '<<_cur;BG(_other...);}
#else
#define bg(...)
#endif

// :/

namespace lib {  // LIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIBLIB
class Random{mt19937_64 rd;public:Random(unsigned long long seed) {rd=mt19937_64
(seed); } long long operator()(long long l, long long r) { return l + rd() % (r-
l + 1); } } rng(reinterpret_cast<unsigned long long>(new char) * time(nullptr));
}  // LIB::RANDOM LIB::RANDOM LIB::RANDOM LIB::RANDOM LIB::RANDOM LIB::RANDOM LI

// :/

struct STRUGGLE {
   STRUGGLE() {
      if (strlen(__FIN__)) freopen(__FIN__, "r", stdin);
      if (strlen(__FOUT__)) freopen(__FOUT__, "w", stdout);
   }
   
   ~STRUGGLE() {
   }
} STRUGGLE;

int WITHERING([[maybe_unused]] int TEST_NUMBER) {
   int n; cin >> n;
   map<pair<int, int>, int> mem;
   auto ask = [&](int x, int y) {
      if ((x + 1) % n == y || (y + 1) % n == x) return 1;
      if (mem.count(minmax(x, y))) return mem[minmax(x, y)];
      cout << "? " << x + 1 << ' ' << y + 1 << endl;
      int t;
      cin >> t;
      return mem[minmax(x, y)] = t;
   };
   int x, y;
   int d;
   while (true) {
      x = lib::rng(0, n - 1);
      y = (x + n / 2) % n;
      d = ask(x, y);
      if (d != n / 2) break;
   }
   if (ask(x, (y + n - 1) % n) == d - 1) {
      int l = 1, r = n / 2;
      while (l <= r) {
         int mid = (l + r) >> 1;
         if (ask(x, (y + n - mid) % n) == d - mid) l = mid + 1;
         else r = mid - 1;
      }
      y = (y + n - r) % n;
   } else {
      int l = 1, r = n / 2;
      while (l <= r) {
         int mid = (l + r) >> 1;
         if (ask(x, (y + mid) % n) == d - mid) l = mid + 1;
         else r = mid - 1;
      }
      y = (y + r) % n;
   }
   d = ask(x, y);
   if (ask((x + d - 1) % n, y) == 1) x = (x + d - 1) % n;
   else x = (x + n - d + 1) % n;
   cout << "! " << x + 1 << ' ' << y + 1 << endl;
   cin >> x;
   return 0;
}

void MIST([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) {
}

// :\ */

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3456kb

input:

2
6
2
2
1
1
4
2
1
1

output:

? 4 1
? 4 6
? 4 2
! 4 2
? 2 4
? 3 1
! 3 1

result:

ok ok (2 test cases)

Test #2:

score: 0
Accepted
time: 22ms
memory: 3456kb

input:

1000
15
5
4
3
3
2
1
1
19
2
3
5
4
3
3
1
17
3
4
5
3
2
1
1
15
7
6
5
3
4
4
1
1
14
5
4
1
2
1
15
7
7
5
4
3
3
4
3
1
17
3
4
5
3
2
1
1
20
6
7
5
4
3
4
5
1
13
4
5
4
3
4
1
1
18
3
4
4
3
2
3
1
13
5
5
4
4
5
1
1
14
6
5
3
4
3
2
1
17
5
6
5
7
6
4
1
12
5
5
3
4
3
1
1
10
3
4
2
2
1
1
14
6
5
2
2
1
1
19
8
8
3
3
2
3
1
19
4
5...

output:

? 4 11
? 4 10
? 4 7
? 4 9
? 4 8
? 5 8
! 5 8
? 13 3
? 13 2
? 13 8
? 13 5
? 13 4
? 14 3
! 12 3
? 2 10
? 2 9
? 2 14
? 2 12
? 2 11
? 3 11
! 3 11
? 9 1
? 13 5
? 13 4
? 13 1
? 13 3
? 13 2
? 1 3
! 1 3
? 2 9
? 2 8
? 2 5
? 2 4
! 2 5
? 13 5
? 6 13
? 4 11
? 4 10
? 4 7
? 4 9
? 4 8
? 6 9
! 2 9
? 13 4
? 13 3
? 13...

result:

ok ok (1000 test cases)

Test #3:

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

input:

1000
21
10
7
6
5
5
4
5
4
1
22
8
9
5
7
7
6
1
1
20
5
4
5
5
1
1
22
6
7
5
7
5
6
1
1
21
6
7
1
3
2
1
21
7
6
2
2
3
1
1
24
7
8
6
8
6
7
1
1
22
10
9
5
7
6
5
1
1
21
5
4
5
3
4
5
1
23
9
8
3
2
2
3
3
1
21
8
9
6
6
7
1
1
24
11
10
6
9
9
2
1
20
9
9
5
8
9
1
1
24
11
11
5
3
5
9
1
23
10
9
4
2
3
2
2
1
23
3
4
6
4
2
3
3
1
23...

output:

? 6 16
? 3 13
? 3 12
? 3 8
? 3 11
? 3 10
? 3 9
? 6 10
! 21 10
? 12 1
? 12 22
? 12 7
? 12 4
? 12 2
? 12 3
? 17 3
! 17 3
? 2 12
? 2 11
? 2 7
? 2 10
? 5 11
! 5 11
? 3 14
? 3 13
? 3 20
? 3 17
? 3 15
? 3 16
? 7 15
! 7 15
? 13 2
? 13 1
? 13 7
? 13 10
? 13 8
! 13 7
? 14 3
? 14 2
? 14 19
? 14 16
? 14 18
? 1...

result:

ok ok (1000 test cases)

Test #4:

score: 0
Accepted
time: 11ms
memory: 3584kb

input:

1000
25
8
7
6
9
8
1
1
25
4
3
4
1
2
1
25
6
7
6
3
4
5
1
25
5
6
7
8
6
1
1
26
12
11
6
9
7
7
1
1
26
9
10
2
3
3
1
1
26
11
12
4
1
2
1
27
13
13
12
11
5
2
2
1
1
25
8
7
6
5
4
5
1
1
27
9
8
6
10
9
1
1
27
11
12
7
10
10
9
7
1
27
9
10
7
6
6
5
1
1
26
13
7
6
4
4
2
3
3
1
25
10
11
7
10
11
3
1
27
6
5
6
7
6
1
1
25
9
10
...

output:

? 20 7
? 20 6
? 20 1
? 20 4
? 20 5
? 1 6
! 1 6
? 25 12
? 25 11
? 25 6
? 25 9
? 25 8
! 25 9
? 8 20
? 8 19
? 8 1
? 8 23
? 8 24
? 10 23
! 6 23
? 24 11
? 24 10
? 24 17
? 24 14
? 24 12
? 3 11
! 3 11
? 12 25
? 12 24
? 12 18
? 12 22
? 12 20
? 12 19
? 18 20
! 18 20
? 5 18
? 5 17
? 5 25
? 5 2
? 5 26
? 6 25
!...

result:

ok ok (1000 test cases)

Test #5:

score: 0
Accepted
time: 20ms
memory: 3584kb

input:

1000
29
8
9
3
5
3
2
1
1
28
13
13
6
3
5
6
1
1
30
13
14
7
9
7
8
1
1
29
12
13
8
9
9
8
1
1
28
14
10
11
3
3
5
4
1
1
29
2
3
7
3
1
2
1
29
12
13
8
11
11
10
1
1
28
11
12
7
8
8
7
12
1
30
4
5
7
8
6
5
1
1
30
12
11
4
3
5
5
4
1
28
9
8
7
10
9
1
1
29
14
14
13
12
7
10
8
8
1
1
29
14
11
10
7
8
6
7
1
1
29
8
7
3
5
3
2
3...

output:

? 2 16
? 2 15
? 2 23
? 2 19
? 2 21
? 2 22
? 3 22
! 3 22
? 3 17
? 3 16
? 3 24
? 3 28
? 3 26
? 3 25
? 8 24
! 8 24
? 11 26
? 11 25
? 11 4
? 11 30
? 11 2
? 11 3
? 17 2
! 17 2
? 24 9
? 24 8
? 24 16
? 24 12
? 24 14
? 24 13
? 2 13
! 2 13
? 5 19
? 21 7
? 21 6
? 21 14
? 21 18
? 21 16
? 21 15
? 23 14
! 23 14
...

result:

ok ok (1000 test cases)

Test #6:

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

input:

1000
32
13
12
5
4
5
4
1
1
30
14
13
7
11
12
12
1
1
32
16
12
11
8
8
8
7
5
1
31
6
7
6
2
4
3
3
1
32
11
10
7
7
5
6
6
1
32
16
12
11
4
4
6
5
5
1
31
10
11
8
10
8
9
10
1
31
8
7
7
10
8
8
1
32
12
13
4
4
4
3
5
1
30
14
14
7
11
13
13
4
1
31
12
13
4
4
6
5
1
1
31
9
8
7
7
7
6
1
1
33
8
9
2
4
2
1
1
32
3
2
8
5
3
3
1
32...

output:

? 2 18
? 2 17
? 2 10
? 2 6
? 2 8
? 2 9
? 5 9
! 5 9
? 15 30
? 15 29
? 15 22
? 15 26
? 15 28
? 15 27
? 26 28
! 26 28
? 17 1
? 15 31
? 15 30
? 15 23
? 15 27
? 15 25
? 15 26
? 21 26
! 9 26
? 16 31
? 16 30
? 16 8
? 16 4
? 16 6
? 16 5
? 17 4
! 15 4
? 25 9
? 25 8
? 25 1
? 25 5
? 25 3
? 25 2
? 29 3
! 21 3
?...

result:

ok ok (1000 test cases)

Test #7:

score: 0
Accepted
time: 18ms
memory: 3584kb

input:

1000
34
10
9
8
8
8
7
1
1
33
9
10
9
9
7
8
12
1
33
13
14
5
3
3
2
1
1
34
7
8
6
3
3
2
1
1
34
15
14
6
4
4
5
3
1
35
15
16
6
5
7
7
11
1
34
16
15
8
12
10
10
2
1
34
6
7
8
8
6
5
9
1
34
16
15
7
4
5
5
1
1
33
12
11
4
4
4
3
5
1
33
16
15
15
9
13
15
16
1
1
34
16
16
8
13
15
16
2
1
33
8
7
8
4
6
5
1
1
34
12
13
8
10
10...

output:

? 25 8
? 25 7
? 25 33
? 25 4
? 25 6
? 25 5
? 31 5
! 31 5
? 21 4
? 21 3
? 21 12
? 21 8
? 21 6
? 21 7
? 27 6
! 15 6
? 30 13
? 30 12
? 30 21
? 30 25
? 30 23
? 30 24
? 31 24
! 31 24
? 10 27
? 10 26
? 10 2
? 10 31
? 10 33
? 10 32
? 11 32
! 11 32
? 30 13
? 30 12
? 30 4
? 30 34
? 30 2
? 30 1
? 33 2
! 27 2
...

result:

ok ok (1000 test cases)

Test #8:

score: 0
Accepted
time: 16ms
memory: 3456kb

input:

1000
36
17
17
8
4
6
5
5
9
1
36
3
4
9
5
3
2
3
1
36
15
14
6
3
4
3
2
3
1
36
17
17
9
13
11
11
1
1
36
9
10
9
13
11
10
1
1
36
10
9
3
6
4
3
2
3
1
35
17
13
14
4
5
4
3
5
1
36
18
15
16
6
4
4
5
1
1
36
8
7
7
4
4
3
5
1
36
16
17
9
14
16
17
3
1
36
18
9
8
9
5
7
6
9
1
36
10
9
9
6
6
5
9
1
36
17
17
8
3
1
1
36
9
10
4
5...

output:

? 24 6
? 24 5
? 24 15
? 24 20
? 24 17
? 24 18
? 24 19
? 28 18
! 20 18
? 36 18
? 36 17
? 36 27
? 36 22
? 36 20
? 36 19
? 1 19
! 35 19
? 5 23
? 5 22
? 5 14
? 5 9
? 5 12
? 5 11
? 5 10
? 6 10
! 4 10
? 29 11
? 29 10
? 29 20
? 29 15
? 29 17
? 29 18
? 3 17
! 3 17
? 24 6
? 24 5
? 24 15
? 24 10
? 24 8
? 24 7...

result:

ok ok (1000 test cases)

Test #9:

score: 0
Accepted
time: 18ms
memory: 3456kb

input:

1000
37
18
8
7
5
4
2
3
3
1
36
17
17
8
4
6
5
4
7
1
38
13
12
9
14
11
12
7
1
37
11
10
9
9
9
8
1
1
37
11
10
6
7
5
4
5
1
1
36
10
11
3
6
4
3
2
1
1
37
5
4
9
5
3
4
1
1
37
18
8
7
9
4
6
5
7
1
37
17
17
8
5
6
7
11
1
37
4
3
9
6
4
1
1
37
10
11
1
5
3
2
1
37
18
18
17
16
9
13
11
11
1
1
36
18
3
4
9
7
5
4
5
1
37
15
16...

output:

? 21 2
? 15 33
? 15 32
? 15 24
? 15 29
? 15 27
? 15 26
? 16 27
! 14 27
? 31 13
? 31 12
? 31 22
? 31 27
? 31 24
? 31 25
? 31 26
? 34 26
! 28 26
? 28 9
? 28 8
? 28 37
? 28 4
? 28 7
? 28 6
? 38 7
! 18 7
? 6 24
? 6 23
? 6 15
? 6 20
? 6 22
? 6 21
? 13 21
! 13 21
? 16 34
? 16 33
? 16 25
? 16 30
? 16 28
? ...

result:

ok ok (1000 test cases)

Test #10:

score: 0
Accepted
time: 18ms
memory: 3584kb

input:

1000
39
13
12
9
14
11
12
7
1
38
10
11
9
13
10
9
1
1
38
19
9
10
9
14
11
10
11
1
39
12
11
2
4
2
1
1
38
19
15
14
9
14
13
14
1
1
39
6
5
9
9
6
9
1
39
18
18
10
15
16
17
1
1
38
18
17
9
13
12
13
1
1
39
19
13
12
9
8
10
9
1
1
39
12
13
2
5
2
1
1
39
19
10
11
10
9
8
7
8
1
1
38
18
18
9
14
16
15
14
10
1
39
11
12
1...

output:

? 35 15
? 35 14
? 35 5
? 35 10
? 35 13
? 35 12
? 6 13
! 25 13
? 13 32
? 13 31
? 13 4
? 13 37
? 13 34
? 13 33
? 21 33
! 21 33
? 20 1
? 34 15
? 34 14
? 34 25
? 34 20
? 34 17
? 34 16
? 4 15
! 26 15
? 2 21
? 2 20
? 2 11
? 2 6
? 2 9
? 2 10
! 2 10
? 5 24
? 9 28
? 9 27
? 9 18
? 9 23
? 9 26
? 9 25
? 21 26
!...

result:

ok ok (1000 test cases)

Test #11:

score: 0
Accepted
time: 20ms
memory: 3584kb

input:

1000
40
10
9
10
7
8
7
6
11
1
40
14
15
6
9
7
6
5
1
1
40
11
10
5
6
4
3
4
1
1
40
10
11
10
13
10
9
1
1
40
16
17
6
5
6
5
9
1
40
3
4
9
4
1
2
1
41
20
14
15
11
16
14
13
9
1
40
9
10
5
4
2
3
1
1
40
18
19
8
5
8
7
13
1
40
6
5
10
9
6
1
1
40
6
5
10
9
6
9
1
41
9
10
11
10
7
8
1
1
40
19
18
10
14
12
11
11
2
1
40
18
1...

output:

? 31 11
? 31 10
? 31 1
? 31 6
? 31 9
? 31 8
? 31 7
? 36 7
! 26 7
? 23 3
? 23 2
? 23 13
? 23 8
? 23 10
? 23 11
? 23 12
? 27 12
! 27 12
? 31 11
? 31 10
? 31 1
? 31 6
? 31 4
? 31 3
? 31 2
? 33 3
! 33 3
? 33 13
? 33 12
? 33 23
? 33 18
? 33 15
? 33 14
? 1 14
! 1 14
? 32 12
? 32 11
? 32 22
? 32 27
? 32 24...

result:

ok ok (1000 test cases)

Test #12:

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

input:

1000
42
13
14
2
5
4
3
1
1
41
17
18
11
16
15
16
8
1
41
10
11
11
9
8
7
8
1
1
41
11
10
10
6
8
7
10
1
41
20
14
15
11
13
12
11
12
1
1
41
14
13
4
5
6
5
7
1
41
16
15
10
15
16
5
1
41
4
3
10
7
4
5
1
41
17
18
11
14
15
14
13
1
1
41
15
16
11
16
17
16
6
1
41
1
2
11
6
3
2
1
42
20
20
10
15
13
14
13
16
1
41
15
14
5...

output:

? 16 37
? 16 36
? 16 6
? 16 11
? 16 8
? 16 7
? 17 6
! 17 6
? 11 31
? 11 30
? 11 41
? 11 36
? 11 33
? 11 34
? 25 33
! 38 33
? 34 13
? 34 12
? 34 23
? 34 18
? 34 15
? 34 16
? 34 17
? 40 16
! 40 16
? 21 41
? 21 40
? 21 31
? 21 36
? 21 34
? 21 35
? 26 36
! 16 36
? 16 36
? 41 20
? 41 19
? 41 30
? 41 25
?...

result:

ok ok (1000 test cases)

Test #13:

score: 0
Accepted
time: 17ms
memory: 3584kb

input:

1000
43
17
18
8
12
9
8
7
1
1
42
18
17
10
15
16
15
14
1
1
43
21
16
17
11
11
14
12
1
1
43
6
7
11
5
4
3
4
1
1
43
16
17
11
17
16
15
1
1
43
7
6
10
4
5
4
3
1
1
43
19
20
8
5
6
5
4
7
1
43
21
20
19
10
16
18
17
16
1
1
42
13
14
4
8
5
4
3
5
1
42
20
20
10
16
19
20
2
1
42
13
14
10
8
9
7
8
1
1
43
20
20
9
6
9
8
1
1...

output:

? 15 36
? 15 35
? 15 4
? 15 41
? 15 1
? 15 2
? 15 3
? 21 3
! 21 3
? 3 24
? 3 23
? 3 13
? 3 19
? 3 22
? 3 21
? 3 20
? 16 20
! 16 20
? 35 13
? 38 16
? 38 15
? 38 27
? 38 21
? 38 24
? 38 22
? 5 21
! 5 21
? 33 11
? 33 10
? 33 22
? 33 16
? 33 13
? 33 14
? 33 15
? 35 14
! 35 14
? 26 4
? 26 3
? 26 15
? 26 ...

result:

ok ok (1000 test cases)

Test #14:

score: 0
Accepted
time: 20ms
memory: 3584kb

input:

1000
44
14
15
11
13
12
11
12
15
1
44
13
12
10
8
7
7
6
10
1
43
17
16
10
16
15
14
15
5
1
43
13
14
11
14
11
12
13
1
44
17
16
6
5
8
7
1
1
44
16
15
5
5
8
6
1
1
44
13
12
11
10
11
10
9
1
1
44
18
19
11
13
14
12
13
1
1
43
17
16
10
14
15
14
13
5
1
43
6
7
9
3
4
3
2
1
1
44
13
12
4
8
5
4
3
5
1
44
20
21
11
17
18
...

output:

? 16 38
? 16 37
? 16 5
? 16 43
? 16 40
? 16 41
? 16 42
? 26 41
! 6 41
? 34 12
? 34 11
? 34 1
? 34 7
? 34 4
? 34 6
? 34 5
? 39 5
! 29 5
? 6 27
? 6 26
? 6 16
? 6 22
? 6 25
? 6 24
? 6 23
? 19 24
! 36 24
? 38 16
? 38 15
? 38 27
? 38 21
? 38 18
? 38 19
? 5 18
! 28 18
? 35 13
? 35 12
? 35 2
? 35 40
? 35 4...

result:

ok ok (1000 test cases)

Test #15:

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

input:

1000
45
19
20
12
16
17
16
15
12
1
45
16
15
5
5
8
6
7
1
45
10
9
5
5
2
3
1
1
45
15
16
8
10
7
6
7
1
1
45
12
13
3
7
4
3
2
3
1
45
12
13
11
7
8
6
7
1
1
45
19
20
8
6
5
4
5
7
1
45
22
3
4
10
4
1
2
1
44
19
20
11
17
20
20
4
1
45
11
10
2
6
3
2
1
1
44
20
21
11
15
14
14
15
15
1
45
15
14
11
17
15
1
1
44
16
15
5
5
...

output:

? 19 41
? 19 40
? 19 7
? 19 1
? 19 43
? 19 44
? 19 45
? 33 45
! 5 45
? 1 23
? 1 22
? 1 12
? 1 6
? 1 9
? 1 11
? 5 12
! 42 12
? 4 26
? 4 25
? 4 15
? 4 21
? 4 18
? 4 17
? 5 18
! 5 18
? 1 23
? 1 22
? 1 34
? 1 28
? 1 31
? 1 32
? 1 33
? 6 32
! 6 32
? 15 37
? 15 36
? 15 3
? 15 42
? 15 45
? 15 1
? 15 2
? 16...

result:

ok ok (1000 test cases)

Test #16:

score: 0
Accepted
time: 15ms
memory: 3584kb

input:

1000
46
8
9
10
4
5
4
3
1
1
46
3
4
11
5
2
2
1
1
46
10
11
11
16
13
11
1
1
46
19
18
11
17
20
19
1
1
46
23
9
8
11
11
8
7
13
1
46
13
14
7
7
4
5
1
1
46
12
13
11
12
9
10
1
1
46
8
9
11
10
7
7
6
11
1
46
22
22
11
17
20
22
1
1
46
7
6
11
9
6
5
9
1
45
18
17
11
17
16
17
1
1
46
10
9
8
4
5
3
4
5
1
46
18
19
11
17
15...

output:

? 29 6
? 29 5
? 29 18
? 29 12
? 29 9
? 29 10
? 29 11
? 31 11
! 31 11
? 4 27
? 4 26
? 4 39
? 4 33
? 4 30
? 4 28
? 4 29
! 4 29
? 30 7
? 30 6
? 30 19
? 30 13
? 30 10
? 30 8
? 39 7
! 39 7
? 35 12
? 35 11
? 35 46
? 35 6
? 35 9
? 35 10
? 6 11
! 6 11
? 33 10
? 26 3
? 26 2
? 26 37
? 26 43
? 26 46
? 26 1
? 3...

result:

ok ok (1000 test cases)

Test #17:

score: 0
Accepted
time: 68ms
memory: 3584kb

input:

1000
1000000000
499999999
499999999
249999999
125000000
187499999
156250000
171875000
179687499
175781250
177734374
176757813
177246093
177001954
177124023
177062989
177093506
177078248
177085877
177082062
177080155
177079202
177079679
177079917
177079799
177079858
177079828
177079814
177079821
1770...

output:

? 49127198 549127198
? 49127198 549127197
? 49127198 799127198
? 49127198 924127198
? 49127198 861627198
? 49127198 892877198
? 49127198 877252198
? 49127198 869439698
? 49127198 873345948
? 49127198 871392823
? 49127198 872369385
? 49127198 871881104
? 49127198 872125244
? 49127198 872003174
? 4912...

result:

ok ok (1000 test cases)

Test #18:

score: 0
Accepted
time: 50ms
memory: 3584kb

input:

1000
1000000000
499999969
499999970
250000000
375000000
437499969
406250000
421874969
414062469
410156219
408203094
407226532
406738282
406982423
407104462
407043458
407073945
407058686
407051088
407054872
407052965
407052042
407052519
407052727
407052634
407052668
407052638
407052623
407052626
4070...

output:

? 810303525 310303525
? 810303525 310303524
? 810303525 560303525
? 810303525 435303525
? 810303525 372803525
? 810303525 404053525
? 810303525 388428525
? 810303525 396241025
? 810303525 400147275
? 810303525 402100400
? 810303525 403076962
? 810303525 403565243
? 810303525 403321102
? 810303525 40...

result:

ok ok (1000 test cases)

Test #19:

score: 0
Accepted
time: 67ms
memory: 3584kb

input:

1000
1000000000
417100923
417100922
250000000
292100923
229600923
218750001
213975923
210937501
210069673
208984376
209093111
208604830
208740235
208618164
208557129
208574313
208559054
208551425
208553314
208551406
208550472
208550929
208550690
208550571
208550511
208550481
208550466
208550465
2085...

output:

? 945624557 445624557
? 945624557 445624556
? 945624557 195624557
? 945624557 320624557
? 945624557 258124557
? 945624557 226874557
? 945624557 242499557
? 945624557 234687057
? 945624557 238593307
? 945624557 236640182
? 945624557 237616745
? 945624557 237128464
? 945624557 236884323
? 945624557 23...

result:

ok ok (1000 test cases)

Test #20:

score: 0
Accepted
time: 71ms
memory: 3584kb

input:

1000
1000000000
110711076
110711077
249999930
124999930
62499930
79461076
63836076
56023576
58593680
56640555
55663992
55535295
55419851
55413225
55358816
55382708
55367449
55359820
55356005
55356908
55355954
55355529
55355715
55355596
55355536
55355506
55355515
55355508
55355504
55355504
55355503
1...

output:

? 829401773 329401773
? 829401773 329401772
? 829401773 579401773
? 829401773 454401773
? 829401773 391901773
? 829401773 360651773
? 829401773 376276773
? 829401773 384089273
? 829401773 387995523
? 829401773 386042398
? 829401773 385065835
? 829401773 384577554
? 829401773 384821694
? 829401773 38...

result:

ok ok (1000 test cases)

Test #21:

score: 0
Accepted
time: 68ms
memory: 3584kb

input:

1000
1000000000
444211053
444211052
194211053
86909097
131711053
100461053
84836053
79096597
80929803
78976678
78120034
78488397
78244257
78122187
78061152
78089516
78074257
78066627
78062812
78060905
78060199
78060428
78060189
78060080
78060129
78060099
78060084
78060077
78060077
78060075
78060076
...

output:

? 824278929 324278929
? 824278929 324278928
? 824278929 74278929
? 824278929 949278929
? 824278929 11778929
? 824278929 980528929
? 824278929 964903929
? 824278929 957091429
? 824278929 960997679
? 824278929 959044554
? 824278929 958067992
? 824278929 958556273
? 824278929 958312133
? 824278929 9581...

result:

ok ok (1000 test cases)

Test #22:

score: -100
Wrong Answer
time: 4ms
memory: 3584kb

input:

1000
999999999
499999998
499999997
249999998
124999999
187499998
156249999
171874998
164062499
167968748
166015624
166992186
166503906
166748046
166625977
166687011
166656494
166641235
166633607
166637421
166635514
166634560
166634084
166634323
166634441
166634383
166634413
166634427
166634421
16663...

output:

? 51984120 551984119
? 51984120 551984118
? 51984120 301984119
? 51984120 176984119
? 51984120 239484119
? 51984120 208234119
? 51984120 223859119
? 51984120 216046619
? 51984120 219952869
? 51984120 217999744
? 51984120 218976307
? 51984120 218488026
? 51984120 218732167
? 51984120 218610097
? 5198...

result:

wrong answer Too many queries: 41 (test case 51)