QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#700706#9535. Arrow a Rowucup-team112#AC ✓22ms7004kbC++2013.3kb2024-11-02 13:18:552024-11-02 13:19:33

Judging History

This is the latest submission verdict.

  • [2024-11-02 13:19:33]
  • Judged
  • Verdict: AC
  • Time: 22ms
  • Memory: 7004kb
  • [2024-11-02 13:18:55]
  • Submitted

answer

// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
// #define INTERACTIVE

#include <bits/stdc++.h>
using namespace std;

namespace templates {
// type
using ll  = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pil = pair<int, ll>;
using Pli = pair<ll, int>;
using Pll = pair<ll, ll>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using qp = priority_queue<T, vector<T>, greater<T>>;
// clang-format off
#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__)));
// clang-format on

// for loop
#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__)

// declare and input
// clang-format off
#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 DOUBLE(...) double __VA_ARGS__; STRING(str___); __VA_ARGS__ = stod(str___);
#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);
// clang-format on

// const value
const ll MOD1   = 1000000007;
const ll MOD9   = 998244353;
const double PI = acos(-1);

// other macro
#if !defined(RIN__LOCAL) && !defined(INTERACTIVE)
#define endl "\n"
#endif
#define spa ' '
#define len(A) ll(A.size())
#define all(A) begin(A), end(A)

// function
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;
}
string ctos(vector<char> &S) {
    int n      = S.size();
    string ret = "";
    for (int i = 0; i < n; i++) ret += S[i];
    return ret;
}

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);
}

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;
}

// input and output
namespace io {
// __int128_t
std::ostream &operator<<(std::ostream &dest, __int128_t value) {
    std::ostream::sentry s(dest);
    if (s) {
        __uint128_t tmp = value < 0 ? -value : value;
        char buffer[128];
        char *d = std::end(buffer);
        do {
            --d;
            *d = "0123456789"[tmp % 10];
            tmp /= 10;
        } while (tmp != 0);
        if (value < 0) {
            --d;
            *d = '-';
        }
        int len = std::end(buffer) - d;
        if (dest.rdbuf()->sputn(d, len) != len) {
            dest.setstate(std::ios_base::badbit);
        }
    }
    return dest;
}

// vector<T>
template <typename T>
istream &operator>>(istream &is, vector<T> &A) {
    for (auto &a : A) is >> a;
    return is;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &A) {
    for (size_t i = 0; i < A.size(); i++) {
        os << A[i];
        if (i != A.size() - 1) os << ' ';
    }
    return os;
}

// vector<vector<T>>
template <typename T>
istream &operator>>(istream &is, vector<vector<T>> &A) {
    for (auto &a : A) is >> a;
    return is;
}
template <typename T>
ostream &operator<<(ostream &os, vector<vector<T>> &A) {
    for (size_t i = 0; i < A.size(); i++) {
        os << A[i];
        if (i != A.size() - 1) os << endl;
    }
    return os;
}

// pair<S, T>
template <typename S, typename T>
istream &operator>>(istream &is, pair<S, T> &A) {
    is >> A.first >> A.second;
    return is;
}
template <typename S, typename T>
ostream &operator<<(ostream &os, pair<S, T> &A) {
    os << A.first << ' ' << A.second;
    return os;
}

// vector<pair<S, T>>
template <typename S, typename T>
istream &operator>>(istream &is, vector<pair<S, T>> &A) {
    for (size_t i = 0; i < A.size(); i++) {
        is >> A[i];
    }
    return is;
}
template <typename S, typename T>
ostream &operator<<(ostream &os, vector<pair<S, T>> &A) {
    for (size_t i = 0; i < A.size(); i++) {
        os << A[i];
        if (i != A.size() - 1) os << endl;
    }
    return os;
}

// tuple
template <typename T, size_t N>
struct TuplePrint {
    static ostream &print(ostream &os, const T &t) {
        TuplePrint<T, N - 1>::print(os, t);
        os << ' ' << get<N - 1>(t);
        return os;
    }
};
template <typename T>
struct TuplePrint<T, 1> {
    static ostream &print(ostream &os, const T &t) {
        os << get<0>(t);
        return os;
    }
};
template <typename... Args>
ostream &operator<<(ostream &os, const tuple<Args...> &t) {
    TuplePrint<decltype(t), sizeof...(Args)>::print(os, t);
    return os;
}

// io functions
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(std::forward<Tail>(tail)...);
}

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 prispa(T A) {
    priend(A, spa);
}
template <typename T, typename S>
bool printif(bool f, T A, S B) {
    if (f)
        print(A);
    else
        print(B);
    return f;
}

template <class... T>
void inp(T &...a) {
    (cin >> ... >> a);
}

} // namespace io
using namespace io;

// read graph
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 = long long>
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 = long long>
vector<vector<pair<int, T>>> read_wtree(int n, int indexed = 1) {
    return read_wedges<T>(n, n - 1, false, indexed);
}

// yes / no
namespace yesno {

// yes
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;
}

// no
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;
}

// possible
inline bool possible(bool f = true) {
    cout << (f ? "possible" : "impossible") << endl;
    return f;
}
inline bool Possible(bool f = true) {
    cout << (f ? "Possible" : "Impossible") << endl;
    return f;
}
inline bool POSSIBLE(bool f = true) {
    cout << (f ? "POSSIBLE" : "IMPOSSIBLE") << endl;
    return f;
}

// impossible
inline bool impossible(bool f = true) {
    cout << (!f ? "possible" : "impossible") << endl;
    return f;
}
inline bool Impossible(bool f = true) {
    cout << (!f ? "Possible" : "Impossible") << endl;
    return f;
}
inline bool IMPOSSIBLE(bool f = true) {
    cout << (!f ? "POSSIBLE" : "IMPOSSIBLE") << endl;
    return f;
}

// Alice Bob
inline bool Alice(bool f = true) {
    cout << (f ? "Alice" : "Bob") << endl;
    return f;
}
inline bool Bob(bool f = true) {
    cout << (f ? "Bob" : "Alice") << endl;
    return f;
}

// Takahashi Aoki
inline bool Takahashi(bool f = true) {
    cout << (f ? "Takahashi" : "Aoki") << endl;
    return f;
}
inline bool Aoki(bool f = true) {
    cout << (f ? "Aoki" : "Takahashi") << endl;
    return f;
}

} // namespace yesno
using namespace yesno;

} // namespace templates
using namespace templates;

void solve() {
    STRING(S);
    int n = len(S);
    if (S[0] != '>') {
        No();
        return;
    }
    fori(i, n - 3, n) {
        if (S[i] != '>') {
            No();
            return;
        }
    }

    int idx = -1;
    fori(i, n) {
        if (S[i] == '-') {
            idx = i;
        }
    }

    if (idx == -1) {
        No();
        return;
    }

    vec(Pll, ans, 0);
    int l = idx;
    while (S[l] == '-') {
        l--;
    }
    {
        int l_ = l;
        int r_ = idx + 3;
        while (r_ < n) {
            ans.push_back({l_, r_});
            l_++;
            r_++;
        }
    }

    int r = l - 1;
    while (r >= 0) {
        int l = r;
        while (l >= 0 and S[l] == '>') {
            ans.push_back({l, r + 4});
            l--;
        }
        if (l == -1) break;
        r = l;
        while (S[l] == '-') {
            l--;
        }
        ans.push_back({l, r + 3});
        r = l - 1;
    }

    reverse(all(ans));
    print("Yes", len(ans));
    for (auto [l, r] : ans) {
        print(l + 1, r - l + 1);
    }

#ifdef RIN__LOCAL
    {
        assert(len(ans) <= n);
        string T = string(n, '*');
        for (auto [l, r] : ans) {
            T[l] = '>';
            fori(i, l + 1, r - 2) {
                T[i] = '-';
            }
            fori(i, r - 2, r + 1) {
                T[i] = '>';
            }
        }
        assert(T == S);
    }
#endif
}

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

// // #pragma GCC target("avx2")
// // #pragma GCC optimize("O3")
// // #pragma GCC optimize("unroll-loops")
// // #define INTERACTIVE
//
// #include "kyopro-cpp/template.hpp"
//
// void solve() {
//     STRING(S);
//     int n = len(S);
//     if (S[0] != '>') {
//         No();
//         return;
//     }
//     fori(i, n - 3, n) {
//         if (S[i] != '>') {
//             No();
//             return;
//         }
//     }
//
//     int idx = -1;
//     fori(i, n) {
//         if (S[i] == '-') {
//             idx = i;
//         }
//     }
//
//     if (idx == -1) {
//         No();
//         return;
//     }
//
//     vec(Pll, ans, 0);
//     int l = idx;
//     while (S[l] == '-') {
//         l--;
//     }
//     {
//         int l_ = l;
//         int r_ = idx + 3;
//         while (r_ < n) {
//             ans.push_back({l_, r_});
//             l_++;
//             r_++;
//         }
//     }
//
//     int r = l - 1;
//     while (r >= 0) {
//         int l = r;
//         while (l >= 0 and S[l] == '>') {
//             ans.push_back({l, r + 4});
//             l--;
//         }
//         if (l == -1) break;
//         r = l;
//         while (S[l] == '-') {
//             l--;
//         }
//         ans.push_back({l, r + 3});
//         r = l - 1;
//     }
//
//     reverse(all(ans));
//     print("Yes", len(ans));
//     for (auto [l, r] : ans) {
//         print(l + 1, r - l + 1);
//     }
//
// #ifdef RIN__LOCAL
//     {
//         assert(len(ans) <= n);
//         string T = string(n, '*');
//         for (auto [l, r] : ans) {
//             T[l] = '>';
//             fori(i, l + 1, r - 2) {
//                 T[i] = '-';
//             }
//             fori(i, r - 2, r + 1) {
//                 T[i] = '>';
//             }
//         }
//         assert(T == S);
//     }
// #endif
// }
//
// int main() {
// #ifndef INTERACTIVE
//     std::cin.tie(0)->sync_with_stdio(0);
// #endif
//     // std::cout << std::fixed << std::setprecision(12);
//     int t;
//     t = 1;
//     std::cin >> t;
//     while (t--) solve();
//     return 0;
// }

詳細信息

Test #1:

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

input:

4
>>->>>
>>>->
>>>>>
>->>>>>>

output:

Yes 2
1 5
2 5
No
No
Yes 4
4 5
3 5
2 5
1 5

result:

ok ok (4 test cases)

Test #2:

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

input:

126
>->-->>>>
>--->->>>>
>--->-->>>
>>-->->>>
>>-->>>>>
>>->->>>>
>>->>->>>>
>-->->->>>
>->->>>>>>
>->>>
>->->>>>>
>>>->->>>
>>->>>>>>>
>>>>>->>>
>->>>->>>
>>--->->>>
>>->>>>
>->>>>->>>
>>>>-->>>
>---->>>
>>>---->>>
>>>>->>>>
>->>-->>>
>-->-->>>>
>>---->>>
>>--->>>
>->>>-->>>
>>-->>>>
>>---->>>>
>>-...

output:

Yes 3
1 5
4 6
3 6
Yes 3
1 7
6 5
5 5
Yes 2
1 7
5 6
Yes 3
1 5
2 6
5 5
Yes 4
1 5
4 6
3 6
2 6
Yes 4
1 5
2 5
5 5
4 5
Yes 5
1 5
2 5
4 5
6 5
5 5
Yes 3
1 6
4 5
6 5
Yes 5
1 5
6 5
5 5
4 5
3 5
Yes 1
1 5
Yes 4
1 5
5 5
4 5
3 5
Yes 4
1 6
2 5
3 5
5 5
Yes 6
1 5
6 5
5 5
4 5
3 5
2 5
Yes 5
1 8
2 7
3 6
4 5
5 5
Yes 4
1 ...

result:

ok ok (126 test cases)

Test #3:

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

input:

4032
>>--->>>>>>>>
>->>->->-->->>>
>>--->>--->>>
>>->->->>>>>>>>
>->---->->>>
>->>->>---->>>>
>>>>>>>>->>>>
>->>>--->>>->>>
>->>->>-->>>>>>
>->>-->---->>>
>-->--->>>->>>
>->---->>-->>>>
>>------>>>
>>>-->>--->>>>>
>->->->>-->>>>
>->->-->>->->>>
>>->>>>-->->>>>
>>>-->>->--->>>
>->->>>>>->>>>
>>-->->>...

output:

Yes 7
1 5
7 7
6 7
5 7
4 7
3 7
2 7
Yes 6
1 5
3 5
4 5
6 5
8 6
11 5
Yes 4
1 5
2 7
6 5
7 7
Yes 9
1 5
2 5
4 5
11 5
10 5
9 5
8 5
7 5
6 5
Yes 3
1 5
3 8
8 5
Yes 6
1 5
3 5
4 5
6 5
8 8
7 8
Yes 9
1 11
2 10
3 9
4 8
5 7
6 6
7 5
9 5
8 5
Yes 7
1 5
3 6
4 5
5 7
9 6
10 5
11 5
Yes 8
1 5
3 5
4 5
6 5
10 6
9 6
8 6
7 6
Ye...

result:

ok ok (4032 test cases)

Test #4:

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

input:

10000
>>>>->->>->>->>>>
>->-->>->>->>>>>>
>->->>-->--->>>>>
>---->-->->>>>>>>
>->-->>--->>->>>>
>->>->>>>>>-->>>
>>--->->-->>->>>
>-->---->>>->>>
>->----->->->>>>>
>>--->---->-->>>>
>>-->->->--->>>
>----->>-->>->>>>
>-->->->>>>>->>>>
>>->>---->-->>>
>>->>-->>>-->>>
>------>->>>->>>>
>->->-->->>>->>>...

output:

Yes 10
1 7
2 6
3 5
4 5
6 5
8 5
9 5
11 5
13 5
12 5
Yes 9
1 5
3 6
6 5
7 5
9 5
13 5
12 5
11 5
10 5
Yes 7
1 5
3 5
5 5
6 6
11 7
10 7
9 7
Yes 7
1 8
6 6
13 5
12 5
11 5
10 5
9 5
Yes 7
1 5
3 6
6 5
7 7
11 5
13 5
12 5
Yes 9
1 5
3 5
4 5
6 9
7 8
8 7
9 6
10 5
11 6
Yes 6
1 5
2 7
6 5
8 6
11 5
12 5
Yes 5
1 6
4 8
9 6...

result:

ok ok (10000 test cases)

Test #5:

score: 0
Accepted
time: 13ms
memory: 3868kb

input:

10000
>>>-->>>>-->---->->->-->>>
>>-->>>>->-->>->>>
>->-->--->--->->-->>--->>->->>-->->->>>>>>->>>>----->->--->>----->>-->>>----->->->>>--->>->>-->->->->---->>->>>-->>->->>>->->>>>->>->->>-->>>->>->>-->>>>-->>-->>>->>->->>>--->>>-->>>--->>->->>>>>->->---->>>>->>>
->->>>>--->>>>>>->>>->>>>->->-->-->>...

output:

Yes 11
1 6
2 5
3 6
6 7
7 6
8 5
9 6
12 8
17 5
19 5
21 6
Yes 9
1 5
2 6
5 7
6 6
7 5
8 5
10 6
13 5
14 5
Yes 110
1 5
3 6
6 7
10 7
14 5
16 6
19 5
20 7
24 5
25 5
27 5
29 5
30 6
33 5
35 5
37 9
38 8
39 7
40 6
41 5
42 5
44 7
45 6
46 5
47 9
53 5
55 7
59 5
60 9
66 5
67 6
70 6
71 5
72 9
78 5
80 5
82 6
83 5
84 7
...

result:

ok ok (10000 test cases)

Test #6:

score: 0
Accepted
time: 13ms
memory: 3660kb

input:

9999
->->--->>>>->->--->>--
->>>--->>>-->>--->>---
-->>>>>>>-
>>>->>>>>>>--
>>-->-->->----->->>>>->>->---->->
>-->->>>--->->->>->->-
>->--->--->>>>->>>----->------>>-->->>>
>>->>>->>>---->>>->>>>>>>>>->--->>->>>>>-->>>->->->>-->->--->->-->->>->->->>-->-->>>>>>>>--->>--->->>>-->->----->>-->->>--->-->...

output:

No
No
No
No
No
No
Yes 14
1 5
3 7
7 7
11 7
12 6
13 5
14 5
16 6
17 5
18 9
24 10
31 5
32 6
35 5
Yes 69
1 5
2 5
4 6
5 5
6 5
8 6
9 5
10 8
15 6
16 5
17 5
19 12
20 11
21 10
22 9
23 8
24 7
25 6
26 5
27 5
29 7
33 5
34 5
36 8
37 7
38 6
39 5
40 6
43 6
44 5
45 5
47 5
49 5
51 5
52 6
55 5
57 7
61 5
63 6
66 5
68 5...

result:

ok ok (9999 test cases)

Test #7:

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

input:

5
>-->>>>>--->->->>->>>>>->->-->-->->>>-->->--->>>------>->>-->>>------->>---->-->>>>>>-->>--->>-->->->>>>->-->------>>->>>>->>>-->---->--->>-->-->->--->->->->->>->-->->--->>>>->>->--->->>-->>>>>>->>>>->>--->->>-->>->->---->>>->->>->>->--->->->-->->>->->-->->------>>>->>>>>->>-->>->>>->>>>>----->---...

output:

No
No
Yes 48171
1 6
2 5
3 5
5 6
6 5
7 5
9 5
10 5
12 8
17 7
18 6
19 5
20 5
22 6
23 5
24 5
26 6
27 5
28 5
30 6
33 5
34 5
36 5
37 5
39 7
40 6
41 5
42 5
44 7
45 6
46 5
47 7
51 6
54 9
60 8
61 7
62 6
63 5
64 5
66 6
67 5
68 6
71 6
72 5
73 5
75 6
76 5
77 7
81 6
82 5
83 7
87 5
88 6
91 5
93 5
94 8
99 5
100 8
...

result:

ok ok (5 test cases)

Test #8:

score: 0
Accepted
time: 19ms
memory: 7004kb

input:

5
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>...

output:

No
Yes 99996
1 99998
2 99997
3 99996
4 99995
5 99994
6 99993
7 99992
8 99991
9 99990
10 99989
11 99988
12 99987
13 99986
14 99985
15 99984
16 99983
17 99982
18 99981
19 99980
20 99979
21 99978
22 99977
23 99976
24 99975
25 99974
26 99973
27 99972
28 99971
29 99970
30 99969
31 99968
32 99967
33 99966...

result:

ok ok (5 test cases)

Test #9:

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

input:

20
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>...

output:

Yes 24994
1 11297
2 11296
3 11295
4 11294
5 11293
6 11292
7 11291
8 11290
9 11289
10 11288
11 11287
12 11286
13 11285
14 11284
15 11283
16 11282
17 11281
18 11280
19 11279
20 11278
21 11277
22 11276
23 11275
24 11274
25 11273
26 11272
27 11271
28 11270
29 11269
30 11268
31 11267
32 11266
33 11265
34...

result:

ok ok (20 test cases)

Test #10:

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

input:

20
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>...

output:

Yes 24996
1 2281
2 2280
3 2279
4 2278
5 2277
6 2276
7 2275
8 2274
9 2273
10 2272
11 2271
12 2270
13 2269
14 2268
15 2267
16 2266
17 2265
18 2264
19 2263
20 2262
21 2261
22 2260
23 2259
24 2258
25 2257
26 2256
27 2255
28 2254
29 2253
30 2252
31 2251
32 2250
33 2249
34 2248
35 2247
36 2246
37 2245
38 ...

result:

ok ok (20 test cases)

Extra Test:

score: 0
Extra Test Passed