QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#110943#6558. Allergen Testingrin204AC ✓8ms3520kbC++178.1kb2023-06-04 22:57:342023-06-04 22:57:36

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-04 22:57:36]
  • 评测
  • 测评结果:AC
  • 用时:8ms
  • 内存:3520kb
  • [2023-06-04 22:57:34]
  • 提交

answer

// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;

using ll  = long long;
using ull = unsigned long long;
template <class T>
using pq = priority_queue<T>;
template <class T>
using qp = priority_queue<T, vector<T>, greater<T>>;
#define vec(T, A, ...) vector<T> A(__VA_ARGS__);
#define vvec(T, A, h, ...) vector<vector<T>> A(h, vector<T>(__VA_ARGS__));
#define vvvec(T, A, h1, h2, ...) vector<vector<vector<T>>> A(h1, vector<vector<T>>(h2, vector<T>(__VA_ARGS__)));

#ifndef RIN__LOCAL
#define endl "\n"
#endif
#define spa ' '
#define len(A) A.size()
#define all(A) begin(A), end(A)

#define fori1(a) for (ll _ = 0; _ < (a); _++)
#define fori2(i, a) for (ll i = 0; i < (a); i++)
#define fori3(i, a, b) for (ll i = (a); i < (b); i++)
#define fori4(i, a, b, c) for (ll i = (a); ((c) > 0 || i > (b)) && ((c) < 0 || i < (b)); i += (c))
#define overload4(a, b, c, d, e, ...) e
#define fori(...) overload4(__VA_ARGS__, fori4, fori3, fori2, fori1)(__VA_ARGS__)

vector<char> stoc(string &S) {
    int n = S.size();
    vector<char> ret(n);
    for (int i = 0; i < n; i++) ret[i] = S[i];
    return ret;
}

#define INT(...)                                                                                                                                                                                       \
    int __VA_ARGS__;                                                                                                                                                                                   \
    inp(__VA_ARGS__);
#define LL(...)                                                                                                                                                                                        \
    ll __VA_ARGS__;                                                                                                                                                                                    \
    inp(__VA_ARGS__);
#define STRING(...)                                                                                                                                                                                    \
    string __VA_ARGS__;                                                                                                                                                                                \
    inp(__VA_ARGS__);
#define CHAR(...)                                                                                                                                                                                      \
    char __VA_ARGS__;                                                                                                                                                                                  \
    inp(__VA_ARGS__);
#define VEC(T, A, n)                                                                                                                                                                                   \
    vector<T> A(n);                                                                                                                                                                                    \
    inp(A);
#define VVEC(T, A, n, m)                                                                                                                                                                               \
    vector<vector<T>> A(n, vector<T>(m));                                                                                                                                                              \
    inp(A);

const ll MOD1 = 1000000007;
const ll MOD9 = 998244353;

template <class T>
auto min(const T &a) {
    return *min_element(all(a));
}
template <class T>
auto max(const T &a) {
    return *max_element(all(a));
}
template <class T, class S>
auto clamp(T &a, const S &l, const S &r) {
    return (a > r ? r : a < l ? l : a);
}
template <class T, class S>
inline bool chmax(T &a, const S &b) {
    return (a < b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chmin(T &a, const S &b) {
    return (a > b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chclamp(T &a, const S &l, const S &r) {
    auto b = clamp(a, l, r);
    return (a != b ? a = b, 1 : 0);
}

void FLUSH() {
    cout << flush;
}
void print() {
    cout << endl;
}
template <class Head, class... Tail>
void print(Head &&head, Tail &&...tail) {
    cout << head;
    if (sizeof...(Tail)) cout << spa;
    print(forward<Tail>(tail)...);
}
template <typename T>
void print(vector<T> &A) {
    int n = A.size();
    for (int i = 0; i < n; i++) {
        cout << A[i];
        if (i != n - 1) cout << ' ';
    }
    cout << endl;
}
template <typename T>
void print(vector<vector<T>> &A) {
    for (auto &row : A) print(row);
}
template <typename T, typename S>
void print(pair<T, S> &A) {
    cout << A.first << spa << A.second << endl;
}
template <typename T, typename S>
void print(vector<pair<T, S>> &A) {
    for (auto &row : A) print(row);
}
template <typename T, typename S>
void prisep(vector<T> &A, S sep) {
    int n = A.size();
    for (int i = 0; i < n; i++) {
        cout << A[i];
        if (i != n - 1) cout << sep;
    }
    cout << endl;
}
template <typename T, typename S>
void priend(T A, S end) {
    cout << A << end;
}
template <typename T>
void priend(T A) {
    priend(A, spa);
}
template <class... T>
void inp(T &...a) {
    (cin >> ... >> a);
}
template <typename T>
void inp(vector<T> &A) {
    for (auto &a : A) cin >> a;
}
template <typename T>
void inp(vector<vector<T>> &A) {
    for (auto &row : A) inp(row);
}
template <typename T, typename S>
void inp(pair<T, S> &A) {
    inp(A.first, A.second);
}
template <typename T, typename S>
void inp(vector<pair<T, S>> &A) {
    for (auto &row : A) inp(row.first, row.second);
}

template <typename T>
T sum(vector<T> &A) {
    T tot = 0;
    for (auto a : A) tot += a;
    return tot;
}

template <typename T>
vector<T> compression(vector<T> X) {
    sort(all(X));
    X.erase(unique(all(X)), X.end());
    return X;
}

vector<vector<int>> read_edges(int n, int m, bool direct = false, int indexed = 1) {
    vector<vector<int>> edges(n, vector<int>());
    for (int i = 0; i < m; i++) {
        INT(u, v);
        u -= indexed;
        v -= indexed;
        edges[u].push_back(v);
        if (!direct) edges[v].push_back(u);
    }
    return edges;
}
vector<vector<int>> read_tree(int n, int indexed = 1) {
    return read_edges(n, n - 1, false, indexed);
}
template <typename T>
vector<vector<pair<int, T>>> read_wedges(int n, int m, bool direct = false, int indexed = 1) {
    vector<vector<pair<int, T>>> edges(n, vector<pair<int, T>>());
    for (int i = 0; i < m; i++) {
        INT(u, v);
        T w;
        inp(w);
        u -= indexed;
        v -= indexed;
        edges[u].push_back({v, w});
        if (!direct) edges[v].push_back({u, w});
    }
    return edges;
}
template <typename T>
vector<vector<pair<int, T>>> read_wtree(int n, int indexed = 1) {
    return read_wedges<T>(n, n - 1, false, indexed);
}

inline bool yes(bool f = true) {
    cout << (f ? "yes" : "no") << endl;
    return f;
}
inline bool Yes(bool f = true) {
    cout << (f ? "Yes" : "No") << endl;
    return f;
}
inline bool YES(bool f = true) {
    cout << (f ? "YES" : "NO") << endl;
    return f;
}

inline bool no(bool f = true) {
    cout << (!f ? "yes" : "no") << endl;
    return f;
}
inline bool No(bool f = true) {
    cout << (!f ? "Yes" : "No") << endl;
    return f;
}
inline bool NO(bool f = true) {
    cout << (!f ? "YES" : "NO") << endl;
    return f;
}

void solve() {
    LL(n, d);
    d++;
    n--;
    ll ans = 0;
    while (n > 0) {
        ans++;
        n /= d;
    }
    print(ans);
}

int main() {
    cin.tie(0)->sync_with_stdio(0);
    // cout << fixed << setprecision(12);
    int t;
    t = 1;
    cin >> t;
    while (t--) solve();
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3396kb

input:

1
4 1

output:

2

result:

ok single line: '2'

Test #2:

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

input:

10000
1 1
1000000000000000000 1
1 1000000000000000000
1000000000000000000 1000000000000000000
26615519354743225 163142634
26615519354743225 163142634
26615519354743224 163142634
26615519354743226 163142634
847997831064072529 920867976
847997831064072529 920867976
847997831064072528 920867976
8479978...

output:

0
60
0
1
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5...

result:

ok 10000 lines

Test #3:

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

input:

10000
823527803750642929 907484326
823527803750642929 907484326
823527803750642928 907484326
823527803750642930 907484326
280206224307108100 529345089
280206224307108100 529345089
280206224307108099 529345089
280206224307108101 529345089
797436035478693081 892992740
797436035478693081 892992740
7974...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #4:

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

input:

10000
78980847153007969 281035312
78980847153007969 281035312
78980847153007968 281035312
78980847153007970 281035312
658663429015034041 811580820
658663429015034041 811580820
658663429015034040 811580820
658663429015034042 811580820
178145888299969041 422073320
178145888299969041 422073320
17814588...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #5:

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

input:

10000
15666898550220324 125167481
15666898550220324 125167481
15666898550220323 125167481
15666898550220325 125167481
346219528467425284 588404221
346219528467425284 588404221
346219528467425283 588404221
346219528467425285 588404221
465072590896611481 681962308
465072590896611481 681962308
46507259...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #6:

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

input:

10000
73110991665736249 270390442
73110991665736249 270390442
73110991665736248 270390442
73110991665736250 270390442
42861161698831876 207029373
42861161698831876 207029373
42861161698831875 207029373
42861161698831877 207029373
69197990371001881 263055108
69197990371001881 263055108
69197990371001...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #7:

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

input:

10000
75972055111702369 275630286
75972055111702369 275630286
75972055111702368 275630286
75972055111702370 275630286
517337177308402500 719261549
517337177308402500 719261549
517337177308402499 719261549
517337177308402501 719261549
456041060989783129 675308122
456041060989783129 675308122
45604106...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #8:

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

input:

10000
48348651546359824 219883267
48348651546359824 219883267
48348651546359823 219883267
48348651546359825 219883267
12200681691236416 110456695
12200681691236416 110456695
12200681691236415 110456695
12200681691236417 110456695
131110166021938884 362091377
131110166021938884 362091377
131110166021...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #9:

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

input:

10000
80745852506473609 284158146
80745852506473609 284158146
80745852506473608 284158146
80745852506473610 284158146
600675369855990016 775032495
600675369855990016 775032495
600675369855990015 775032495
600675369855990017 775032495
812382510389796025 901322644
812382510389796025 901322644
81238251...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #10:

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

input:

10000
972673379794944 31187711
972673379794944 31187711
972673379794943 31187711
972673379794945 31187711
313451016258843369 559866962
313451016258843369 559866962
313451016258843368 559866962
313451016258843370 559866962
95666517218401936 309300043
95666517218401936 309300043
95666517218401935 3093...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #11:

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

input:

10000
804285751878400401 896819798
804285751878400401 896819798
804285751878400400 896819798
804285751878400402 896819798
17583384551546025 132602354
17583384551546025 132602354
17583384551546024 132602354
17583384551546026 132602354
573807765001000000 757500999
573807765001000000 757500999
57380776...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #12:

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

input:

10000
887843309091149376 942254375
887843309091149376 942254375
887843309091149375 942254375
887843309091149377 942254375
32719007347049521 180883960
32719007347049521 180883960
32719007347049520 180883960
32719007347049522 180883960
112560576777237169 335500486
112560576777237169 335500486
11256057...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #13:

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

input:

10000
48683163112752996 220642613
48683163112752996 220642613
48683163112752995 220642613
48683163112752997 220642613
25063250404867984 158313771
25063250404867984 158313771
25063250404867983 158313771
25063250404867985 158313771
34256750770438849 185085792
34256750770438849 185085792
34256750770438...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #14:

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

input:

10000
724464359080587841 851154720
724464359080587841 851154720
724464359080587840 851154720
724464359080587842 851154720
268340970984337161 518016380
268340970984337161 518016380
268340970984337160 518016380
268340970984337162 518016380
124844129742420544 353332887
124844129742420544 353332887
1248...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #15:

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

input:

10000
757861616951940484 870552477
757861616951940484 870552477
757861616951940483 870552477
757861616951940485 870552477
347168009296283904 589209647
347168009296283904 589209647
347168009296283903 589209647
347168009296283905 589209647
39898238004357489 199745432
39898238004357489 199745432
398982...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #16:

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

input:

10000
348382826724933225 590239634
348382826724933225 590239634
348382826724933224 590239634
348382826724933226 590239634
9585283875318369 97904462
9585283875318369 97904462
9585283875318368 97904462
9585283875318370 97904462
896903846451605776 947050075
896903846451605776 947050075
8969038464516057...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #17:

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

input:

10000
807590102941749241 898660170
807590102941749241 898660170
807590102941749240 898660170
807590102941749242 898660170
613209342042846649 783076842
613209342042846649 783076842
613209342042846648 783076842
613209342042846650 783076842
122989867858986769 350699112
122989867858986769 350699112
1229...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #18:

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

input:

10000
90063764290125025 300106254
90063764290125025 300106254
90063764290125024 300106254
90063764290125026 300106254
25144495008144964 158570157
25144495008144964 158570157
25144495008144963 158570157
25144495008144965 158570157
27517529656287225 165884084
27517529656287225 165884084
27517529656287...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #19:

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

input:

10000
11992765784951169 109511486
11992765784951169 109511486
11992765784951168 109511486
11992765784951170 109511486
199717083235391929 446897172
199717083235391929 446897172
199717083235391928 446897172
199717083235391930 446897172
1952709991236 1397393
1952709991236 1397393
1952709991235 1397393
...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #20:

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

input:

10000
140181659725178569 374408412
140181659725178569 374408412
140181659725178568 374408412
140181659725178570 374408412
3910499029844289 62533982
3910499029844289 62533982
3910499029844288 62533982
3910499029844290 62533982
200031067793292241 447248328
200031067793292241 447248328
2000310677932922...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #21:

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

input:

10000
901070041670456464 949247091
901070041670456464 949247091
901070041670456463 949247091
901070041670456465 949247091
140499500512716900 374832629
140499500512716900 374832629
140499500512716899 374832629
140499500512716901 374832629
840452830505001025 916762144
840452830505001025 916762144
8404...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #22:

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

input:

10000
802483663200975625 895814524
802483663200975625 895814524
802483663200975624 895814524
802483663200975626 895814524
947834837549065216 973568095
947834837549065216 973568095
947834837549065215 973568095
947834837549065217 973568095
6751387459247929 82166826
6751387459247929 82166826
6751387459...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #23:

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

input:

10000
202588535475083044 450098361
202588535475083044 450098361
202588535475083043 450098361
202588535475083045 450098361
509730134199607876 713953873
509730134199607876 713953873
509730134199607875 713953873
509730134199607877 713953873
436158857252944081 660423240
436158857252944081 660423240
4361...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #24:

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

input:

10000
327874773938285025 572603504
327874773938285025 572603504
327874773938285024 572603504
327874773938285026 572603504
694814098067569216 833555095
694814098067569216 833555095
694814098067569215 833555095
694814098067569217 833555095
417580099438775641 646204378
417580099438775641 646204378
4175...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #25:

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

input:

10000
98621312536412416 314040303
98621312536412416 314040303
98621312536412415 314040303
98621312536412417 314040303
104735316690803044 323628361
104735316690803044 323628361
104735316690803043 323628361
104735316690803045 323628361
11060583555537481 105169308
11060583555537481 105169308
1106058355...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #26:

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

input:

10000
169052242164056161 411159630
169052242164056161 411159630
169052242164056160 411159630
169052242164056162 411159630
36458785116934569 190941836
36458785116934569 190941836
36458785116934568 190941836
36458785116934570 190941836
916564941410536324 957373981
916564941410536324 957373981
91656494...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #27:

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

input:

10000
23320700831924224 152711167
23320700831924224 152711167
23320700831924223 152711167
23320700831924225 152711167
760421119749008656 872021283
760421119749008656 872021283
760421119749008655 872021283
760421119749008657 872021283
59958088087647649 244863406
59958088087647649 244863406
5995808808...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #28:

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

input:

10000
807411168046450881 898560608
807411168046450881 898560608
807411168046450880 898560608
807411168046450882 898560608
402492522627464256 634422983
402492522627464256 634422983
402492522627464255 634422983
402492522627464257 634422983
38237019874123225 195542884
38237019874123225 195542884
382370...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #29:

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

input:

10000
206155389105650884 454043377
206155389105650884 454043377
206155389105650883 454043377
206155389105650885 454043377
7957814985775396 89206585
7957814985775396 89206585
7957814985775395 89206585
7957814985775397 89206585
110131844782159489 331861182
110131844782159489 331861182
1101318447821594...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #30:

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

input:

10000
780020513431290000 883187699
780020513431290000 883187699
780020513431289999 883187699
780020513431290001 883187699
557937583109222416 746952195
557937583109222416 746952195
557937583109222415 746952195
557937583109222417 746952195
705396378532348944 839878787
705396378532348944 839878787
7053...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #31:

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

input:

10000
487620431987097600 698298239
487620431987097600 698298239
487620431987097599 698298239
487620431987097601 698298239
47693357417071921 218388088
47693357417071921 218388088
47693357417071920 218388088
47693357417071922 218388088
693874124365727041 832991070
693874124365727041 832991070
69387412...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #32:

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

input:

10000
859862039036976369 927287462
859862039036976369 927287462
859862039036976368 927287462
859862039036976370 927287462
237372310534768249 487208692
237372310534768249 487208692
237372310534768248 487208692
237372310534768250 487208692
3460997373778564 58830241
3460997373778564 58830241
3460997373...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #33:

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

input:

10000
416606181424037641 645450370
416606181424037641 645450370
416606181424037640 645450370
416606181424037642 645450370
44523302039757025 211005454
44523302039757025 211005454
44523302039757024 211005454
44523302039757026 211005454
4531094088813604 67313401
4531094088813604 67313401
45310940888136...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #34:

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

input:

10000
280462782463516900 529587369
280462782463516900 529587369
280462782463516899 529587369
280462782463516901 529587369
888085368122558596 942382813
888085368122558596 942382813
888085368122558595 942382813
888085368122558597 942382813
20041835557256100 141569189
20041835557256100 141569189
200418...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #35:

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

input:

10000
691683718135861504 831675247
691683718135861504 831675247
691683718135861503 831675247
691683718135861505 831675247
168021029336964489 409903682
168021029336964489 409903682
168021029336964488 409903682
168021029336964490 409903682
793267410280538449 890655606
793267410280538449 890655606
7932...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #36:

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

input:

10000
769298340479971600 877096539
769298340479971600 877096539
769298340479971599 877096539
769298340479971601 877096539
126077821013574544 355074387
126077821013574544 355074387
126077821013574543 355074387
126077821013574545 355074387
158476359885719236 398090893
158476359885719236 398090893
1584...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #37:

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

input:

10000
433160634036658801 658149400
433160634036658801 658149400
433160634036658800 658149400
433160634036658802 658149400
493411862398555489 702432816
493411862398555489 702432816
493411862398555488 702432816
493411862398555490 702432816
339298266301963609 582493146
339298266301963609 582493146
3392...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #38:

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

input:

10000
236298646573670464 486105591
236298646573670464 486105591
236298646573670463 486105591
236298646573670465 486105591
983383788113896464 991657091
983383788113896464 991657091
983383788113896463 991657091
983383788113896465 991657091
490113433164078361 700081018
490113433164078361 700081018
4901...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #39:

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

input:

10000
697986201598819225 835455684
697986201598819225 835455684
697986201598819224 835455684
697986201598819226 835455684
20391074027993124 142797317
20391074027993124 142797317
20391074027993123 142797317
20391074027993125 142797317
530655966125354161 728461368
530655966125354161 728461368
53065596...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #40:

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

input:

10000
395888941571037721 629197060
395888941571037721 629197060
395888941571037720 629197060
395888941571037722 629197060
541081549574991936 735582455
541081549574991936 735582455
541081549574991935 735582455
541081549574991937 735582455
265109996489295556 514888333
265109996489295556 514888333
2651...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #41:

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

input:

10000
195562167887533225 442224114
195562167887533225 442224114
195562167887533224 442224114
195562167887533226 442224114
221441587310246416 470575803
221441587310246416 470575803
221441587310246415 470575803
221441587310246417 470575803
296397154233216100 544423689
296397154233216100 544423689
2963...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #42:

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

input:

10000
211871413377806400 460294919
211871413377806400 460294919
211871413377806399 460294919
211871413377806401 460294919
30911923762972641 175817870
30911923762972641 175817870
30911923762972640 175817870
30911923762972642 175817870
344434995061364025 586885844
344434995061364025 586885844
34443499...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #43:

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

input:

10000
197649104602728025 444577444
197649104602728025 444577444
197649104602728024 444577444
197649104602728026 444577444
257886932439627481 507825690
257886932439627481 507825690
257886932439627480 507825690
257886932439627482 507825690
251641241145616 15863203
251641241145616 15863203
251641241145...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #44:

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

input:

10000
10178546938776225 100888784
10178546938776225 100888784
10178546938776224 100888784
10178546938776226 100888784
1041607590410916 32273945
1041607590410916 32273945
1041607590410915 32273945
1041607590410917 32273945
631293644746611025 794539894
631293644746611025 794539894
631293644746611024 7...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #45:

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

input:

10000
348121160081556624 590017931
348121160081556624 590017931
348121160081556623 590017931
348121160081556625 590017931
578754674498525625 760759274
578754674498525625 760759274
578754674498525624 760759274
578754674498525626 760759274
65243744665959601 255428550
65243744665959601 255428550
652437...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #46:

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

input:

10000
532655108761069009 729832246
532655108761069009 729832246
532655108761069008 729832246
532655108761069010 729832246
279028310525540416 528231303
279028310525540416 528231303
279028310525540415 528231303
279028310525540417 528231303
487911161503691641 698506378
487911161503691641 698506378
4879...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #47:

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

input:

10000
121534951274788689 348618632
121534951274788689 348618632
121534951274788688 348618632
121534951274788690 348618632
516263108265685225 718514514
516263108265685225 718514514
516263108265685224 718514514
516263108265685226 718514514
105761790609323641 325210378
105761790609323641 325210378
1057...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #48:

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

input:

10000
24433944045977664 156313607
24433944045977664 156313607
24433944045977663 156313607
24433944045977665 156313607
645825678843105601 803632800
645825678843105601 803632800
645825678843105600 803632800
645825678843105602 803632800
492773061941585296 701977963
492773061941585296 701977963
49277306...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #49:

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

input:

10000
4143960119465604 64373597
4143960119465604 64373597
4143960119465603 64373597
4143960119465605 64373597
56040968853548644 236729737
56040968853548644 236729737
56040968853548643 236729737
56040968853548645 236729737
628452741661512769 792750112
628452741661512769 792750112
628452741661512768 7...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #50:

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

input:

10000
421620703768906756 649323265
421620703768906756 649323265
421620703768906755 649323265
421620703768906757 649323265
218886940504774116 467853545
218886940504774116 467853545
218886940504774115 467853545
218886940504774117 467853545
99144710778345961 314872530
99144710778345961 314872530
991447...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines

Test #51:

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

input:

10000
966000623080836249 982853306
966000623080836249 982853306
966000623080836248 982853306
966000623080836250 982853306
37869835265010225 194601734
37869835265010225 194601734
37869835265010224 194601734
37869835265010226 194601734
316166718725683849 562287042
316166718725683849 562287042
31616671...

output:

2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
...

result:

ok 10000 lines