QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#442996#8519. Radarsucup-team3877#AC ✓229ms5376kbC++2311.8kb2024-06-15 14:01:102024-06-15 14:01:11

Judging History

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

  • [2024-06-15 14:01:11]
  • 评测
  • 测评结果:AC
  • 用时:229ms
  • 内存:5376kb
  • [2024-06-15 14:01:10]
  • 提交

answer

//line 1 "answer.cpp"
#if !__INCLUDE_LEVEL__
#include __FILE__
int solve() {
    ll n; input(n);
    auto a = vv<ll>(n, n);
    rep(i, n) rep(j, n) input(a[i][j]);
    ll ni = n / 2;
    auto dp = vector<ll>(1 << 4, INFL);
    dp[0] = 0;
    rep(i, n) rep(j, n) {
        ll bn = 0;
        if (i <= ni && j <= ni) bn |= (1 << 0);
        if (i <= ni && j >= ni) bn |= (1 << 1);
        if (i >= ni && j <= ni) bn |= (1 << 2);
        if (i >= ni && j >= ni) bn |= (1 << 3);
        debug(i, j, bit::to_string(bn));
        auto dpn = dp;
        rep(bit, 1 << 4) chmin(dpn[bit | bn] ,dp[bit] + a[i][j]);
        swap(dp, dpn);
    }
    print(dp[15]);
    return 0;
}
int main() {
    ll t; input(t);
    rep(t) solve();
}
#else
//line 2 "/home/seekworser/.cpp_lib/competitive_library/competitive/std/std.hpp"
#include <bits/stdc++.h>
#ifndef LOCAL_TEST
#pragma GCC target ("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#endif // LOCAL_TEST
using namespace std;
// shorten typenames
using ll = long long;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using vi = vector<int>;  using vvi = vector<vi>; using vvvi = vector<vvi>;
using vl = vector<ll>;  using vvl = vector<vl>; using vvvl = vector<vvl>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vc = vector<char>; using vvc = vector<vc>; using vvvc = vector<vvc>;
using vd = vector<double>; using vvd = vector<vd>; using vvvd = vector<vvd>;
using vs = vector<string>; using vvs = vector<vector<string>>; using vvvs = vector<vector<vector<string>>>;
template<typename T> vector<vector<T>> vv(int h, int w, T val = T()) { return vector(h, vector<T>(w, val)); }
template<typename T> vector<vector<vector<T>>> vvv(int h1, int h2, int h3, T val = T()) { return vector(h1, vector(h2, vector<T>(h3, val))); }
template<typename T> vector<vector<vector<vector<T>>>> vvvv(int h1, int h2, int h3, int h4, T val = T()) { return vector(h1, vector(h2, vector(h3, vector<T>(h4, val)))); }
template <class T> using priority_queue_min = priority_queue<T, vector<T>, greater<T>>;
// define CONSTANTS
constexpr double PI = 3.14159265358979323;
constexpr int INF = 100100111; constexpr ll INFL = 3300300300300300491LL;
float EPS = 1e-8; double EPSL = 1e-10;
template<typename T> bool eq(const T x, const T y) { return x == y; }
template<> bool eq<double>(const double x, const double y) { return (abs(x - y) < EPSL * x || abs(x - y) < EPSL); }
template<> bool eq<float>(const float x, const float y) { return abs(x - y) < EPS * x; }
template<typename T> bool neq(const T x, const T y) { return !(eq<T>(x, y)); }
template<typename T> bool ge(const T x, const T y) { return (eq<T>(x, y) || (x > y)); }
template<typename T> bool le(const T x, const T y) { return (eq<T>(x, y) || (x < y)); }
template<typename T> bool gt(const T x, const T y) { return !(le<T>(x, y)); }
template<typename T> bool lt(const T x, const T y) { return !(ge<T>(x, y)); }
constexpr int MODINT998244353 = 998244353;
constexpr int MODINT1000000007 = 1000000007;
// fasten io
struct Nyan { Nyan() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(18); } } nyan;
// define macros
#define all(a) (a).begin(), (a).end()
#define sz(x) ((ll)(x).size())
#define rep1(n) for(ll dummy_iter = 0LL; dummy_iter < n; ++dummy_iter) // 0,1,...,n-1
#define rep2(i, n) for(ll i = 0LL, i##_counter = 0LL; i##_counter < ll(n); ++(i##_counter), (i) = i##_counter) // i=0,1,...,n-1
#define rep3(i, s, t) for(ll i = ll(s), i##_counter = ll(s); i##_counter < ll(t); ++(i##_counter), (i) = (i##_counter)) // i=s,s+1,...,t-1
#define rep4(i, s, t, step) for(ll i##_counter = step > 0 ? ll(s) : -ll(s), i##_end = step > 0 ? ll(t) : -ll(t), i##_step = abs(step), i = ll(s); i##_counter < i##_end; i##_counter += i##_step, i = step > 0 ? i##_counter : -i##_counter) // i=s,s+step,...,<t
#define overload4(a, b, c, d, e, ...) e
#define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define repe(a, v) for(auto& a : (v)) // iterate over all elements in v
#define smod(n, m) ((((n) % (m)) + (m)) % (m))
#define sdiv(n, m) (((n) - smod(n, m)) / (m))
#define uniq(a) {sort(all(a)); (a).erase(unique(all(a)), (a).end());}
int Yes(bool b=true) { cout << (b ? "Yes\n" : "No\n"); return 0; };
int YES(bool b=true) { cout << (b ? "YES\n" : "NO\n"); return 0; };
int No(bool b=true) {return Yes(!b);};
int NO(bool b=true) {return YES(!b);};
template<typename T, size_t N> T max(array<T, N>& a) { return *max_element(all(a)); };
template<typename T, size_t N> T min(array<T, N>& a) { return *min_element(all(a)); };
template<typename T> T max(vector<T>& a) { return *max_element(all(a)); };
template<typename T> T min(vector<T>& a) { return *min_element(all(a)); };
template<typename T> vector<T> vec_slice(const vector<T>& a, int l, int r) { vector<T> rev; rep(i, l, r) rev.push_back(a[i]); return rev; };
template<typename T> T sum(vector<T>& a, T zero = T(0)) { T rev = zero; rep(i, sz(a)) rev += a[i]; return rev; };
template<typename T> bool in_range(const T& val, const T& s, const T& t) { return s <= val && val < t; };

template <class T> inline vector<T>& operator--(vector<T>& v) { repe(x, v) --x; return v; }
template <class T> inline vector<T>& operator++(vector<T>& v) { repe(x, v) ++x; return v; }

ll powm(ll a, ll n, ll mod=INFL) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = (res * a) % mod;
        if (n > 1) a = (a * a) % mod;
        n >>= 1;
    }
    return res;
}
ll sqrtll(ll x) {
    assert(x >= 0);
    ll rev = sqrt(x);
    while(rev * rev > x) --rev;
    while((rev+1) * (rev+1)<=x) ++rev;
    return rev;
}
template <class T> inline bool chmax(T& M, const T& x) { if (M < x) { M = x; return true; } return false; }
template <class T> inline bool chmin(T& m, const T& x) { if (m > x) { m = x; return true; } return false; }
int digit(ll x, int d=10) { int rev=0; while (x > 0) { rev++; x /= d;}; return rev; }
/**
 * @brief std.hpp
 * @docs docs/std/std.md
 */
//line 3 "/home/seekworser/.cpp_lib/competitive_library/competitive/math/bit.hpp"
namespace bit{
    bool lb(ll x) { return (x & 1); }
    bool get(ll x, int n) { return ((x >> n) & 1); }
    ll update(ll x, int n, bool b) { return (x & ~(1LL << n)) + (b << n); }
    ll lsb(ll x) { return -x & x; }
    int digit(ll x) { int rev=0; while(x) { rev++; x >>= 1; } return rev; }
    ll msb(ll x) { if (x==0) return 0; return 1LL << (digit(x) - 1); }
    int lsbd(ll x) {return digit(lsb(x)); }
    int count(ll x) { return __builtin_popcountll(x); }
    string to_string(ll x, bool rev=true) { stringstream ss; while (x) { ss << lb(x); x >>= 1;} string s(ss.str()); if (rev) reverse(all(s)); return s; }
}
/**
 * @brief ビット演算
 * @docs docs/math/bit.md
 */
//line 3 "/home/seekworser/.cpp_lib/competitive_library/competitive/std/io.hpp"
// overload operators (prototypes)
template <class T, class U> inline istream& operator>>(istream& is, pair<T, U>& p);
template <class T> inline istream& operator>>(istream& is, vector<T>& v);
template <class T, class U> inline ostream& operator<<(ostream& os, const pair<T, U>& p);
template <class T> inline ostream& operator<<(ostream& os, const vector<T>& v);
template <typename T, typename S> ostream &operator<<(ostream &os, const map<T, S> &mp);
template <typename T> ostream &operator<<(ostream &os, const set<T> &st);
template <typename T> ostream &operator<<(ostream &os, const multiset<T> &st);
template <typename T> ostream &operator<<(ostream &os, const unordered_set<T> &st);
template <typename T> ostream &operator<<(ostream &os, queue<T> q);
template <typename T> ostream &operator<<(ostream &os, deque<T> q);
template <typename T> ostream &operator<<(ostream &os, stack<T> st);
template <class T, class Container, class Compare> ostream &operator<<(ostream &os, priority_queue<T, Container, Compare> pq);

// overload operators
template <class T, class U> inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template <class T> inline istream& operator>>(istream& is, vector<T>& v) { repe(x, v) is >> x; return is; }
template <class T, class U> inline ostream& operator<<(ostream& os, const pair<T, U>& p) { os << p.first << " " << p.second; return os; }
template <class T> inline ostream& operator<<(ostream& os, const vector<T>& v) { rep(i, sz(v)) { os << v.at(i); if (i != sz(v) - 1) os << " "; } return os; }
template <typename T, typename S> ostream &operator<<(ostream &os, const map<T, S> &mp) { for (auto &[key, val] : mp) { os << key << ":" << val << " "; } return os; }
template <typename T> ostream &operator<<(ostream &os, const set<T> &st) { auto itr = st.begin(); for (int i = 0; i < (int)st.size(); i++) { os << *itr << (i + 1 != (int)st.size() ? " " : ""); itr++; } return os; }
template <typename T> ostream &operator<<(ostream &os, const multiset<T> &st) { auto itr = st.begin(); for (int i = 0; i < (int)st.size(); i++) { os << *itr << (i + 1 != (int)st.size() ? " " : ""); itr++; } return os; }
template <typename T> ostream &operator<<(ostream &os, const unordered_set<T> &st) { ll cnt = 0; for (auto &e : st) { os << e << (++cnt != (int)st.size() ? " " : ""); } return os; }
template <typename T> ostream &operator<<(ostream &os, queue<T> q) { while (q.size()) { os << q.front() << " "; q.pop(); } return os; }
template <typename T> ostream &operator<<(ostream &os, deque<T> q) { while (q.size()) { os << q.front(); q.pop_front(); if (q.size()) os << " "; } return os; }
template <typename T> ostream &operator<<(ostream &os, stack<T> st) { while (st.size()) { os << st.top() << " "; st.pop(); } return os; }
template <class T, class Container, class Compare> ostream &operator<<(ostream &os, priority_queue<T, Container, Compare> pq) { while (pq.size()) { os << pq.top() << " "; pq.pop(); } return os; }

template <typename T> int print_sep_end(string sep, string end, const T& val) { (void)sep; cout << val << end; return 0; };
template <typename T1, typename... T2> int print_sep_end(string sep, string end, const T1 &val, const T2 &...remain) {
    cout << val << sep;
    print_sep_end(sep, end, remain...);
    return 0;
};
template <typename... T> int print(const T &...args) { print_sep_end(" ", "\n", args...); return 0; };
template <typename... T> void flush() { cout << flush; };
template <typename... T> int print_and_flush(const T &...args) { print(args...); flush(); return 0; };
#define debug(...) debug_func(0, #__VA_ARGS__, __VA_ARGS__) // debug print
template <typename T> void input(T &a) { cin >> a; };
template <typename T1, typename... T2> void input(T1&a, T2 &...b) { cin >> a; input(b...); };
#ifdef LOCAL_TEST
template <typename T> void debug_func(int i, const T name) { (void)i; (void)name; cerr << endl; }
template <typename T1, typename T2, typename... T3> void debug_func(int i, const T1 &name, const T2 &a, const T3 &...b) {
    int scope = 0;
    for ( ; (scope != 0 || name[i] != ',') && name[i] != '\0'; i++ ) {
        cerr << name[i];
        if (name[i] == '(' || name[i] == '{') scope++;
        if (name[i] == ')' || name[i] == '}') scope--;
    }
    cerr << ":" << a << " ";
    debug_func(i + 1, name, b...);
}
template <typename T1, typename T2, typename... T3> void debug_func(int i, const T1 &name, T2 &a, T3 &...b) {
    int scope = 0;
    for ( ; (scope != 0 || name[i] != ',') && name[i] != '\0'; i++ ) {
        cerr << name[i];
        if (name[i] == '(' || name[i] == '{') scope++;
        if (name[i] == ')' || name[i] == '}') scope--;
    }
    cerr << ":" << a << " ";
    debug_func(i + 1, name, b...);
}
#endif
#ifndef LOCAL_TEST
template <typename... T>
void debug_func(T &...) {}
template <typename... T>
void debug_func(const T &...) {}
#endif
/**
 * @brief io.hpp
 * @docs docs/std/io.md
 */
//line 32 "answer.cpp"
#endif

详细

Test #1:

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

input:

2
3
1 1 1
1 1 1
1 1 1
5
8 5 2 8 3
5 6 9 7 3
7 8 9 1 4
8 9 4 5 5
2 8 6 9 3

output:

1
5

result:

ok 2 number(s): "1 5"

Test #2:

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

input:

1
1
444739567

output:

444739567

result:

ok 1 number(s): "444739567"

Test #3:

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

input:

32
5
177252602 814271963 432801178 401470194 888319541
320323627 34071000 116035631 87392694 926990496
423510770 515133425 777623990 140441392 853473387
976288681 925949889 930584554 939702106 761328886
840677679 912446055 378955738 997133668 334407172
3
633852912 89450314 828384045
327867173 732812...

output:

494991369
661643843
47298040
226890388
50684672
954430705
139405747
530064327
199272913
211829225
333898451
217089022
35580250
251879512
230866303
60323753
215243437
114032585
351186098
361741480
49710371
75128942
269414925
755829169
133537759
108744675
691515792
193230413
469380143
156043031
227141...

result:

ok 32 numbers

Test #4:

score: 0
Accepted
time: 116ms
memory: 5188kb

input:

8
43
989947367 331735816 349317917 700365413 17189378 612200624 154937171 346672308 376889862 872720288 638190204 958149220 927650750 20485214 849210362 571686855 199779982 519793060 418047026 334316854 663198223 597430022 731510780 865566541 833977935 78042080 441551911 425178608 47859112 268111727...

output:

4223743
95074
47405673
99139301
77400585
170038233
140844122
53719

result:

ok 8 numbers

Test #5:

score: 0
Accepted
time: 229ms
memory: 3736kb

input:

500000
1
965486862
1
216509339
1
482967094
1
753780237
1
701167068
1
946858197
1
92693705
1
41962139
1
260677329
1
616111269
1
487286424
1
717653655
1
871004981
1
393162462
1
100430388
1
740632872
1
835913896
1
610746520
1
298859058
1
950834347
1
314912345
1
869919263
1
12617927
1
759608365
1
686606...

output:

965486862
216509339
482967094
753780237
701167068
946858197
92693705
41962139
260677329
616111269
487286424
717653655
871004981
393162462
100430388
740632872
835913896
610746520
298859058
950834347
314912345
869919263
12617927
759608365
686606085
694042166
703198383
514097106
492535170
681684788
239...

result:

ok 500000 numbers

Test #6:

score: 0
Accepted
time: 135ms
memory: 3564kb

input:

55560
3
493633806 683976517 397047281
10227143 558843035 584286153
220557051 96550579 356192384
3
133291149 782667966 675946232
698472590 618998483 737004700
539126624 205091987 827255113
3
334646943 95863066 247302090
388453188 753491791 459811227
215101157 511216316 59214807
3
965812864 732816430 ...

output:

503825003
618998483
370179030
237650274
261030238
404713637
109378708
122850558
362696567
579428679
152208850
543018323
221113942
203407403
668013330
406259646
517295921
418510489
285649976
297902289
422735958
688213753
362808993
478501743
462150678
344729390
570606284
283348525
557825550
522690094
...

result:

ok 55560 numbers

Test #7:

score: 0
Accepted
time: 136ms
memory: 3596kb

input:

20000
5
191715144 307819948 647339769 872468351 220142014
762671875 336586001 50513205 768621310 730515581
841271229 909218925 79462648 426794914 209648319
250847163 500498427 682183527 40040994 957657573
924048461 670314366 956633884 187180524 1320869
5
318800896 333730442 641040543 122819902 79441...

output:

79462648
261789157
336265025
238367794
183374931
180253071
238854192
315419806
342599404
108204489
267761956
193298726
271154360
231785052
162497139
200671633
115603664
595344479
467752988
84131368
222080540
53991807
253564769
352253093
195658148
224875040
39708507
302710382
319032903
46968864
24230...

result:

ok 20000 numbers

Test #8:

score: 0
Accepted
time: 122ms
memory: 3552kb

input:

10208
7
517976277 574115680 281419819 632483546 184869183 262238366 770188155
94990145 573813914 139809352 604368201 890802309 327920560 53269651
269678147 623707154 16686153 193733690 67672476 531424446 909555554
851796738 984263939 773103233 185539003 780693162 342686813 812274472
235491436 483153...

output:

185539003
78222201
114308521
145547210
509726982
213353860
20659945
57996908
219254076
123498630
85739680
161914328
263958537
126424568
94684933
144921561
7089136
165579720
256544532
120748595
210368961
122128548
107554324
165194363
95803159
158889756
71971738
51629656
196973154
107973038
161137619
...

result:

ok 10208 numbers

Test #9:

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

input:

6176
9
548204560 360664933 563328183 481692591 546820326 877551285 556159099 50123424 653594346
569182180 736041356 145734210 812269303 541214779 757680193 155889520 507721150 814285552
488057270 771638587 216168468 47977162 299901421 970641686 211678330 675512585 924471267
976296094 187000760 90786...

output:

166854971
98717109
144774794
95476403
34227399
174527080
232708249
191208388
108164322
108372863
103790056
77488381
83491055
195309658
63707424
91983249
54350691
40654039
98516471
84399644
46546580
124388006
125258549
70546068
150531424
84160438
31465908
21530512
68210481
52049530
125276670
48408340...

result:

ok 6176 numbers

Test #10:

score: 0
Accepted
time: 120ms
memory: 3628kb

input:

2224
15
385628084 142437445 653089425 177506041 540742227 129951388 42788902 835538162 922570578 986887078 865959271 713948074 96089013 288223221 372901255
898658003 549129013 161628958 541356507 197719459 350620927 485068035 262670295 690782580 208710451 885953833 114803159 689644678 704189654 2455...

output:

107327318
94130491
48643994
36146272
52246772
65191894
38998737
67637986
78352392
140657039
6703841
46005930
54622417
20988817
4202339
53928821
36514606
45175716
24478282
59773264
7994371
41531038
45648152
26744624
63718404
24799422
37849846
60405704
46444689
61294072
75928047
40142899
81606049
3945...

result:

ok 2224 numbers

Test #11:

score: 0
Accepted
time: 119ms
memory: 3556kb

input:

528
31
412377136 643175275 719397952 623370419 539554915 227316428 468092525 859952203 673749099 85957482 11334623 571703077 640519829 749987404 969113492 406625418 456525661 196038403 5486651 121584516 684735350 896993176 567999698 104152829 16785018 283710468 732740435 47986146 34763201 263276650 ...

output:

5089073
3127195
13395887
17595001
5869268
8711481
8509094
5806021
6302191
15838881
10764305
8696715
27361287
4373547
3530917
13302829
7245220
20089478
16040889
7859869
2211863
4838443
25322366
35026791
10562079
10533881
6979605
21305751
10056217
14287294
2166706
12810397
6824927
3904661
21933252
576...

result:

ok 528 numbers

Test #12:

score: 0
Accepted
time: 59ms
memory: 5376kb

input:

1
499
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000000...

output:

1000000000

result:

ok 1 number(s): "1000000000"

Test #13:

score: 0
Accepted
time: 111ms
memory: 5168kb

input:

2
499
754140336 523656574 832911097 889895544 684680198 951798129 661753807 821780498 656793711 995692020 512521382 885458816 514260359 848493411 665387734 844550291 901799958 663293484 898552528 764371565 776512161 878320439 614469617 938268611 654582614 835876273 681533952 547006101 904634625 5109...

output:

108707695
89792425

result:

ok 2 number(s): "108707695 89792425"

Test #14:

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

input:

2
499
774427879 867961112 787223922 666746087 602105440 865163968 708116436 834002400 852575639 848704311 673456993 843399191 902793674 583038217 760517770 842227353 571461361 962448999 859647780 570301225 890464126 839537740 535269960 622834968 695454058 525640595 537574098 788899467 811790114 7204...

output:

138338565
9968710

result:

ok 2 number(s): "138338565 9968710"

Test #15:

score: 0
Accepted
time: 111ms
memory: 5168kb

input:

2
499
597221737 726351704 541244108 883815984 518849811 857218286 857028263 994235408 568279737 574568133 908520015 882251660 642323156 933616795 867630144 526009127 538967401 583676731 604075065 580891909 535285878 581895732 607541352 550959577 916134952 912609963 808987374 897492397 706853738 5009...

output:

193517556
74162804

result:

ok 2 number(s): "193517556 74162804"

Test #16:

score: 0
Accepted
time: 111ms
memory: 5180kb

input:

2
499
796027152 843910855 596607122 798828882 518583484 768991870 810395449 924804188 624961157 744240077 621912140 531676188 695221004 656048786 671763071 615707736 692548849 718721800 963084376 782394674 604870128 880169737 564992841 737492238 534269702 770120023 861712947 801749428 729816991 9415...

output:

50214365
98740005

result:

ok 2 number(s): "50214365 98740005"

Test #17:

score: 0
Accepted
time: 107ms
memory: 5212kb

input:

2
499
911810338 972513706 765425498 743881262 753146052 768565966 559288114 625219600 696485183 658825949 686422563 757390012 874068308 805020920 509688779 649701728 967794425 597113159 599282197 586475953 651752407 841397557 623428731 741965778 918115737 671480204 931637519 762276665 965224190 8420...

output:

111129330
93324655

result:

ok 2 number(s): "111129330 93324655"

Test #18:

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

input:

2
499
589230293 511890930 961005897 646847821 869391672 667634542 894127545 989765026 757586886 937287578 615850170 997375061 746053207 512900967 591576350 695747570 619090213 632330636 774111311 579752528 656920989 703380992 823181747 858552177 786067878 917700551 915884156 658662130 525094999 7654...

output:

73340315
110265349

result:

ok 2 number(s): "73340315 110265349"

Test #19:

score: 0
Accepted
time: 106ms
memory: 5208kb

input:

2
499
526267406 825632409 685875980 822835070 727385095 975331628 984333348 623175855 629451225 690068764 912929763 718981854 610836068 639827773 571466490 860144480 955527947 792915977 825987386 705988597 542046349 705579705 537071949 792789867 789065382 695636961 508888905 792558242 526445495 7677...

output:

37158918
53198670

result:

ok 2 number(s): "37158918 53198670"

Test #20:

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

input:

2
499
789744840 926925733 831735712 919767051 674641552 563940439 977012191 829333995 940870884 719830540 631015831 918305522 700888434 842256602 506962792 617088676 503108584 639025626 533805376 873939322 749273550 942802691 942876835 517564476 688698566 749509717 853722850 658241967 851922313 5557...

output:

68216751
166805498

result:

ok 2 number(s): "68216751 166805498"

Test #21:

score: 0
Accepted
time: 113ms
memory: 5208kb

input:

2
499
753432944 531069938 601587863 945731624 715955884 834372751 719004530 623770383 682135994 695980769 774540651 930228345 942240061 930330327 803473290 891108035 957039952 962032683 823906758 587182165 501061686 795738914 863994268 758664445 686604290 642651448 754274905 537286380 897829394 7465...

output:

83342846
269307653

result:

ok 2 number(s): "83342846 269307653"

Test #22:

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

input:

2
499
784110028 631158456 922023233 657376172 581809040 509703044 519105197 550748964 549091314 551960736 571771745 948624718 900470914 856183443 846661996 788516423 995211162 810941355 713558761 752421604 840569482 927172543 854177989 726694791 598939684 758485261 971754660 975283053 815052623 8916...

output:

88275095
74624445

result:

ok 2 number(s): "88275095 74624445"

Test #23:

score: 0
Accepted
time: 110ms
memory: 5192kb

input:

2
499
668595313 978197730 766959870 631101672 670878147 919976737 997718716 753030631 666705477 782696890 762193372 865848119 769359275 640265900 952705210 814237061 594065535 988341211 818510306 628640988 994174040 586563177 694187529 662217946 683095727 700489311 515214059 519224722 749675061 5301...

output:

73323072
96283661

result:

ok 2 number(s): "73323072 96283661"

Test #24:

score: 0
Accepted
time: 111ms
memory: 5188kb

input:

2
499
800293486 801324685 825346934 644199793 953006693 940056656 831046877 765550960 549219334 963360857 934759994 742861061 737881121 866064967 624130648 603949893 840397501 810925311 704419301 777622308 626467058 935949963 994192899 854154860 836494227 851418963 606975996 642374959 761293591 9966...

output:

29393776
94703893

result:

ok 2 number(s): "29393776 94703893"

Test #25:

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

input:

4
353
650895816 974672006 672032135 819312472 643053616 793445832 674127629 849661045 685143654 777346072 962640370 883630875 664148861 625170512 751715785 528314606 803503395 613184593 928076245 715593096 778954029 671552435 859078893 687123189 933579784 949072830 809293751 927632933 647191139 6531...

output:

136317716
141039568
157805674
106150756

result:

ok 4 number(s): "136317716 141039568 157805674 106150756"

Test #26:

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

input:

4
359
934548289 846131024 590720141 875132190 830452189 722368925 598929858 877994106 528959491 732853265 881148254 689234612 664040319 595013644 624547353 600914540 673573796 822755827 718990226 646448219 626296040 619172722 687744086 969396376 816913551 514088901 653474723 530703860 774152001 9487...

output:

135786834
104579202
85957290
90468786

result:

ok 4 number(s): "135786834 104579202 85957290 90468786"

Test #27:

score: 0
Accepted
time: 116ms
memory: 4444kb

input:

5
333
659208897 556161384 829905683 811476451 869720754 876714771 669807953 825024153 514749610 743366777 598658941 646374970 626476823 614596700 759805211 672304074 576500178 505131748 941072083 778949208 654940521 714656855 591765688 932327939 931152510 945543887 644350894 563956868 587312010 6847...

output:

175019075
61098927
129823465
192937637
129798224

result:

ok 5 number(s): "175019075 61098927 129823465 192937637 129798224"

Test #28:

score: 0
Accepted
time: 106ms
memory: 4784kb

input:

4
431
962381830 846454802 513316704 624509175 626939721 961061822 658904648 877548758 657764303 899216805 925176702 670923975 691969735 812933301 907945188 628084706 634489129 878782541 781456939 801836896 573537102 523505750 743822824 974451817 929453701 808409531 681572133 617660902 774556554 9677...

output:

209533661
109009951
84041663
182339479

result:

ok 4 number(s): "209533661 109009951 84041663 182339479"

Test #29:

score: 0
Accepted
time: 112ms
memory: 4708kb

input:

4
275
668255744 940396696 818646936 836410585 500951740 511176492 667966830 903647796 653432145 978897047 827690313 944997316 732443641 834587388 907923848 903701076 702377704 992449686 675114140 515661712 933551211 688535778 781726177 544112696 808111502 666444466 950019695 751633103 545647497 8859...

output:

35430052
118143342
69458886
52982191

result:

ok 4 number(s): "35430052 118143342 69458886 52982191"

Test #30:

score: 0
Accepted
time: 116ms
memory: 3768kb

input:

594
39
597963079 866667637 921553711 675718119 717301621 622689684 788857591 618935354 558964344 974529707 606104087 859554002 801976103 677127801 691962863 602970599 655122969 781890361 880002393 503500584 872196070 548734047 854669288 535173564 695591998 803519510 549637761 770806809 750729200 767...

output:

81629325
21083654
69178639
35446004
174943229
59937584
8150762
152268603
121037012
12159905
195931959
200243846
88201369
188619000
117783633
210921194
103076368
85222114
57773111
140422516
67259220
96197533
179152488
114936538
36125345
171119532
164517511
171457319
231983896
171898544
114206371
1216...

result:

ok 594 numbers

Test #31:

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

input:

126
63
546234505 593871652 574388073 618538678 929824045 719773865 895524679 714724185 758781585 544690042 942687831 526787443 801440147 580004753 737441728 582984454 903867093 815725808 531680615 999911379 981143166 907375007 718644296 807918825 879691103 637837658 986842463 711693400 913142015 523...

output:

72615712
119771566
61964203
129768638
124862365
89333824
89073143
58626092
67382312
124816192
159171148
89206365
76410710
126200090
127550962
187728310
160232236
102092695
184685164
121161160
84791813
23789829
191183527
54965514
138320905
176836677
3440889
101199939
218042283
213448919
156465359
180...

result:

ok 126 numbers

Extra Test:

score: 0
Extra Test Passed