QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#19578#1173. Knowledge Is...wlzhouzhuan#AC ✓273ms24740kbC++172.2kb2022-02-05 17:33:012022-05-06 06:09:47

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-06 06:09:47]
  • 评测
  • 测评结果:AC
  • 用时:273ms
  • 内存:24740kb
  • [2022-02-05 17:33:01]
  • 提交

answer

// Author: wlzhouzhuan
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pb push_back
#define fir first
#define sec second
#define rep(i, l, r) for (int i = l; i <= r; i++)
#define per(i, l, r) for (int i = l; i >= r; i--)
#define mset(s, t) memset(s, t, sizeof(s))
#define mcpy(s, t) memcpy(s, t, sizeof(t))
#define poly vector<int>
#define SZ(x) (int(x.size()))
template<typename T1, typename T2> void ckmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> void ckmax(T1 &a, T2 b) { if (a < b) a = b; }
int read() {
  int x = 0, f = 0; char ch = getchar();
  while (!isdigit(ch)) f |= ch == '-', ch = getchar();
  while (isdigit(ch)) x = 10 * x + ch - '0', ch = getchar();
  return f ? -x : x;
}
template<typename T> void print(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}
template<typename T> void print(T x, char let) {
  print(x), putchar(let);
}

const int N = 400005;

struct node {
  int l, r, id;
  friend bool operator < (const node &x, const node &y) {
    return x.l < y.l;
  }
} a[N];
int lnk[N], n, m;
int ans[N];

multiset<pii> A, B;

int main() {
  n = read(), m = read();
  rep(i, 1, n) a[i].l = read(), a[i].r = read(), a[i].id = i;
  sort(a + 1, a + n + 1);
  rep(i, 1, n) {
    if (!A.empty() && A.begin()->fir < a[i].l) {
      int t = A.begin()->fir, who = A.begin()->sec;
      A.erase(A.begin());
      B.insert({a[i].r, i});
      lnk[who] = i, lnk[i] = who;
    } else {
      if (B.empty() || B.begin()->fir >= a[i].r) {
        A.insert({a[i].r, i});
      } else {
        int who = B.begin()->sec, who2 = lnk[who];
        lnk[who2] = i, lnk[i] = who2, lnk[who] = 0;
        A.insert(*B.begin());
        B.erase(B.begin());
        B.insert({a[i].r, i});
      }
    }
  }
  while (SZ(B) > m) B.erase(B.begin());
  int tot = 0;
  for (auto &it: B) {
    int aa = it.sec, bb = lnk[aa];
    ans[a[aa].id] = ans[a[bb].id] = ++tot;
  }
  rep(i, 1, n) {
    if (!ans[i] && tot < m) ans[i] = ++tot;
    print(ans[i], " \n"[i == n]);
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 5616kb

input:

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

output:

2 4 1 3 3 1 2

result:

ok answer = 7

Test #2:

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

input:

2 2
1 2
3 4

output:

1 1

result:

ok answer = 2

Test #3:

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

input:

2 1
1 2
2 3

output:

1 0

result:

ok answer = 1

Test #4:

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

input:

1 1
4 26

output:

1

result:

ok answer = 1

Test #5:

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

input:

500 258
1 3
3 5
2 4
3 5
4 5
4 5
1 4
1 2
3 5
2 5
2 5
4 5
4 5
4 5
2 3
1 4
1 4
1 4
4 5
4 5
2 3
4 5
3 5
3 5
1 5
1 4
2 5
1 5
3 5
3 4
4 5
2 3
3 5
3 5
4 5
2 3
1 5
1 5
2 3
2 3
3 4
3 5
3 4
1 3
1 2
1 5
4 5
2 3
2 4
1 3
4 5
4 5
4 5
1 3
3 5
4 5
3 5
1 5
1 2
1 2
3 5
3 5
4 5
3 4
3 5
2 3
2 5
2 4
2 5
3 5
2 3
1 5
4 5
...

output:

55 26 119 25 68 67 120 34 23 121 122 54 61 60 115 123 124 125 56 89 112 87 21 20 126 127 128 129 14 130 74 118 17 16 49 102 131 132 103 104 133 19 134 58 32 135 52 105 136 59 40 39 137 61 37 138 34 139 13 37 33 27 140 141 8 109 142 143 144 30 110 145 146 147 148 69 149 150 151 152 153 154 35 18 15 1...

result:

ok answer = 376

Test #6:

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

input:

500 242
8 9
9 10
2 9
8 10
9 10
6 10
4 8
4 5
2 6
7 10
3 8
1 8
1 6
5 9
7 8
8 10
8 9
8 10
2 9
2 3
6 8
3 10
5 9
1 3
6 8
4 10
9 10
8 9
8 10
1 9
3 9
3 7
2 3
6 10
3 6
6 10
3 4
3 6
9 10
5 7
8 10
6 10
5 6
5 7
7 8
1 3
4 7
9 10
4 9
2 4
8 9
1 3
8 10
3 4
9 10
4 9
5 10
8 9
1 3
1 5
8 10
3 4
8 9
3 9
3 6
3 10
6 7
7 ...

output:

57 170 230 140 172 102 186 18 130 126 182 172 25 3 231 144 54 161 232 110 204 233 7 75 200 77 207 48 143 234 235 53 78 101 33 100 93 121 210 61 132 97 161 59 221 9 55 214 236 83 68 165 142 10 203 237 79 238 164 105 164 6 66 239 34 72 154 240 241 222 118 129 242 125 52 226 201 183 139 0 0 0 229 189 1...

result:

ok answer = 471

Test #7:

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

input:

500 250
50 84
36 68
94 98
13 88
4 62
45 74
80 89
56 87
65 89
44 52
69 78
29 76
61 90
91 99
16 98
69 92
50 77
86 95
73 79
83 90
78 89
1 79
81 86
14 37
91 94
27 48
11 73
94 97
49 80
15 60
26 39
34 76
69 77
22 72
6 78
92 96
46 83
83 94
62 95
77 80
32 72
46 90
41 88
47 91
68 75
14 36
26 43
14 87
49 74
2...

output:

36 209 200 180 195 11 76 57 74 94 2 58 83 212 187 105 243 152 10 86 75 59 51 102 141 154 197 185 12 83 56 21 248 147 110 172 32 135 145 14 148 80 64 92 201 223 31 170 155 118 160 211 176 106 57 224 236 47 219 49 64 165 152 77 239 45 114 157 180 29 108 120 183 215 55 10 90 233 210 144 169 159 69 178 ...

result:

ok answer = 500

Test #8:

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

input:

500 250
614 964
380 709
272 969
626 788
156 927
270 842
448 984
184 224
602 953
249 887
665 904
212 300
715 787
557 948
906 977
117 824
504 567
848 884
817 824
462 930
768 816
890 940
193 784
653 897
973 974
21 64
515 700
361 595
670 1000
854 943
530 739
816 828
918 979
270 354
288 369
56 697
622 92...

output:

174 130 184 240 118 34 217 194 157 68 88 14 206 148 200 51 123 66 20 119 13 131 48 82 193 169 74 4 243 137 200 24 204 188 225 100 113 223 95 26 117 182 129 161 139 46 97 167 247 67 94 135 121 46 191 43 25 101 69 113 151 177 118 120 7 163 101 90 85 73 35 132 244 96 219 173 92 69 110 171 6 107 22 184 ...

result:

ok answer = 500

Test #9:

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

input:

500 250
7369 7544
7194 8983
8758 9759
1077 5486
8604 9375
9468 9854
9259 9276
6147 7585
2527 2818
1034 2634
1382 3694
1863 8040
5952 6207
685 3506
3618 9242
1204 3382
569 8063
6515 6861
6025 7856
2053 7457
961 3813
87 9321
2787 9389
4754 8473
6781 7817
7113 9489
6831 9207
5210 9788
7003 8417
9361 99...

output:

102 72 190 119 125 205 111 227 75 199 92 48 234 131 107 189 118 83 195 15 113 221 127 33 169 144 101 196 29 229 89 177 68 187 4 149 30 98 156 171 71 209 101 12 206 181 64 5 129 85 243 150 161 176 81 200 148 189 190 135 20 27 138 14 49 80 241 102 136 193 104 29 134 93 132 38 63 51 201 34 23 166 106 2...

result:

ok answer = 500

Test #10:

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

input:

500 250
94664 97792
42412 79567
78199 93246
1309 6050
21787 62661
32852 47312
72165 96025
22335 87724
98737 98949
32333 45109
98197 98696
66004 84303
64971 93765
48220 78217
75132 77121
3250 99214
76296 83179
18937 19783
24224 29268
76617 77302
64571 88215
56891 67172
32945 97861
75 35393
74113 9254...

output:

207 8 141 215 26 122 180 83 226 173 219 49 149 241 198 231 36 80 225 239 92 115 211 136 134 206 16 235 210 2 191 148 237 235 227 96 49 125 93 35 118 88 86 23 229 31 159 55 119 215 185 153 57 107 43 111 228 132 32 7 50 203 194 42 21 209 200 241 204 82 214 9 52 161 102 151 169 250 144 106 28 164 90 87...

result:

ok answer = 500

Test #11:

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

input:

500 250
249258 633953
692064 923461
236526 494453
63236 665418
813697 915066
231324 853677
850867 946695
354813 439441
555846 920488
978644 998640
280905 357712
300337 869138
111591 375301
754196 825433
681966 906746
566646 913535
958025 996696
122927 989918
162477 948024
464228 474279
735561 874801...

output:

42 125 45 158 115 197 154 41 122 247 70 48 170 19 99 112 237 226 157 151 53 239 241 54 177 178 107 150 234 247 213 116 3 189 181 211 175 56 11 124 203 187 11 186 3 35 88 178 209 233 24 2 24 66 120 186 203 31 46 185 231 110 26 104 94 114 248 166 135 18 136 140 83 55 23 162 173 242 54 89 36 1 17 67 44...

result:

ok answer = 500

Test #12:

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

input:

500 250
6592945 8873042
9610368 9920200
3224618 6472104
7312354 9075859
366928 6614625
7107690 8990826
4712035 4850963
8634845 9127832
7054047 9358572
9187658 9589004
6621468 7586829
7375455 9328669
2076424 5016969
8848028 9107864
6625184 7368290
801465 9195989
3228163 3972918
3386844 9342995
366556...

output:

69 225 111 84 34 78 190 96 120 147 162 117 113 92 40 172 175 118 204 165 91 29 133 200 63 214 148 178 127 136 105 11 238 94 135 20 125 55 70 67 12 221 192 10 233 133 71 162 123 146 180 166 121 4 46 47 212 222 197 77 199 142 166 190 18 63 248 209 8 47 176 86 161 45 224 163 115 87 54 38 98 242 205 48 ...

result:

ok answer = 500

Test #13:

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

input:

500 250
80571694 85803063
51768736 93848632
66413497 76615996
83050382 99992350
8073944 91324998
18047715 58689728
8708611 51201572
29489394 73271018
24239602 65348190
64220050 71579063
50414980 65877100
86190696 92867069
34515283 94334986
8551872 68258618
18296336 36436754
94799273 95174013
8666001...

output:

52 127 219 250 181 45 124 87 234 36 154 113 134 103 12 144 132 197 69 151 185 180 44 173 170 205 17 77 240 148 104 23 169 126 175 61 26 149 139 227 214 48 38 199 11 95 224 38 155 33 135 177 101 16 125 179 192 160 49 62 36 239 94 132 15 245 186 5 39 18 232 41 8 218 230 237 163 33 99 89 138 177 124 21...

result:

ok answer = 500

Test #14:

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

input:

500 250
966174904 986708402
946554500 952001265
914838165 993300555
89795526 975540133
235762788 364735276
340662053 547524158
330027012 366955963
633114013 756706517
868314624 992777729
843328851 965147665
943958099 956095329
243336632 710281553
576757478 948905845
778782824 978759308
370097409 470...

output:

214 154 228 247 191 94 228 107 224 173 160 182 149 200 125 231 226 43 134 167 98 125 89 78 88 1 202 175 176 27 6 83 19 45 161 233 85 225 13 180 194 202 144 84 62 116 138 26 33 59 74 19 247 39 109 23 71 8 5 46 81 216 170 226 63 189 118 86 211 139 192 217 36 174 151 113 219 216 237 212 96 82 80 232 15...

result:

ok answer = 500

Test #15:

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

input:

500 67
1 2
1 2
2 3
1 2
2 3
1 3
1 3
2 3
2 3
1 2
1 3
2 3
1 2
1 2
2 3
2 3
2 3
1 3
2 3
1 2
1 3
2 3
2 3
2 3
2 3
1 2
2 3
2 3
1 3
2 3
1 3
2 3
1 2
1 2
1 2
2 3
1 2
2 3
2 3
2 3
1 2
2 3
1 3
2 3
1 2
1 2
2 3
1 2
1 3
1 2
2 3
2 3
1 3
1 3
1 2
1 2
1 2
1 2
2 3
2 3
1 2
2 3
1 2
1 3
1 3
2 3
1 3
1 3
2 3
1 3
1 3
2 3
1 3
1...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok answer = 67

Test #16:

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

input:

500 379
2 5
2 4
4 5
4 5
4 5
1 4
2 5
4 5
4 5
4 5
1 5
4 5
3 5
3 5
3 5
1 3
1 5
3 5
1 2
4 5
4 5
4 5
3 4
4 5
4 5
4 5
3 5
3 5
1 3
2 4
1 2
4 5
2 3
1 5
2 5
2 5
1 3
1 4
4 5
1 2
3 5
4 5
1 3
1 5
1 5
3 5
4 5
3 4
4 5
4 5
3 5
3 4
2 4
4 5
1 4
1 3
1 4
4 5
1 4
4 5
1 4
4 5
4 5
4 5
2 3
1 2
3 4
1 3
3 4
2 5
1 3
3 4
1 5
...

output:

105 106 69 68 63 107 108 60 58 57 109 56 2 3 4 54 110 5 30 84 79 77 111 76 75 74 112 113 55 114 13 47 104 115 116 117 57 118 51 32 23 36 51 119 120 31 42 121 45 44 26 122 123 124 125 52 126 127 128 129 130 131 132 133 95 14 134 59 135 136 61 137 138 94 139 140 141 142 93 143 92 21 144 145 90 146 147...

result:

ok answer = 483

Test #17:

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

input:

500 273
1 9
7 10
1 2
2 9
5 6
9 10
8 10
5 6
2 3
3 10
4 8
4 7
9 10
8 9
1 9
1 4
3 5
9 10
9 10
1 6
2 10
7 9
8 9
9 10
5 8
7 10
4 8
5 6
8 9
1 2
1 5
6 8
7 10
9 10
3 7
7 9
3 8
1 9
2 9
3 6
5 10
4 5
5 9
3 9
5 8
1 8
5 8
7 10
7 8
9 10
1 8
7 9
5 9
7 9
7 10
9 10
1 8
2 4
7 8
1 8
3 6
4 7
6 8
7 10
2 7
9 10
2 3
6 8
1...

output:

222 113 93 223 130 192 137 122 81 78 180 144 191 51 224 13 22 190 189 40 225 30 55 188 188 114 179 46 52 94 23 205 115 187 57 33 176 226 227 116 89 104 228 229 192 163 191 116 216 186 162 29 230 35 119 185 159 14 218 161 33 142 201 120 52 184 97 200 73 110 90 76 21 183 103 126 29 71 147 154 91 36 10...

result:

ok answer = 494

Test #18:

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

input:

500 250
47 82
75 84
56 61
27 57
32 48
28 85
15 38
36 39
56 65
88 94
87 97
64 79
15 51
50 93
83 100
74 77
59 74
66 99
57 78
51 90
47 76
64 68
89 97
15 71
38 54
57 83
26 91
90 94
98 100
70 73
40 75
52 82
67 100
14 85
57 62
47 53
40 63
79 97
3 33
16 61
4 94
94 99
68 80
23 30
41 81
54 81
51 52
36 45
54 ...

output:

27 51 92 37 28 55 63 224 226 146 185 9 177 125 230 246 238 216 2 100 40 54 187 39 127 36 107 147 244 206 178 28 226 95 159 15 200 179 114 46 189 220 17 175 20 21 21 108 66 60 212 196 64 16 72 53 148 82 54 127 84 106 188 110 186 6 152 240 142 101 41 22 60 235 178 242 113 58 163 49 105 85 8 164 145 13...

result:

ok answer = 500

Test #19:

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

input:

500 250
151 592
747 974
832 938
56 960
567 882
851 900
338 901
168 265
916 964
581 880
177 284
456 921
298 540
378 651
190 785
908 992
180 371
271 823
245 983
328 603
211 425
561 996
61 134
820 934
934 975
595 945
896 982
245 443
208 487
567 945
999 1000
483 748
882 887
383 459
607 910
57 797
12 771...

output:

153 193 147 226 70 96 97 167 180 69 245 125 223 122 202 229 197 22 212 108 26 234 71 141 198 153 210 134 126 152 250 214 76 49 108 39 36 27 47 131 173 244 209 140 48 102 150 57 176 217 189 51 114 74 66 171 44 132 161 86 62 89 94 249 145 56 112 67 243 139 29 59 159 139 125 225 169 190 63 85 184 135 7...

result:

ok answer = 500

Test #20:

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

input:

500 250
8878 9054
7943 8545
9886 9945
6698 8053
3466 6453
8106 8870
7114 9642
4807 4824
2334 4079
2778 3817
5111 7104
1252 4542
3555 6851
3663 5645
5567 7655
324 2086
4056 8603
1406 7470
9064 9448
1484 5836
7466 7945
2607 3711
5253 6112
3192 4008
9549 9852
9198 9709
4169 8558
2268 7806
5575 6209
826...

output:

103 51 236 12 213 79 181 234 78 192 133 246 101 1 221 171 53 147 151 141 5 122 139 190 218 195 52 148 8 61 45 179 151 129 120 42 172 191 73 77 119 226 67 131 245 133 39 124 48 117 99 56 229 238 5 19 137 64 124 134 96 204 135 167 246 88 197 74 67 209 25 28 111 62 44 127 24 241 183 21 216 48 208 27 15...

result:

ok answer = 500

Test #21:

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

input:

500 251
46165 49590
70151 85269
27899 40324
62135 64549
79159 94410
75003 79189
50178 81874
56192 88209
21577 95025
84261 96039
18414 90970
81196 83290
83331 83488
14574 39965
4268 32434
88164 89600
12144 29112
870 72365
9975 51580
92179 98369
28511 57700
33237 75390
24902 28700
94544 95300
65682 97...

output:

10 48 8 177 162 5 20 76 171 179 108 27 29 117 141 90 236 131 85 214 36 208 43 172 204 66 83 178 243 74 44 190 174 192 60 239 182 4 5 83 231 70 147 149 195 47 118 47 168 165 166 80 113 195 168 36 232 60 59 12 216 200 176 179 134 130 55 2 104 151 242 89 163 177 23 198 210 88 146 220 38 13 44 152 246 1...

result:

ok answer = 500

Test #22:

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

input:

500 250
997100 999305
50160 723310
530874 700434
482814 725372
898138 942005
227563 606578
465297 983061
288595 865469
971584 983736
84196 662089
716660 851207
874207 995804
742642 760966
412491 418432
721831 897885
453604 941851
404413 589262
363242 694198
71736 189776
340057 706243
591745 899767
9...

output:

248 200 159 96 147 58 219 62 221 19 43 241 208 40 85 145 20 150 56 121 87 203 103 224 165 187 203 2 195 126 151 223 63 185 163 187 208 167 116 53 133 36 73 150 32 114 144 180 196 22 193 171 169 144 97 127 199 59 32 50 17 231 93 119 217 228 236 71 218 5 71 186 140 246 220 58 100 194 204 225 3 139 55 ...

result:

ok answer = 500

Test #23:

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

input:

500 250
816808 8979893
577273 5159166
6890110 9974354
7539249 9013575
7780990 9685125
284302 8308896
2859745 8347237
5896988 9556377
4465806 5463028
8279297 8819929
1361353 5720171
2467636 8115256
5879674 7044297
661648 5198202
4725290 5204346
2612798 8161805
9812485 9996590
2285372 4614496
1962475 ...

output:

176 80 242 85 173 29 13 153 121 66 199 246 122 28 166 240 248 24 32 67 39 169 105 43 183 33 53 131 142 158 54 92 32 224 198 98 66 154 20 249 45 57 102 200 135 94 18 191 180 50 60 222 143 217 232 162 14 166 127 250 192 143 128 87 225 160 130 109 237 11 150 188 209 88 75 159 70 157 5 204 163 162 100 2...

result:

ok answer = 500

Test #24:

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

input:

500 250
81661382 94717306
89850268 94839225
72615579 73753927
19190949 39608724
129611 33966748
36897319 96344937
77381982 94746565
49637131 94881993
71774738 87773217
5955861 68864001
55863683 69339123
25998069 29895468
85528105 96959461
12833512 31610705
4726009 31932075
18119656 87239085
31722731...

output:

156 162 109 9 73 180 157 163 76 193 26 179 190 176 14 218 176 18 196 244 211 111 232 47 219 168 250 12 191 237 149 60 242 146 133 198 155 166 243 33 215 19 187 236 168 67 158 128 20 144 25 59 117 197 89 56 60 2 52 53 224 104 51 113 101 72 233 122 30 216 214 161 119 182 225 135 197 174 183 172 99 148...

result:

ok answer = 500

Test #25:

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

input:

500 250
159147753 849387872
678679305 958626578
736410066 762171088
51820203 846735349
483826312 744440062
76859389 682174032
127183476 195547079
339099076 948562984
46616987 234754210
871306758 893541852
261351936 390635591
441516403 995769500
522385081 715755202
729932064 859205804
998688267 99968...

output:

103 159 135 92 110 145 185 144 107 81 105 235 42 53 247 31 27 61 170 60 104 242 188 184 70 228 174 200 231 226 211 207 18 67 191 123 75 207 102 245 37 127 49 61 12 19 94 128 216 4 11 109 137 19 181 201 64 62 21 45 93 131 22 224 67 159 178 236 16 190 145 241 164 237 158 171 238 83 103 169 180 219 155...

result:

ok answer = 500

Test #26:

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

input:

500 236
1 3
1 3
1 2
2 3
2 3
1 3
1 3
2 3
2 3
1 3
2 3
1 2
1 2
2 3
2 3
1 2
1 2
2 3
2 3
2 3
2 3
1 3
2 3
1 2
2 3
1 2
1 2
1 3
1 3
2 3
2 3
1 3
2 3
2 3
2 3
2 3
1 2
1 2
1 3
2 3
2 3
2 3
1 2
1 3
1 2
1 2
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
1 3
2 3
1 2
2 3
1 3
1 2
1 3
1 2
2 3
2 3
2 3
1 3
2 3
2 3
1 2
2 3
2 3
2 3
2 3
...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 236

Test #27:

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

input:

500 450
1 5
4 5
4 5
3 5
2 5
3 4
4 5
4 5
1 3
1 4
4 5
3 4
3 4
3 4
3 4
2 3
4 5
4 5
1 5
3 4
2 3
3 4
1 3
2 5
2 4
4 5
1 3
1 2
2 4
3 5
4 5
2 5
4 5
4 5
2 3
1 5
1 4
2 5
2 3
4 5
2 4
1 3
2 4
1 5
4 5
3 5
3 4
4 5
1 3
4 5
4 5
3 5
2 3
4 5
3 4
2 4
4 5
1 4
2 3
1 3
3 4
1 4
2 4
4 5
2 3
1 5
4 5
3 4
1 2
2 4
2 4
4 5
1 3
...

output:

106 86 87 7 107 108 88 89 56 109 90 110 111 112 113 85 91 92 114 115 87 116 59 117 118 93 62 29 119 13 94 120 95 96 77 121 122 123 76 97 124 63 125 126 98 127 128 99 57 85 101 129 82 102 130 131 103 132 80 60 133 134 135 104 70 136 105 137 30 138 139 140 58 141 96 142 64 143 144 145 146 147 23 148 1...

result:

ok answer = 500

Test #28:

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

input:

500 321
6 10
3 6
4 6
5 10
5 7
5 10
3 7
3 8
3 8
4 8
7 8
6 8
3 5
5 9
8 9
4 7
4 9
3 9
9 10
1 8
3 9
5 10
8 9
6 8
4 9
8 10
9 10
2 4
1 10
4 5
5 8
1 7
7 8
7 9
8 9
6 9
4 8
8 9
5 9
1 9
9 10
7 8
1 10
5 9
7 10
7 8
5 6
4 7
9 10
5 8
4 8
3 4
7 9
5 9
2 8
5 9
2 3
3 10
9 10
9 10
6 8
9 10
7 10
1 5
5 10
3 9
2 5
4 6
5 ...

output:

92 104 18 78 133 82 40 174 169 181 204 196 115 205 46 128 206 207 194 153 208 86 33 197 209 122 181 73 210 93 185 33 211 19 56 2 176 55 212 213 191 214 215 216 106 217 113 41 201 193 175 147 13 218 158 219 64 220 153 193 199 178 115 95 70 221 8 144 56 190 133 143 187 151 222 77 12 161 50 167 223 36 ...

result:

ok answer = 500

Test #29:

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

input:

500 282
8 65
78 90
26 99
97 99
94 95
1 56
62 73
41 87
46 51
70 78
81 99
15 52
98 100
39 54
31 53
20 34
9 77
75 84
2 29
4 79
92 96
6 34
23 28
4 7
11 65
3 90
63 69
48 72
82 95
41 93
47 53
65 92
46 76
39 87
25 60
87 97
18 53
10 18
68 100
31 69
38 74
15 57
40 54
16 33
46 68
77 78
42 88
45 72
14 47
2 10
...

output:

32 100 209 227 163 29 186 67 194 247 220 18 246 6 124 188 83 44 65 91 174 172 134 120 243 132 159 64 159 135 37 122 202 66 52 183 218 208 237 112 130 30 44 42 168 1 77 92 118 55 67 28 122 220 25 248 165 63 146 203 31 139 186 214 13 226 86 128 113 238 210 180 18 236 40 106 19 88 104 142 101 157 166 2...

result:

ok answer = 500

Test #30:

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

input:

500 300
510 553
741 866
603 700
36 128
503 944
356 533
43 466
917 960
375 678
38 84
603 748
900 954
951 972
25 548
965 980
204 928
541 594
362 453
904 939
4 547
322 583
870 911
359 470
397 896
772 953
95 483
527 853
631 748
886 955
178 468
127 202
249 912
869 887
154 386
688 948
847 853
783 908
881 ...

output:

162 76 106 190 154 115 234 177 159 227 248 167 197 142 206 129 204 165 146 39 54 109 67 93 165 192 59 216 169 144 129 110 88 93 159 60 105 158 117 226 90 184 176 166 11 8 201 24 121 220 73 181 152 97 141 246 132 80 249 136 23 44 14 42 31 77 115 100 41 141 117 61 148 96 111 138 199 194 70 66 98 108 1...

result:

ok answer = 500

Test #31:

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

input:

500 324
9666 9764
5 7711
5764 6747
2737 5398
4206 7020
351 4635
4073 5399
3611 9328
1945 8418
7455 9537
4107 8882
1584 6200
3868 4517
9853 9898
2506 4277
4014 7539
3274 7131
4991 9996
9163 9430
3958 6082
4305 9426
1905 6005
545 3515
7652 9689
1027 1438
1658 2555
3483 3669
3645 9546
3339 6780
368 978...

output:

192 10 58 37 33 127 8 130 161 154 70 135 219 220 144 215 208 247 146 218 144 212 235 183 180 65 42 155 82 222 51 46 51 145 74 223 47 24 141 64 27 11 62 241 88 46 9 194 113 30 176 171 14 196 168 87 98 57 177 166 67 18 114 67 38 152 135 81 117 164 180 221 92 126 45 72 206 221 172 20 93 33 232 119 129 ...

result:

ok answer = 500

Test #32:

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

input:

500 470
48935 84694
99749 99923
67360 75782
2621 28649
97920 99396
43999 62734
31792 93093
27130 95814
86217 97217
96404 98372
24819 99995
19043 61210
48522 67115
9948 85463
68373 86119
41827 44815
3885 70986
61638 63427
71822 81341
44961 51570
35696 82618
54669 54869
24868 37898
67579 83939
10309 5...

output:

48 247 237 136 235 129 133 166 191 212 250 243 138 209 58 22 123 242 18 32 27 240 226 41 54 180 236 221 75 66 99 2 84 58 177 166 114 102 172 106 85 36 248 8 69 153 163 247 105 16 215 7 160 62 115 109 178 89 74 100 207 179 164 59 45 167 66 19 80 31 55 238 38 64 2 31 143 3 175 136 100 36 177 239 163 7...

result:

ok answer = 500

Test #33:

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

input:

500 365
45762 693754
534202 559740
475894 692574
187566 781410
918494 925845
248194 930644
769148 995474
849975 944570
274210 388210
809281 978707
881685 943753
593867 809666
941967 942436
917009 921677
623403 694445
14648 44821
973042 987690
275841 883296
587146 857139
601250 981414
602336 913679
2...

output:

12 217 107 184 127 132 238 160 161 206 158 8 155 122 206 190 218 74 50 210 114 20 192 6 72 180 14 89 70 106 40 22 124 113 69 67 172 119 150 162 211 175 13 25 92 134 106 159 130 74 23 29 245 147 125 85 95 75 32 62 194 165 243 222 153 45 141 250 197 77 237 214 163 188 83 57 240 96 45 41 35 10 244 84 2...

result:

ok answer = 500

Test #34:

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

input:

500 435
8942882 9009137
2960339 4249642
6469497 9548984
1335505 1977271
8656424 8708138
8855830 9941526
120428 6845949
4297409 6050960
4211118 5999754
5292184 6371662
1257452 1532520
4172544 8586887
420009 9449705
9256685 9947310
6863833 8506653
5057204 7529960
4548338 8379192
3876868 8854349
331804...

output:

97 161 167 218 82 230 35 189 74 81 106 68 149 232 58 99 42 92 18 133 165 67 84 126 195 129 2 37 148 177 80 170 226 49 206 196 32 79 147 25 247 148 5 24 62 7 42 68 13 20 247 101 154 113 192 116 190 231 204 34 189 39 21 146 90 58 63 88 92 150 38 203 21 36 155 215 104 130 109 83 161 109 49 3 137 205 35...

result:

ok answer = 500

Test #35:

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

input:

500 331
9630011 57589654
22572747 68645689
38328399 81622066
94933642 97311408
58050148 62455346
37318915 88117879
68029610 74080275
87750454 92553676
46660595 74511474
32473872 49596859
63350036 89789394
75407776 80074289
80027461 88388093
61349773 99476335
69370190 83482845
70440345 73157341
67787...

output:

132 164 18 194 244 75 171 125 167 225 94 8 76 238 35 210 121 199 57 129 246 160 21 73 75 129 200 61 44 5 112 197 45 80 141 61 105 151 9 58 99 122 11 104 219 134 223 147 25 63 38 177 29 68 181 189 30 241 180 196 15 73 120 12 41 136 44 228 43 153 239 136 84 189 110 139 140 177 127 3 27 33 216 147 224 ...

result:

ok answer = 500

Test #36:

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

input:

500 477
343566419 927547482
827556406 860923139
786265094 867699424
768873550 983848460
587486802 980298997
991532621 996136199
878431940 941182908
689945290 738517801
517657626 628309437
983790110 985304593
272482247 338862765
740802646 818566102
938911500 949187177
185204729 426499829
724561978 76...

output:

127 56 61 205 199 236 150 70 192 208 179 19 156 195 250 30 7 47 187 37 134 216 203 51 22 143 193 242 68 160 26 197 187 89 207 53 25 120 4 38 1 45 147 64 141 197 228 235 78 206 169 130 45 60 44 242 170 48 33 128 204 185 110 86 59 210 119 196 140 217 238 240 244 181 143 18 224 218 142 38 86 217 218 12...

result:

ok answer = 500

Test #37:

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

input:

500 500
2 3
1 2
2 3
2 3
1 2
1 2
2 3
1 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
1 2
1 3
1 3
2 3
2 3
2 3
1 2
1 2
2 3
1 2
1 2
1 2
2 3
2 3
2 3
2 3
1 3
1 3
1 3
1 3
1 2
2 3
2 3
2 3
1 2
2 3
2 3
2 3
2 3
2 3
2 3
1 2
1 2
2 3
2 3
2 3
1 2
2 3
1 2
2 3
2 3
1 2
1 2
1 2
1 2
1 2
2 3
1 3
2 3
2 3
1 2
2 3
2 3
2 3
2 3
1 2
...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 500

Test #38:

score: 0
Accepted
time: 79ms
memory: 21364kb

input:

300000 167770
1 5
1 3
1 2
2 3
2 5
2 4
1 2
4 5
4 5
2 5
4 5
4 5
3 4
4 5
3 5
4 5
1 4
2 4
2 5
3 4
4 5
4 5
1 3
4 5
4 5
2 5
4 5
2 3
3 4
3 4
1 3
2 5
2 4
4 5
2 5
3 5
2 5
2 3
4 5
4 5
4 5
3 4
2 4
3 4
4 5
2 5
1 2
2 4
3 4
2 3
1 3
2 5
2 5
2 4
1 3
4 5
3 4
1 3
4 5
3 4
4 5
1 4
2 4
1 3
2 3
1 5
1 2
4 5
4 5
1 4
3 4
2 ...

output:

62462 33129 7182 58472 62463 62464 16471 33656 33658 62465 33660 33662 62466 33664 62467 33666 62468 62469 62470 62471 33667 33669 33124 33670 33671 62472 33673 58469 62473 62474 33141 62475 62476 33645 62477 62478 62479 58486 33635 33636 33638 62480 62481 62482 33640 62483 16472 62484 62485 58444 3...

result:

ok answer = 230231

Test #39:

score: 0
Accepted
time: 96ms
memory: 18408kb

input:

300000 158833
1 7
8 9
6 8
4 5
7 8
6 7
2 9
3 10
7 9
4 8
9 10
5 7
9 10
8 10
2 4
7 8
1 5
6 10
9 10
5 9
3 6
6 7
8 9
4 8
2 9
5 6
2 9
7 9
6 9
5 6
5 7
1 10
5 6
4 6
4 9
4 10
1 7
5 10
7 8
2 4
3 6
5 9
8 10
8 10
7 10
4 8
8 10
6 8
7 10
1 7
9 10
1 7
9 10
3 7
2 9
2 8
9 10
6 7
9 10
2 5
2 7
2 3
5 7
1 7
8 10
4 9
9 1...

output:

85616 36570 127495 17905 133729 45564 133730 133731 30728 113114 103464 94081 103463 88584 62355 133732 28970 66553 103455 8425 24648 97396 36568 113027 133733 2619 133734 30715 14744 2621 42245 133735 79570 105 133736 52571 85647 60128 133737 6945 76861 8455 88583 88582 82820 113416 88581 127447 82...

result:

ok answer = 292561

Test #40:

score: 0
Accepted
time: 141ms
memory: 17332kb

input:

300000 150009
55 66
55 72
76 99
74 95
20 64
60 85
52 62
54 100
62 73
30 62
60 96
99 100
66 76
10 23
4 20
59 76
67 76
54 95
2 93
18 56
98 100
59 64
63 100
16 29
95 97
40 83
84 93
41 84
37 92
34 51
53 100
98 99
80 88
18 34
68 76
20 74
54 55
16 78
38 55
86 89
8 47
18 81
66 75
60 69
22 66
44 89
19 71
4 ...

output:

40288 39388 125991 86608 12712 21576 100325 136582 58055 99360 93938 147589 81237 83240 24526 73555 81251 84766 99555 142893 145459 103671 137233 24913 109509 11043 72382 15703 60938 67039 136533 132837 39389 10798 107451 125794 124099 105131 116735 46285 61621 14684 59078 86628 8518 42062 17845 398...

result:

ok answer = 299930

Test #41:

score: 0
Accepted
time: 169ms
memory: 17696kb

input:

300000 150001
494 988
672 774
243 913
828 988
37 677
885 943
710 899
735 934
920 922
965 966
140 442
673 881
899 974
326 433
1 144
518 752
965 990
177 532
625 672
530 670
899 994
856 986
262 864
146 442
771 873
671 978
813 927
449 894
888 965
785 926
508 798
502 849
521 735
503 886
119 511
840 894
2...

output:

129565 119281 61152 129882 119958 84753 51858 77158 68456 105796 108963 40549 113655 36420 142417 108386 133079 26063 16732 28268 138366 127315 30649 149838 36096 117638 71915 48439 104524 71073 149569 23081 88834 43462 59569 48848 47809 124065 143575 19783 85457 125749 75781 5496 133535 74557 37153...

result:

ok answer = 300000

Test #42:

score: 0
Accepted
time: 170ms
memory: 17356kb

input:

300000 150000
3973 6094
9736 9998
70 8639
5326 8325
3999 7450
3662 6854
4709 4858
9516 9896
9504 9728
1704 4105
4802 6265
5454 9534
9173 9814
1798 4071
2241 3267
6925 9683
2779 4274
2065 9713
6068 8558
1614 8165
1662 4784
7247 9243
8942 9067
8742 9131
4327 8619
4359 4989
6812 8809
5706 7074
2583 708...

output:

21518 149282 51643 14953 37637 40896 128452 132528 112421 105513 20339 93324 122119 102738 54859 107689 95365 110733 26565 15235 77273 69391 56993 61353 29852 98486 40542 53559 24994 40415 102523 44790 141134 84509 39137 115019 15370 10360 72839 33407 54863 25891 45955 39447 81360 26926 137098 21652...

result:

ok answer = 300000

Test #43:

score: 0
Accepted
time: 192ms
memory: 17368kb

input:

300000 150000
12903 16631
31740 87010
65263 66809
76325 96234
6447 96997
93658 98279
37116 45312
40450 92176
39259 44730
68790 89767
37526 84109
33305 42208
63474 88851
92816 93071
32193 50697
34927 62503
48938 97474
32975 63610
1315 17769
30877 52937
60916 91584
14355 34674
63709 64927
6280 33513
5...

output:

32800 34275 2842 102014 109735 124131 35385 67713 148057 50962 18848 109745 45157 74472 139702 25608 114921 139374 73053 57395 63399 12067 8808 119880 70234 122851 141990 41081 134727 16378 93036 11767 81419 143317 11611 56097 116595 21983 102391 79717 68491 30322 31193 78249 3622 5561 50982 57264 1...

result:

ok answer = 300000

Test #44:

score: 0
Accepted
time: 178ms
memory: 17944kb

input:

300000 150000
567775 666457
837755 984411
718168 903846
272041 566674
845286 892912
657558 706979
979998 984740
897850 920288
573988 604802
125953 702072
763586 844301
293648 334208
270686 660835
362992 482276
789500 805601
843735 845131
733248 894850
241109 377437
254656 819746
559713 638355
309262...

output:

70100 125783 55123 75211 48084 12821 126201 66659 40882 50545 20397 38802 22481 20419 2672 20829 49372 48386 8794 126677 84606 15311 44195 26358 42752 91056 75675 82365 112171 83893 129884 89065 148875 48901 87993 101812 5683 29230 23336 39708 88111 149928 130404 58262 41400 19370 55297 4372 64708 7...

result:

ok answer = 300000

Test #45:

score: 0
Accepted
time: 204ms
memory: 17396kb

input:

300000 150000
7170989 7769844
956107 2663875
9166687 9506653
1888701 7639977
3302208 7630940
4857987 7312608
3733996 4738647
3006274 9521928
6370314 7064994
3306420 5033814
2310651 5271171
1032455 6819687
7079130 9908748
3293168 3641704
1367057 7494712
4640369 8126591
3301376 9160271
5655785 6679644...

output:

139605 31136 91243 90178 131646 54614 15913 92656 16961 58629 7244 2999 134586 17648 27765 5665 63531 71440 46301 79045 125701 89893 110769 29183 87531 11276 110080 37206 126960 116970 138598 104815 64687 142112 127640 80529 99152 77041 109488 23084 72753 82537 22232 90614 88675 30441 69801 24893 12...

result:

ok answer = 300000

Test #46:

score: 0
Accepted
time: 191ms
memory: 17664kb

input:

300000 150000
11552304 25238941
57725800 74297686
59777617 68784124
34279072 42026700
59218385 84180847
89474693 95274286
95736555 96601153
35992390 95512251
71239164 91666139
97076370 97098897
40156523 62645281
32000954 57819471
60179257 88102512
5595628 31475314
55261116 84822976
71013050 92071206...

output:

143282 52208 56849 111239 18854 92700 105331 94866 63606 110504 4468 27828 40357 15539 22159 66550 146139 53108 53672 51541 25939 31351 21766 11034 148132 17363 142917 59927 12805 36930 18029 15456 141512 68378 44029 50156 98814 25318 94199 89741 98441 91344 43790 87247 33961 68608 57674 45522 69819...

result:

ok answer = 300000

Test #47:

score: 0
Accepted
time: 228ms
memory: 16876kb

input:

300000 150000
654384400 971241348
70913001 607674248
792436692 958757039
493420264 606937015
872887558 973264081
626376272 682239078
582160167 908877630
658835446 733627713
385361776 871189995
334846500 367802854
124802907 643036263
443283183 775149618
514358696 672677144
480809185 562611368
6290012...

output:

110849 97484 98552 36131 113012 26441 58588 79275 34866 4229 131533 144691 2711 66095 147170 145779 71614 31261 14051 58725 58289 146000 92851 43723 102770 113558 4908 74051 17358 142227 38951 44085 125313 149278 57164 143070 83367 101732 27791 99911 96008 27414 97028 21566 11866 24807 7096 16486 38...

result:

ok answer = 300000

Test #48:

score: 0
Accepted
time: 76ms
memory: 24740kb

input:

300000 259601
2 3
1 2
2 3
1 3
1 3
1 3
2 3
2 3
1 2
1 2
2 3
2 3
1 2
1 3
1 2
1 2
2 3
1 2
2 3
2 3
1 2
2 3
2 3
1 3
1 2
2 3
2 3
2 3
1 2
1 3
2 3
2 3
1 2
1 2
2 3
2 3
2 3
1 3
2 3
1 2
2 3
1 2
1 3
2 3
2 3
2 3
1 2
2 3
2 3
2 3
2 3
1 2
1 2
2 3
1 2
2 3
1 2
2 3
2 3
2 3
2 3
1 2
2 3
1 3
2 3
2 3
2 3
2 3
1 2
2 3
1 2
1 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 259601

Test #49:

score: 0
Accepted
time: 84ms
memory: 21364kb

input:

300000 233601
3 5
3 4
1 3
1 4
2 3
2 5
1 2
3 5
4 5
2 4
4 5
3 4
1 2
1 5
2 4
1 4
2 3
2 3
4 5
4 5
2 5
2 3
2 3
2 5
2 3
2 5
4 5
2 4
2 4
3 4
3 5
3 4
2 4
4 5
3 4
2 4
3 4
3 4
4 5
4 5
1 5
1 3
2 4
3 5
2 4
4 5
1 3
2 5
4 5
3 5
4 5
2 3
3 5
1 5
2 3
1 5
3 5
3 5
3 5
3 5
3 4
4 5
2 5
3 4
2 5
2 3
2 3
2 3
3 5
2 3
1 3
4 ...

output:

62454 62455 37428 62456 53623 62457 9259 62458 24584 62459 24586 62460 9295 62461 62462 62463 53601 53600 24593 24594 62464 53634 53632 62465 53639 62466 24595 62467 62468 62469 62470 62471 62472 24597 62473 62474 62475 62476 24601 24604 62477 36883 62478 62479 62480 24605 36692 62481 24608 62482 24...

result:

ok answer = 296054

Test #50:

score: 0
Accepted
time: 95ms
memory: 18200kb

input:

300000 156917
6 9
5 7
7 9
6 7
4 6
3 8
3 4
1 2
3 9
1 5
1 3
5 9
6 8
6 9
6 10
5 10
8 10
8 10
6 7
9 10
8 9
2 6
7 9
8 10
4 10
9 10
4 8
4 9
3 6
9 10
1 2
4 8
2 6
4 5
7 9
5 7
5 9
4 8
9 10
8 9
5 7
7 8
7 9
7 8
9 10
5 9
2 10
6 8
4 10
8 9
1 7
3 6
6 8
9 10
4 8
2 7
4 10
1 4
6 7
9 10
4 8
8 10
1 5
1 7
3 9
4 8
8 9
3...

output:

12090 94769 22322 100010 922 108248 10776 50658 133688 12906 52591 10244 133330 20378 72396 61985 95208 95199 99988 103061 43241 74973 22330 95197 55768 103048 116612 5645 23202 103002 51748 116613 23101 68347 22319 42809 10249 116614 102998 43250 94763 133689 22318 133690 102987 10239 133691 133369...

result:

ok answer = 290604

Test #51:

score: 0
Accepted
time: 150ms
memory: 16852kb

input:

300000 150061
40 82
23 24
73 94
66 67
66 93
17 75
27 51
54 69
84 92
39 48
14 77
9 21
45 90
44 82
41 63
92 94
63 85
11 47
73 95
86 94
17 92
35 47
45 64
35 67
93 99
65 97
38 74
56 65
23 78
3 54
27 77
79 91
70 72
88 92
17 88
19 37
87 91
99 100
11 61
26 80
73 98
91 93
11 13
89 94
43 98
90 97
70 73
9 30
...

output:

7060 48027 78879 86617 70779 57917 102748 104598 65743 16606 39698 61148 48920 7293 35019 82268 22358 26259 86829 80734 60946 87350 137242 131038 129425 103751 52712 100303 19196 21776 23890 58268 15010 66803 35784 48569 59658 147547 124408 146760 114471 74935 100947 81618 112220 107503 126936 2585 ...

result:

ok answer = 299989

Test #52:

score: 0
Accepted
time: 165ms
memory: 17536kb

input:

300000 149999
556 916
419 756
924 973
632 643
477 933
942 982
3 683
349 514
19 917
706 752
94 104
394 494
21 497
73 880
45 332
629 786
56 174
741 763
433 889
726 914
262 462
623 915
168 842
254 824
103 996
356 766
948 973
429 621
833 998
625 704
990 998
812 851
225 874
808 995
691 809
206 470
438 71...

output:

62752 96383 112325 57337 75353 122547 24727 49288 80762 124760 126607 145412 95695 146420 51837 106400 61826 109177 44820 61469 123083 62065 57566 10388 140649 146524 112455 99877 144461 82143 145372 23850 35882 139502 4216 95919 23343 149995 68888 80516 24711 28988 95041 47672 44145 10750 97215 113...

result:

ok answer = 299998

Test #53:

score: 0
Accepted
time: 217ms
memory: 18032kb

input:

300000 150000
2952 4855
7982 9177
2483 6149
2332 8618
9598 9934
1792 4703
7046 9680
2410 6305
4047 4777
1499 4551
7242 7357
5766 9935
4189 4328
7115 9460
7695 9319
8328 8677
7785 9491
8174 8492
3883 5165
5277 9578
5928 9878
517 8949
2117 2724
5276 8352
6967 7641
1108 6809
6474 7064
4551 9396
6254 89...

output:

127602 64735 121587 29556 138121 74625 107568 18288 122691 34266 66181 138212 122409 87002 75475 32830 89784 22911 54176 97687 130204 72975 12506 15919 149797 48678 55417 81568 47927 94372 27327 93896 142981 20864 96180 88696 61084 32310 107612 21909 95874 32521 77824 137756 1436 36859 48968 29886 1...

result:

ok answer = 299999

Test #54:

score: 0
Accepted
time: 205ms
memory: 17476kb

input:

300000 150000
90462 99554
55705 57142
94440 97633
58596 96591
75226 94006
13368 15518
98383 98654
84117 94919
40069 63073
8004 65091
4385 82911
66462 70822
34454 44857
22507 37602
4845 74109
10526 95149
16021 24471
9617 25356
49732 92684
82188 93045
52592 55281
96908 97689
23937 68454
38080 79677
47...

output:

141457 7683 116480 105518 82264 104945 128638 89976 148966 63174 50891 96307 51816 9580 31059 91983 27164 4661 71837 74530 126940 117131 51668 140545 49922 38509 16736 21845 31315 79440 141166 28077 31811 29514 46518 11462 45204 89046 140016 27973 62594 83777 130591 140613 149736 35656 111663 9335 1...

result:

ok answer = 300000

Test #55:

score: 0
Accepted
time: 193ms
memory: 17236kb

input:

300000 150000
978631 982929
101663 499756
759816 798998
803333 838120
636964 675643
641278 704471
862290 919804
49691 717850
467443 677929
21596 84237
577153 844013
916660 917560
774572 929040
515474 806479
665250 888570
521313 523790
783160 877043
712485 825311
160449 264011
9658 425587
999666 9997...

output:

124206 14956 534 17941 74057 98301 66385 130010 115675 74064 20835 64746 73416 3617 45681 131128 38751 11884 140467 54012 149390 28608 101537 78253 69704 112108 28975 102946 94181 138373 94624 129537 410 49778 140119 30023 25349 129986 29250 60594 35019 144436 80695 86848 97456 136708 22901 24738 33...

result:

ok answer = 300000

Test #56:

score: 0
Accepted
time: 180ms
memory: 17604kb

input:

300000 150000
9913013 9932632
1886090 3278627
15598 6396576
2951139 7310476
2824123 6726030
1142999 9790240
7041910 8793346
959943 9716348
3016613 8956537
2336065 9073451
1035455 9348843
3377319 7740855
4388032 8560696
3406865 6461910
8772807 9823783
1946767 8036961
5505173 8732456
8493741 8609530
8...

output:

137566 41222 45934 3608 116318 119038 39613 110863 49720 57289 77534 145934 26476 11327 123164 121214 36098 29216 96608 58440 114705 126203 133957 100180 102053 136041 145329 132560 68586 63894 119767 1119 123724 57624 17157 123129 126262 131926 123704 84166 18918 136285 89468 136416 142771 80190 72...

result:

ok answer = 300000

Test #57:

score: 0
Accepted
time: 273ms
memory: 17772kb

input:

300000 150000
90841840 91559816
12499783 62748667
51355156 76943316
43673156 88083748
36949927 57673386
48735343 75253124
91558518 98845905
78717659 84832367
93306233 99008252
83511172 93934560
56671183 93733617
48444425 88876535
47109951 75003263
55556049 82291660
40401427 60213599
45748967 5257286...

output:

63520 39721 112227 40750 58935 116067 131077 22831 133376 81659 79978 45499 88391 10551 80891 146956 149172 24678 57497 111932 51618 143003 57302 22585 78968 3023 106181 108072 141055 120912 97373 31487 12173 19002 11644 75399 24596 131896 78687 63101 75304 96003 102478 48510 43957 31519 126164 7338...

result:

ok answer = 300000

Test #58:

score: 0
Accepted
time: 213ms
memory: 16860kb

input:

300000 150000
957293988 962106030
736798587 808067623
782742114 966585014
742593057 923915720
679625821 902064761
877600863 924157346
873528366 936110266
677729400 918693297
577428362 992519997
350536068 564404168
538943592 889454752
438784335 746201316
501004965 684782755
185477041 538309098
524300...

output:

101528 3760 105988 69108 53788 69295 78689 65329 136795 137424 45471 68572 95632 7645 33497 68327 122190 22909 29983 63164 26481 112775 86489 96214 116241 108412 29639 18203 30466 148523 63352 116932 40199 19334 98950 64888 101414 120971 114271 15410 131985 79475 108688 79882 94161 36757 20854 10217...

result:

ok answer = 300000

Test #59:

score: 0
Accepted
time: 76ms
memory: 23024kb

input:

300000 152784
2 3
1 2
1 3
2 3
2 3
1 3
2 3
2 3
1 2
2 3
1 2
1 3
2 3
2 3
1 3
1 2
2 3
2 3
2 3
1 2
1 2
1 2
1 2
2 3
1 3
1 2
2 3
1 2
2 3
1 2
2 3
1 2
2 3
1 2
2 3
1 3
2 3
2 3
2 3
1 2
1 3
2 3
2 3
1 3
1 2
1 2
2 3
2 3
2 3
2 3
2 3
1 2
2 3
2 3
1 3
1 2
1 3
1 2
2 3
2 3
1 2
2 3
1 3
1 2
1 2
2 3
1 2
2 3
1 2
1 3
2 3
2 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 152784

Test #60:

score: 0
Accepted
time: 63ms
memory: 22104kb

input:

300000 86194
1 2
3 4
4 5
1 5
4 5
2 4
4 5
2 4
3 5
2 3
2 5
2 4
4 5
3 4
4 5
1 4
2 5
3 4
1 3
2 4
3 4
3 5
1 5
1 4
3 5
3 4
1 5
2 4
2 4
2 3
1 2
3 4
4 5
3 4
4 5
4 5
4 5
4 5
3 5
1 3
3 4
4 5
4 5
1 4
4 5
4 5
3 5
3 4
2 3
3 5
1 2
3 5
2 4
3 4
1 4
4 5
4 5
4 5
4 5
2 3
1 3
2 4
1 4
1 2
3 4
4 5
2 4
2 4
1 3
4 5
3 4
3 4...

output:

3785 62547 18956 62548 18930 62549 18946 62550 62551 45202 62552 62553 19030 62554 19331 62555 62556 62557 37211 62558 62559 62560 62561 62562 62563 62564 62565 62566 62567 45198 18628 62568 20128 62569 19939 19905 19903 20016 62570 37113 62571 20287 20305 62572 20401 20360 62573 62574 45221 62575 1...

result:

ok answer = 148740

Test #61:

score: 0
Accepted
time: 104ms
memory: 17952kb

input:

300000 141964
7 9
7 9
9 10
5 10
7 10
1 3
3 5
4 10
2 6
9 10
6 9
1 3
8 9
2 8
5 8
8 10
7 10
9 10
7 8
6 8
4 10
7 10
2 5
9 10
1 7
2 9
8 10
3 5
8 10
5 10
6 10
6 10
9 10
1 6
9 10
9 10
6 8
6 9
7 8
9 10
4 9
2 6
1 6
2 6
5 7
8 10
9 10
7 8
6 9
9 10
1 6
1 3
8 9
8 10
6 9
2 5
5 8
2 5
5 10
3 7
3 4
4 9
5 9
5 10
7 9
...

output:

21340 21338 103953 64486 73722 57612 15574 53703 22069 103947 18479 52837 37283 104951 125748 89524 73714 103977 133778 131747 53701 73739 69469 103964 33636 133779 89521 67615 89520 64438 70637 70638 103868 21832 103880 103879 131750 18480 133780 103910 133781 74448 74230 74447 44102 89522 103971 1...

result:

ok answer = 275741

Test #62:

score: 0
Accepted
time: 143ms
memory: 17628kb

input:

300000 149911
43 56
67 78
30 90
55 80
24 77
80 88
2 10
96 97
86 98
19 67
37 84
91 97
62 82
53 63
66 93
22 75
64 73
74 88
92 94
91 92
29 100
90 98
37 99
96 100
63 78
59 82
68 92
70 85
66 91
97 100
61 68
63 90
82 93
40 76
99 100
20 21
97 100
50 76
81 86
70 84
54 94
13 100
24 85
94 99
68 79
94 98
19 88...

output:

29346 119838 48482 149846 105175 40157 122017 110538 116569 143420 15965 107779 8592 145307 70691 45434 80107 39383 82274 67451 135387 117537 123094 143819 100328 8435 63720 22934 56941 144685 138127 50378 72533 107264 147315 111352 145223 74097 29426 18182 77225 134753 20155 130017 145687 119016 35...

result:

ok answer = 299817

Test #63:

score: 0
Accepted
time: 169ms
memory: 17308kb

input:

300000 150000
754 812
673 775
487 552
507 917
210 819
374 736
487 994
397 873
928 980
319 571
408 853
4 496
747 810
131 486
916 956
7 834
699 862
353 697
732 822
898 934
257 595
50 643
707 785
837 931
920 951
822 958
653 780
60 226
937 987
35 519
381 534
179 883
109 813
128 364
628 678
247 491
221 3...

output:

5696 148605 39090 63752 8447 136725 137850 35547 120453 32384 24665 7696 4845 54710 95787 30514 29790 88138 10030 76885 127730 142625 112827 74395 91202 97344 134303 79412 128988 48916 81008 41321 20332 116719 14951 91543 40779 102711 53651 71734 27329 64421 16230 23225 70276 20694 40540 144161 1476...

result:

ok answer = 299999

Test #64:

score: 0
Accepted
time: 178ms
memory: 16876kb

input:

300000 150001
7546 9936
1162 3146
6754 9649
857 2413
8510 9893
4716 7705
7716 8415
9164 9410
6835 7368
759 9400
9631 9856
3406 5719
3351 4571
8626 9185
3958 6558
5502 9720
8962 9031
6145 9485
5618 7486
3125 9283
5266 8779
6399 6741
4401 5218
1184 4132
7703 9952
1349 9292
3287 8449
5724 8357
2213 711...

output:

138205 146581 104128 86731 132035 121598 18805 82406 102105 81493 127136 102706 9433 64940 146069 111369 54349 88785 76807 72157 38613 54401 50157 8484 140789 72846 20385 15833 115355 32862 102790 67750 33221 119367 126047 39891 17519 133940 104625 117874 130548 95456 116887 5841 73924 29043 4005 13...

result:

ok answer = 300000

Test #65:

score: 0
Accepted
time: 222ms
memory: 17940kb

input:

300000 150000
42005 98322
36515 54982
22264 95585
64174 69821
55104 97778
87368 94373
7007 8996
31762 69343
49180 53546
37354 45525
72481 91425
91172 91934
392 96117
89666 96742
78212 94400
40210 51787
79757 90604
54590 58073
81825 88959
87777 95161
45753 55341
30650 33760
41139 89968
90264 98793
89...

output:

124609 884 96061 149937 118300 85222 94837 88406 24911 131400 62625 66336 131321 107179 85455 106164 56924 137723 46412 92107 119717 1806 52672 130515 80414 112312 17966 46347 77575 58508 83749 99639 33514 7985 31237 92430 40513 30335 125320 54157 44367 45244 62895 108603 72748 46625 41711 32300 123...

result:

ok answer = 300000

Test #66:

score: 0
Accepted
time: 218ms
memory: 17212kb

input:

300000 150000
105608 372730
450920 939814
392570 470982
831537 960525
739274 852533
205877 847538
328947 740925
299221 476303
764013 815537
148257 288101
440116 625446
852887 985940
771596 826542
644437 892788
117118 283300
5525 130199
802505 908649
605317 714932
57259 586892
934933 944093
803203 95...

output:

43470 81668 136287 100003 24812 22193 41210 20214 7029 4703 63868 127685 12048 48022 76620 123719 58382 33080 29391 85164 92590 138210 123408 58464 146852 61897 115570 138732 55921 133522 95436 54187 43509 91896 116900 45648 113219 104625 18391 84863 9937 38063 24933 143119 28742 61583 97374 91505 1...

result:

ok answer = 300000

Test #67:

score: 0
Accepted
time: 177ms
memory: 17820kb

input:

300000 150000
5452202 9947793
9940079 9977522
9867053 9970459
3301439 5116018
6793328 6959345
295436 7809391
8314322 8332834
284652 6795243
9328222 9619914
1773012 9267574
3339832 7591959
2932404 4146637
1537431 4874682
2542828 9607098
3766697 6739632
8821649 9809564
9012909 9387656
6364569 8263430
...

output:

140286 145208 143991 59224 20923 124746 15552 53224 101529 71501 116050 46672 5277 100340 126777 121719 81117 12328 141450 126590 24271 16635 23669 108836 16276 136926 30738 69210 131607 111249 16477 80869 45856 54011 39659 52383 64791 142494 12481 128298 51446 89521 120087 8294 88075 92679 149569 4...

result:

ok answer = 300000

Test #68:

score: 0
Accepted
time: 242ms
memory: 17216kb

input:

300000 150000
29256543 66052315
81437971 88272697
30361131 48076722
16393921 38228960
5190763 66267381
87549810 93687917
77861257 84376100
29951389 73926657
30887064 87431784
98966017 99489059
19806040 55359526
881837 92289084
83937815 96494313
39963981 64355637
57275584 68809544
54889048 82463209
1...

output:

84596 41461 61558 36017 133232 79285 20059 60526 36531 140412 23413 83469 104408 94415 38540 10646 40174 105710 113190 88806 111181 17788 108825 135126 106192 117515 102873 92977 146485 129348 73289 8445 135213 56949 45972 107112 59344 15362 37685 86647 116452 56043 60470 102480 78347 28917 137229 1...

result:

ok answer = 300000

Test #69:

score: 0
Accepted
time: 205ms
memory: 17396kb

input:

300000 150000
97364729 815595008
542160770 603377615
577372596 773000925
493180194 604212827
148747585 765587621
781858891 841132159
825615549 958198318
853720291 982666126
443094830 832639056
265464744 612310444
430129832 962941028
720177015 997807318
606221899 916413997
266478160 776731954
4002806...

output:

7069 118086 108037 123270 48694 18956 98322 123894 14752 76018 102790 145317 63940 1358 121501 97296 136924 61415 68158 63750 83943 32188 11959 58052 76110 27783 49326 57092 2663 58705 30506 63951 87148 102352 65807 66207 134793 13597 1864 48230 118886 92285 62679 134927 116339 19174 1435 78976 9541...

result:

ok answer = 300000

Test #70:

score: 0
Accepted
time: 61ms
memory: 24376kb

input:

300000 192988
1 2
1 2
2 3
1 3
2 3
2 3
2 3
2 3
1 2
1 3
2 3
1 3
1 3
1 2
2 3
2 3
1 3
2 3
1 3
1 3
1 2
1 3
1 2
1 2
1 2
1 3
1 3
1 3
1 2
2 3
1 3
1 3
1 3
1 3
2 3
2 3
1 3
1 2
1 2
2 3
2 3
1 2
2 3
1 3
2 3
1 2
1 2
2 3
2 3
2 3
2 3
1 2
1 3
2 3
1 2
2 3
1 3
2 3
1 2
1 3
1 2
1 3
2 3
2 3
2 3
1 3
1 2
1 3
2 3
2 3
2 3
1 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 192988

Test #71:

score: 0
Accepted
time: 88ms
memory: 21980kb

input:

300000 234961
1 3
4 5
3 4
2 3
2 4
2 3
3 4
1 5
2 3
4 5
3 4
4 5
1 2
1 4
3 5
4 5
4 5
4 5
2 4
4 5
1 5
4 5
1 4
3 4
2 4
4 5
4 5
2 3
3 4
2 3
4 5
2 5
2 4
2 5
2 4
4 5
2 5
4 5
4 5
2 3
1 3
4 5
1 3
2 5
3 5
4 5
1 2
3 5
3 4
2 3
4 5
4 5
1 5
3 5
2 4
3 5
1 5
1 2
1 4
4 5
2 5
2 3
1 3
1 5
3 4
3 4
2 3
1 5
1 4
3 4
1 3
1 ...

output:

36239 53703 62573 58006 62574 58008 62575 62576 58011 53702 62577 53701 17663 62578 62579 53700 53699 53698 62580 53697 62581 53696 62582 62583 62584 53695 53694 58021 62585 58023 53693 62586 62587 62588 62589 53692 62590 53691 53675 58018 35474 53689 35475 62591 62592 53688 8428 62593 62594 57981 5...

result:

ok answer = 297533

Test #72:

score: 0
Accepted
time: 108ms
memory: 18144kb

input:

300000 144464
3 4
4 10
4 10
2 4
1 6
8 9
6 8
8 10
5 6
6 10
8 9
1 7
4 7
9 10
8 10
6 7
6 10
2 7
1 2
2 6
6 9
9 10
9 10
3 7
1 10
2 3
3 7
4 8
7 9
3 10
5 7
2 6
4 6
9 10
4 6
8 10
8 10
7 9
2 8
7 8
6 7
6 9
7 10
1 10
7 8
2 6
6 7
5 10
6 10
4 5
9 10
2 6
9 10
9 10
5 7
8 10
3 10
7 10
1 10
4 6
2 9
5 7
6 10
8 10
8 9...

output:

61412 55245 55247 60314 21337 31393 126042 83565 80481 65324 31452 33015 91524 106651 83614 44250 65258 34541 49508 22328 13116 106647 106646 89614 133576 4075 37456 116125 29226 133577 95820 30257 77589 106641 25605 83616 83574 29231 106645 133578 96582 12886 81350 133579 133580 82349 44179 63993 6...

result:

ok answer = 278039

Test #73:

score: 0
Accepted
time: 145ms
memory: 17948kb

input:

300000 150022
74 99
18 100
43 70
30 95
2 95
67 85
93 97
21 51
96 100
2 33
50 93
74 79
43 71
54 85
76 86
95 100
5 48
99 100
35 94
2 3
15 99
68 88
48 51
90 100
47 50
82 96
22 96
76 82
4 90
84 94
52 91
66 87
81 95
94 96
53 83
62 98
10 21
78 86
97 99
9 98
51 54
7 77
60 62
47 71
82 84
54 55
56 63
76 97
9...

output:

125853 134883 58353 83778 120112 22162 108346 46875 143604 106429 69112 133230 57696 21224 28197 143389 24430 147334 75865 134426 122242 38250 49063 141070 132971 96451 92089 9446 141404 80213 55452 32498 87820 100071 11724 113542 111346 28486 132500 110834 126338 71606 115005 131197 19216 49349 740...

result:

ok answer = 299938

Test #74:

score: 0
Accepted
time: 183ms
memory: 18020kb

input:

300000 149998
846 912
507 874
872 908
926 962
959 961
791 821
840 964
858 889
833 959
897 978
734 817
686 915
292 679
418 592
247 966
975 984
16 33
62 987
397 560
239 859
363 777
861 945
823 946
145 540
682 838
782 824
206 417
368 819
53 829
345 789
38 344
889 980
260 476
253 382
188 754
898 954
346...

output:

60827 36405 58099 101680 100938 9568 103421 45852 98526 117952 7701 62768 22393 20955 104888 125283 112995 127903 29673 27838 109657 86154 86940 113204 17426 10949 120384 8353 32080 125263 41726 120170 115290 129331 74756 94169 25916 102096 96975 148675 125335 51597 44609 115265 9009 67193 125019 76...

result:

ok answer = 299996

Test #75:

score: 0
Accepted
time: 213ms
memory: 17320kb

input:

300000 150000
3735 8768
3087 8764
3482 4806
5737 8689
9989 9992
9410 9674
3833 8798
6568 9556
1940 4565
6881 9857
1744 3824
4950 4980
3581 5547
5098 8827
9948 9992
2413 6458
9108 9257
4334 6121
4330 7925
2429 7742
3225 9979
6339 7770
1132 2452
7899 8950
5936 7534
4333 4780
4764 9001
385 2374
1066 92...

output:

38556 38339 4583 33982 148067 107126 40353 95618 88180 127633 6139 39746 96458 42097 148019 134181 70861 19055 129610 104394 145357 97159 147180 49604 81514 2569 52864 128317 67683 94883 42840 88641 10899 134516 108459 127686 60476 45378 91431 78115 61637 69027 90166 35503 73954 84900 10929 60910 29...

result:

ok answer = 300000

Test #76:

score: 0
Accepted
time: 207ms
memory: 17956kb

input:

300000 150000
49790 78377
97347 99479
72006 76581
43881 72339
81666 89279
2075 38244
89843 97604
77076 87731
28189 51164
28777 78100
53937 67907
22141 37944
11183 58352
78093 98649
95282 99006
99399 99405
4146 67855
59203 94723
66857 79990
74343 97034
11388 64823
57171 64530
54072 64158
36065 69808
...

output:

141161 140181 147930 57046 47496 20803 116142 38069 62797 101521 97606 91813 10654 128560 133234 139056 108607 87734 94 109907 37723 38611 127452 71845 51480 23167 75490 13005 82752 64804 16244 147688 61369 14878 85827 16639 5168 50236 91820 133542 78554 93854 72383 109422 115668 92220 103301 128796...

result:

ok answer = 300000

Test #77:

score: 0
Accepted
time: 193ms
memory: 17260kb

input:

300000 150000
291766 999528
239706 390565
933299 995606
273097 763455
851446 888731
543833 767589
699748 927426
664379 691555
190026 914875
764030 851584
611326 958847
62849 849203
573123 905908
900958 929788
593543 736367
143467 888350
121565 426255
341185 707591
831864 839245
636104 681776
402398 ...

output:

148778 103171 141534 24198 45487 88293 72140 8125 62944 24480 98587 44237 56562 73971 20505 45231 53870 10419 18106 8119 112415 56018 119587 97365 5937 70306 25895 81768 115564 47671 13409 63233 37345 24100 59343 131253 16285 115824 85118 114461 44301 64214 86156 86579 88848 3049 53923 85707 89624 3...

result:

ok answer = 300000

Test #78:

score: 0
Accepted
time: 227ms
memory: 17264kb

input:

300000 150000
8227243 9686470
6719345 8881636
3775474 8198905
5364395 9947503
2981953 9696782
1329265 1565360
3644642 4928409
1716902 8967301
9699990 9988645
3821700 7387931
2856554 3399403
9842792 9957190
8991337 9997797
9923943 9959914
2779208 7972351
6971201 9876462
8441175 9612050
6121536 656518...

output:

108573 45100 8910 140177 109651 119317 14425 50415 147280 64086 2094 141734 149349 142166 143261 130181 101160 128012 2988 63875 128950 31883 97169 107339 99219 145176 11560 101457 113466 82399 40230 92799 81170 81065 83502 95737 44219 149900 18124 82326 80354 4337 60886 141953 103910 34005 20614 12...

result:

ok answer = 300000

Test #79:

score: 0
Accepted
time: 224ms
memory: 16852kb

input:

300000 150000
77560217 84821462
57863108 73308827
13349108 92483582
10831881 85670719
92153207 98497873
21826186 59894512
5351484 44192081
23323148 98213132
83517574 87114426
1026504 90841700
99023752 99694292
6764164 7844534
43604894 58538721
33421423 79957123
45276705 79665537
79467172 80182633
80...

output:

22662 17999 70141 125355 126444 125124 2914 122936 35047 89850 143748 82229 62897 444 141456 1335 60423 111330 79637 5617 141528 5530 60390 77331 69182 101297 20327 34962 79763 33781 96492 81241 80289 64228 110108 69590 23927 84757 100844 108848 26707 82603 11464 20494 33661 116895 10622 64180 14296...

result:

ok answer = 300000

Test #80:

score: 0
Accepted
time: 176ms
memory: 16832kb

input:

300000 150000
763814908 996726129
281635131 688248102
904370118 945799883
94949607 286111159
689327474 903697825
926497730 966723335
696541135 923862111
589032579 598315025
292449712 301680987
318552055 778181558
378162882 452092573
107483323 873580594
184668805 250494315
140236757 829538288
6751721...

output:

143495 88092 86944 149261 55156 106326 69283 96699 14690 99265 16957 38641 30949 143893 149701 141001 44715 55102 7835 12651 68180 101731 111193 117940 50505 82188 45011 83730 137395 343 69491 38772 85290 121242 43487 9360 267 60622 137311 19686 95701 146449 135400 121980 90176 11318 92730 15331 147...

result:

ok answer = 300000

Test #81:

score: 0
Accepted
time: 76ms
memory: 24712kb

input:

300000 233191
1 3
1 3
2 3
2 3
2 3
2 3
2 3
2 3
1 2
2 3
1 3
2 3
2 3
1 3
1 3
1 3
1 3
1 3
2 3
2 3
2 3
2 3
2 3
2 3
1 2
2 3
1 3
2 3
2 3
2 3
1 3
2 3
1 2
1 3
2 3
1 3
1 3
2 3
2 3
1 3
1 2
2 3
2 3
2 3
2 3
1 3
2 3
1 3
1 2
2 3
1 2
1 2
2 3
1 3
1 3
1 2
2 3
2 3
2 3
2 3
2 3
1 2
1 3
1 2
2 3
1 3
2 3
2 3
1 2
2 3
1 2
1 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 233191

Test #82:

score: 0
Accepted
time: 66ms
memory: 20976kb

input:

300000 24012
4 5
4 5
1 3
4 5
2 4
2 5
2 5
2 3
4 5
2 4
2 3
3 4
3 4
3 4
2 4
4 5
4 5
2 3
4 5
1 5
1 5
3 5
1 4
3 5
1 4
2 3
2 4
1 4
1 3
1 5
2 4
1 3
3 4
1 3
4 5
1 2
3 4
1 4
2 3
4 5
4 5
2 4
3 4
2 4
2 5
2 5
2 4
2 4
1 5
1 3
2 3
3 5
4 5
1 3
1 4
4 5
2 3
2 5
2 3
1 3
3 5
4 5
3 5
1 5
2 3
2 3
3 5
2 4
3 4
2 4
4 5
4 5...

output:

0 15047 0 15046 0 0 0 14946 15045 0 14945 0 0 0 0 15044 15043 14944 15042 0 0 0 0 0 0 14940 0 0 0 0 0 0 0 0 15041 0 0 0 14942 15040 15039 0 0 0 0 0 0 0 0 0 14941 0 15038 0 0 15037 14952 0 14951 0 0 15036 0 0 14950 14949 0 0 0 0 15035 15019 0 15033 0 15032 15031 0 0 0 15030 15029 0 0 0 0 0 0 0 0 0 0 ...

result:

ok answer = 48024

Test #83:

score: 0
Accepted
time: 88ms
memory: 17740kb

input:

300000 104991
7 8
5 10
2 4
3 4
3 9
2 9
3 4
7 9
6 9
3 10
4 8
7 8
9 10
6 8
2 8
2 10
3 5
3 10
5 9
4 10
7 8
7 10
3 9
3 10
1 2
3 4
9 10
3 9
7 9
1 5
1 7
1 8
8 10
6 9
7 10
9 10
9 10
2 5
6 10
7 10
9 10
8 9
4 8
6 8
1 9
9 10
1 5
6 10
4 7
5 8
3 9
6 7
6 7
8 9
5 9
4 7
5 10
9 10
8 10
8 9
9 10
9 10
9 10
9 10
7 8
5...

output:

0 35268 0 31457 0 0 31458 1007 0 0 87872 0 78272 103767 76955 0 52800 0 0 26931 0 53068 0 0 20987 0 78275 0 1002 36529 57006 75505 55351 0 53075 78304 78303 36932 42812 53116 78296 3162 87874 103728 0 78294 0 42755 63078 96228 0 70924 70920 3157 0 11121 35233 78252 55219 3125 78248 78246 78244 78242...

result:

ok answer = 209982

Test #84:

score: 0
Accepted
time: 124ms
memory: 17400kb

input:

300000 47061
70 94
30 50
45 100
36 88
32 91
25 54
9 27
61 65
41 64
65 69
8 68
81 89
46 90
17 31
15 24
93 97
65 78
15 31
94 100
78 79
33 35
19 75
3 62
93 95
15 58
71 84
61 64
26 73
19 72
60 100
81 96
81 88
54 91
15 37
23 46
63 67
4 40
88 100
57 63
13 86
9 23
87 88
58 100
30 67
27 90
65 83
38 92
48 72...

output:

0 12557 33046 0 0 0 19446 0 42491 0 0 0 0 0 0 5360 6077 0 39650 30457 0 0 38901 0 0 0 5006 29954 0 34047 0 0 0 0 0 0 0 37814 0 0 32051 0 33904 0 0 0 0 0 0 0 1975 0 9728 9944 10710 0 0 0 44119 0 0 0 0 0 34773 0 0 0 0 0 0 44782 0 0 10524 0 0 0 0 35034 4181 0 2191 0 21450 0 5881 32733 0 44853 18789 304...

result:

ok answer = 94122

Test #85:

score: 0
Accepted
time: 142ms
memory: 17128kb

input:

300000 24043
284 933
365 927
559 679
102 483
407 653
677 969
463 602
814 900
375 498
620 698
637 793
824 998
213 383
100 496
725 872
52 612
35 947
749 882
724 920
212 665
421 711
675 904
730 890
84 519
508 893
515 984
82 958
975 989
586 750
757 965
34 601
469 593
412 766
389 653
666 884
851 923
616 ...

output:

0 0 0 0 0 0 0 0 8900 0 3349 18609 0 0 0 0 0 0 0 0 14497 0 0 0 0 0 0 5741 0 0 0 0 0 0 0 0 0 4642 0 0 5355 9124 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 23556 11593 0 0 0 7754 0 0 0 0 0 0 0 0 0 0 0 0 0 0 14292 0 18723 0 0 0 0 0 0 0 0 0 0 20229 0 0 3903 0 22474 0 0 4538 0 0 0 0 0 0 0 0 0 23414 0 0...

result:

ok answer = 48086

Test #86:

score: 0
Accepted
time: 171ms
memory: 17240kb

input:

300000 39197
3464 9192
2491 4593
8097 9019
4096 9853
8425 8896
361 3624
3848 5908
5689 7816
4995 9362
3956 4144
2335 9360
7158 9342
3450 7596
6058 9998
1016 5957
4091 9487
4355 5263
2859 9771
9072 9331
8269 8799
1081 5503
5930 8840
5606 6760
4876 7444
9610 9801
5986 9429
9001 9776
3594 8009
156 9211...

output:

0 0 0 16025 0 0 0 7506 0 0 0 0 0 38407 0 0 0 6277 0 0 0 0 27193 8946 9797 0 6932 0 17110 0 9543 0 0 0 0 0 0 3446 0 15956 0 0 0 0 16484 4844 5513 0 0 0 0 0 2659 0 0 0 0 0 0 0 0 5922 16928 0 0 0 13191 0 0 0 0 0 0 0 0 29077 28759 0 18223 0 0 0 0 0 9506 0 0 0 0 0 0 0 0 0 0 29253 0 26168 0 0 16887 0 2526...

result:

ok answer = 78394

Test #87:

score: 0
Accepted
time: 175ms
memory: 17240kb

input:

300000 12008
61060 93610
29964 39538
99379 99599
68300 85459
78526 92446
4557 64653
38330 54309
3419 86837
64888 74988
9351 68829
15679 22336
45276 86285
1753 67864
62960 77046
62686 94661
7937 11565
10790 12322
55724 71521
98415 99275
62100 78617
70531 89247
6543 29130
8246 50974
90235 99940
27517 ...

output:

0 0 4118 0 0 0 0 0 352 0 0 0 0 0 0 7218 0 0 0 0 0 0 0 10471 10085 0 0 0 0 0 7600 0 0 0 1735 11948 0 0 0 0 1018 0 8453 0 0 11290 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11993 0 0 11842 0 0 0 7362 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok answer = 24016

Test #88:

score: 0
Accepted
time: 168ms
memory: 17864kb

input:

300000 51943
922968 931060
676228 902422
706391 835341
377320 837379
728897 785928
945419 983794
728153 742025
530848 705151
193003 410603
795045 976129
628017 856937
286764 722057
45994 560645
835098 931094
935878 983991
440103 965747
474374 609564
522246 850694
287757 962939
754589 843217
262173 7...

output:

0 0 0 0 11394 26987 0 2880 11648 18029 0 0 20456 0 27215 7211 10315 0 4416 0 17832 0 0 0 0 0 0 0 14008 0 14147 45692 14940 29094 4859 0 40295 0 0 23708 0 36213 20200 9500 0 0 0 0 0 0 46627 0 35658 0 0 0 50102 14825 0 34653 31114 0 0 0 0 0 0 3822 0 2922 50487 0 0 0 0 37254 0 7727 0 0 0 6698 0 0 4327 ...

result:

ok answer = 103886

Test #89:

score: 0
Accepted
time: 189ms
memory: 17192kb

input:

300000 92186
5881667 9245835
585950 1112181
2359288 4822085
582150 3868378
2463796 8615660
5466872 7826770
4190126 6736016
5587359 7790977
9047264 9662912
5210034 8575619
8929902 9587777
6225173 9633255
891946 1478964
2631518 3196046
9369588 9836606
2702532 7732659
2191361 2486418
4246739 6627269
63...

output:

12165 68941 1491 20296 0 68403 60061 57733 47971 0 40619 44997 0 0 67244 28389 0 0 0 46677 38612 0 28408 56882 0 0 5827 0 0 34438 78096 74256 63336 0 25524 68309 20732 20888 227 0 73405 0 0 67290 28356 77310 0 0 68132 50401 16123 0 36562 77341 58187 0 79803 0 0 83616 14997 0 62051 0 57702 24845 5059...

result:

ok answer = 184372

Test #90:

score: 0
Accepted
time: 167ms
memory: 17556kb

input:

300000 5101
22533551 61918934
55282140 76435955
67436320 75349037
25838176 76449937
72274253 73479904
12520364 55901303
63268357 78610611
90446269 98394669
45735435 58300568
65549491 93811961
53562826 72410596
98875739 99970807
76621426 81931190
49609129 77583583
10142883 58372718
2868357 10564697
5...

output:

0 0 0 0 0 0 0 0 0 0 0 4320 0 0 0 0 1096 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok answer = 10202

Test #91:

score: 0
Accepted
time: 173ms
memory: 17248kb

input:

300000 45343
161780904 410049562
283210989 686643566
75741737 207110089
133792723 222338922
681018503 797751796
882310807 893049049
7612807 793470558
622224492 928679497
145325156 991514099
270763472 617283828
259767717 509070778
918270298 952247865
656605285 954061584
531619154 652348482
693773286 ...

output:

4782 0 21075 0 37947 0 0 0 30703 0 0 0 0 0 8396 0 0 1849 0 0 0 0 0 0 4609 37229 0 0 0 0 0 0 0 0 0 0 0 22042 26003 17892 0 0 0 4777 0 10938 26622 0 0 17532 7136 0 0 14445 0 0 0 0 38641 22034 0 0 40568 0 0 6727 44135 0 11869 0 36285 0 0 18690 0 0 0 0 20165 0 22153 0 41208 0 18096 0 0 0 20456 30761 0 0...

result:

ok answer = 90686

Test #92:

score: 0
Accepted
time: 55ms
memory: 23772kb

input:

300000 1
2 3
1 3
2 3
2 3
1 2
2 3
2 3
1 2
2 3
2 3
2 3
1 3
1 2
1 2
1 2
2 3
1 2
2 3
2 3
1 3
1 2
1 3
1 2
2 3
2 3
1 2
2 3
1 2
1 2
1 3
1 2
2 3
1 2
2 3
2 3
1 2
1 2
2 3
2 3
2 3
2 3
1 3
2 3
2 3
2 3
1 2
1 2
2 3
2 3
1 3
1 3
1 3
1 3
1 3
2 3
1 3
1 2
1 2
2 3
1 2
2 3
2 3
2 3
1 2
2 3
1 2
1 3
2 3
1 2
1 2
1 2
1 3
1 3...

output:

1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok answer = 1

Test #93:

score: 0
Accepted
time: 87ms
memory: 17884kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

22033 40209 62481 62609 62737 62865 62993 63121 63249 63377 63505 63633 63761 63889 64017 64145 62225 64401 64529 64657 64785 64913 65041 65169 65297 65425 65553 65681 65809 65937 66065 60177 58257 58385 58513 58641 58769 58897 59025 59153 59281 59409 59537 59665 59793 59921 60049 58129 60305 60433 ...

result:

ok answer = 300000

Test #94:

score: 0
Accepted
time: 108ms
memory: 17228kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

22033 40209 62353 62481 62609 62737 62865 62993 63121 63249 63377 63505 63633 63761 63889 64017 64145 62225 64401 64529 64657 64785 64913 65041 65169 65297 65425 65553 65681 65809 65937 66065 60177 58257 58385 58513 58641 58769 58897 59025 59153 59281 59409 59537 59665 59793 59921 60049 58129 60305 ...

result:

ok answer = 300000

Test #95:

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

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

22033 40209 62353 62481 62609 62737 62865 62993 63121 63249 63377 63505 63633 63761 63889 64017 64145 62225 64401 64529 64657 64785 64913 65041 65169 65297 65425 65553 65681 65809 65937 66065 60177 58257 58385 58513 58641 58769 58897 59025 59153 59281 59409 59537 59665 59793 59921 60049 58129 60305 ...

result:

ok answer = 300000

Test #96:

score: 0
Accepted
time: 77ms
memory: 17248kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

63457 89873 116625 116641 116657 116673 116689 116705 116721 116737 116593 116769 116785 116801 116817 116833 116849 116865 116881 116433 116289 116305 116321 116337 116353 116369 116385 116401 116417 116273 116449 116465 116481 116497 116513 116529 116545 116561 116577 116753 117233 117249 117265 1...

result:

ok answer = 300000

Test #97:

score: 0
Accepted
time: 87ms
memory: 17240kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

63457 89873 116625 116641 116657 116673 116689 116705 116721 116737 116593 116769 116785 116801 116817 116833 116849 116865 116881 116433 116289 116305 116321 116337 116353 116369 116385 116401 116417 116273 116449 116465 116481 116497 116513 116529 116545 116561 116577 116753 117233 117249 117265 1...

result:

ok answer = 300000

Test #98:

score: 0
Accepted
time: 89ms
memory: 16828kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

63457 89873 116625 116641 116657 116673 116689 116705 116721 116737 116593 116769 116785 116801 116817 116833 116849 116865 116881 116433 116289 116305 116321 116337 116353 116369 116385 116401 116417 116273 116449 116465 116481 116497 116513 116529 116545 116561 116577 116753 117233 117249 117265 1...

result:

ok answer = 300000

Test #99:

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

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

116709 149957 16661 16663 16665 16667 16669 16671 16673 16675 16677 16679 16657 16683 16685 16687 16689 16691 16693 16695 16697 16699 16701 16703 16633 16609 16611 16613 16615 16617 16619 16621 16623 16625 16627 16629 16631 16607 16635 16637 16639 16641 16643 16645 16647 16649 16651 16653 16655 1668...

result:

ok answer = 300000

Test #100:

score: 0
Accepted
time: 78ms
memory: 17920kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

116709 149957 16661 16663 16665 16667 16669 16671 16673 16675 16677 16679 16657 16683 16685 16687 16689 16691 16693 16695 16697 16699 16701 16703 16633 16609 16611 16613 16615 16617 16619 16621 16623 16625 16627 16629 16631 16607 16635 16637 16639 16641 16643 16645 16647 16649 16651 16653 16655 1668...

result:

ok answer = 300000

Test #101:

score: 0
Accepted
time: 99ms
memory: 18068kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

116709 149957 16661 16663 16665 16667 16669 16671 16673 16675 16677 16679 16657 16683 16685 16687 16689 16691 16693 16695 16697 16699 16701 16703 16633 16609 16611 16613 16615 16617 16619 16621 16623 16625 16627 16629 16631 16607 16635 16637 16639 16641 16643 16645 16647 16649 16651 16653 16655 1668...

result:

ok answer = 300000

Test #102:

score: 0
Accepted
time: 84ms
memory: 17244kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

116659 149979 16678 16677 16676 16675 16674 16673 16672 16671 16670 16669 16668 16654 16666 16665 16664 16663 16662 16661 16660 16659 16658 16657 16656 16655 16667 16702 16701 16700 16699 16698 16697 16696 16695 16694 16693 16692 16679 16690 16689 16688 16687 16686 16685 16684 16683 16682 16681 1668...

result:

ok answer = 300000

Test #103:

score: 0
Accepted
time: 86ms
memory: 17508kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

116659 149979 16677 16676 16675 16674 16673 16672 16671 16670 16669 16668 16654 16666 16665 16664 16663 16662 16661 16660 16659 16658 16657 16656 16655 16667 16702 16701 16700 16699 16698 16697 16696 16695 16694 16693 16692 16679 16690 16689 16688 16687 16686 16685 16684 16683 16682 16681 16680 1664...

result:

ok answer = 300000

Test #104:

score: 0
Accepted
time: 80ms
memory: 17436kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

116659 149979 16677 16676 16675 16674 16673 16672 16671 16670 16669 16668 16654 16666 16665 16664 16663 16662 16661 16660 16659 16658 16657 16656 16655 16667 16702 16701 16700 16699 16698 16697 16696 16695 16694 16693 16692 16679 16690 16689 16688 16687 16686 16685 16684 16683 16682 16681 16680 1664...

result:

ok answer = 300000

Test #105:

score: 0
Accepted
time: 92ms
memory: 16852kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

116659 149979 16677 16676 16675 16674 16673 16672 16671 16670 16669 16668 16654 16666 16665 16664 16663 16662 16661 16660 16659 16658 16657 16656 16655 16667 16702 16701 16700 16699 16698 16697 16696 16695 16694 16693 16692 16679 16690 16689 16688 16687 16686 16685 16684 16683 16682 16681 16680 1664...

result:

ok answer = 300000

Test #106:

score: 0
Accepted
time: 86ms
memory: 17940kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

50008 74993 99999 100000 100001 100002 100003 100004 100005 100006 99998 100008 100009 100010 100011 100012 100013 100014 100015 99989 99980 99981 99982 99983 99984 99985 99986 99987 99988 99979 99990 99991 99992 99993 99994 99995 99996 99997 100007 100035 100036 100037 100038 100039 100040 100041 1...

result:

ok answer = 300000

Test #107:

score: 0
Accepted
time: 69ms
memory: 16956kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

50008 74993 99999 100000 100001 100002 100003 100004 100005 100006 99998 100008 100009 100010 100011 100012 100013 100014 100015 99989 99980 99981 99982 99983 99984 99985 99986 99987 99988 99979 99990 99991 99992 99993 99994 99995 99996 99997 100007 100035 100036 100037 100038 100039 100040 100041 1...

result:

ok answer = 300000

Test #108:

score: 0
Accepted
time: 95ms
memory: 17740kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

50008 74993 99999 100000 100001 100002 100003 100004 100005 100006 99998 100008 100009 100010 100011 100012 100013 100014 100015 99989 99980 99981 99982 99983 99984 99985 99986 99987 99988 99979 99990 99991 99992 99993 99994 99995 99996 99997 100007 100035 100036 100037 100038 100039 100040 100041 1...

result:

ok answer = 300000

Test #109:

score: 0
Accepted
time: 66ms
memory: 17552kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

50008 74993 99999 100000 100001 100002 100003 100004 100005 100006 99998 100008 100009 100010 100011 100012 100013 100014 100015 99989 99980 99981 99982 99983 99984 99985 99986 99987 99988 99979 99990 99991 99992 99993 99994 99995 99996 99997 100007 100035 100036 100037 100038 100039 100040 100041 1...

result:

ok answer = 300000

Test #110:

score: 0
Accepted
time: 95ms
memory: 16876kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

50008 74993 99999 100000 100001 100002 100003 100004 100005 100006 99998 100008 100009 100010 100011 100012 100013 100014 100015 99989 99980 99981 99982 99983 99984 99985 99986 99987 99988 99979 99990 99991 99992 99993 99994 99995 99996 99997 100007 100035 100036 100037 100038 100039 100040 100041 1...

result:

ok answer = 300000

Test #111:

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

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

50008 74993 99999 100000 100001 100002 100003 100004 100005 100006 99998 100008 100009 100010 100011 100012 100013 100014 100015 99989 99980 99981 99982 99983 99984 99985 99986 99987 99988 99979 99990 99991 99992 99993 99994 99995 99996 99997 100007 100035 100036 100037 100038 100039 100040 100041 1...

result:

ok answer = 300000

Test #112:

score: 0
Accepted
time: 79ms
memory: 17784kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

50008 99999 100000 100001 100002 100003 100004 100005 100006 99998 100008 100009 100010 100011 100012 100013 100014 100015 99989 99980 99981 99982 99983 99984 99985 99986 99987 99988 99979 99990 99991 99992 99993 99994 99995 99996 99997 100007 100035 100036 100037 100038 100039 100040 100041 100042 ...

result:

ok answer = 300000

Test #113:

score: 0
Accepted
time: 84ms
memory: 17924kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

50008 99999 100000 100001 100002 100003 100004 100005 100006 99998 100008 100009 100010 100011 100012 100013 100014 100015 99989 99980 99981 99982 99983 99984 99985 99986 99987 99988 99979 99990 99991 99992 99993 99994 99995 99996 99997 100007 100035 100036 100037 100038 100039 100040 100041 100042 ...

result:

ok answer = 300000

Test #114:

score: 0
Accepted
time: 97ms
memory: 17240kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

100001 74993 100002 100003 100004 100005 100006 100007 99999 100009 100010 100011 100012 100013 100014 100015 100016 99990 99981 99982 99983 99984 99985 99986 99987 99988 99989 99980 99991 99992 99993 99994 99995 99996 99997 99998 100008 100036 100037 100038 100039 100040 100041 100042 100043 100035...

result:

ok answer = 299999

Test #115:

score: 0
Accepted
time: 69ms
memory: 24364kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 150000

Test #116:

score: 0
Accepted
time: 80ms
memory: 16824kb

input:

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

output:

1 150000 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53...

result:

ok answer = 299999

Test #117:

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

input:

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

output:

1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 ...

result:

ok answer = 300000

Test #118:

score: 0
Accepted
time: 123ms
memory: 18016kb

input:

300000 151658
8 10
9 10
1 6
8 10
7 10
3 9
8 9
9 10
3 5
1 8
9 10
7 8
3 4
8 9
5 6
8 9
1 8
3 5
7 10
2 5
9 10
2 4
1 9
2 3
7 10
3 7
8 10
4 7
9 10
4 5
2 10
2 4
6 10
6 10
3 4
2 3
1 2
9 10
7 8
8 10
7 10
9 10
6 10
1 7
3 7
8 10
3 6
9 10
6 10
5 8
7 9
3 10
1 4
8 9
9 10
4 7
3 9
4 6
1 7
2 10
7 9
3 4
2 3
2 6
6 10
...

output:

99605 100378 29930 94396 81984 133357 42489 101600 66829 103870 101597 133358 8638 42492 2067 42494 103891 71494 81979 69301 101591 7068 133359 3988 81995 37000 94380 40204 101625 72239 133360 59046 68272 68273 59599 53234 50624 101624 133361 94384 81989 101619 68274 85358 36992 94390 23984 101615 6...

result:

ok answer = 285014

Test #119:

score: 0
Accepted
time: 96ms
memory: 18000kb

input:

300000 161017
8 10
7 8
8 10
7 9
7 10
9 10
3 10
1 4
9 10
2 9
7 10
7 10
8 9
7 9
1 5
6 10
3 10
2 4
1 2
1 6
6 9
1 8
6 9
5 6
7 8
9 10
8 9
1 5
7 10
9 10
1 3
3 6
9 10
2 9
3 4
1 10
4 5
9 10
8 10
3 10
1 2
6 9
5 6
7 9
1 9
8 9
7 9
5 10
8 9
8 10
1 3
7 10
4 7
8 10
5 8
8 9
5 9
3 4
8 9
8 10
8 10
1 10
4 7
3 4
9 10
...

output:

84087 133843 84215 24612 76808 105462 133844 6724 105461 133845 76791 76789 32032 24603 13155 72791 133846 59038 49046 21854 20567 103899 20579 79709 133847 105407 32426 29062 76834 105545 56134 31722 105543 133848 63517 133849 15932 105594 84547 133850 49389 20593 2531 24634 133851 32531 24622 6044...

result:

ok answer = 294859

Test #120:

score: 0
Accepted
time: 99ms
memory: 18704kb

input:

300000 157295
1 2
3 7
5 6
8 9
3 9
4 6
4 7
8 9
2 7
9 10
1 6
8 10
3 4
9 10
9 10
2 3
2 4
9 10
4 6
9 10
5 10
6 10
9 10
4 5
8 9
3 10
1 9
2 10
2 4
5 8
4 6
9 10
5 8
1 5
1 9
1 7
5 10
6 9
3 4
2 5
8 9
8 9
1 10
2 9
9 10
2 3
8 9
3 4
4 7
5 8
9 10
5 10
5 9
5 8
2 7
9 10
4 8
4 9
5 8
5 8
9 10
2 4
7 9
4 10
5 10
5 7
2...

output:

49311 36204 3709 32366 133690 25910 39477 32363 86434 100756 22015 84169 61981 100668 100685 56395 58909 100682 25908 100748 64476 72323 101085 29890 32216 52317 133691 133692 58906 125425 25907 100903 125427 81281 133693 85491 64359 20390 12306 69471 32605 32648 133694 133695 100778 54910 32435 601...

result:

ok answer = 290984

Test #121:

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

input:

300000 152600
6 10
6 7
1 2
1 6
4 7
3 7
3 10
8 10
1 10
6 10
1 8
6 7
9 10
1 2
5 8
8 10
9 10
7 10
5 9
3 10
3 4
2 5
2 9
6 8
6 8
3 4
1 8
7 8
5 8
8 10
9 10
2 3
4 6
6 8
1 10
3 4
4 7
6 10
6 10
5 10
4 10
7 8
5 8
8 9
2 3
4 5
1 10
7 10
2 10
5 10
2 6
9 10
3 5
3 6
3 4
7 10
9 10
1 2
5 7
4 8
5 9
9 10
9 10
4 10
9 1...

output:

66412 45049 48977 73714 38003 89792 133719 98115 133720 66411 103452 45051 101101 49119 124973 98148 101123 77503 11991 133721 60109 71382 133722 127284 127287 60110 103453 456 124972 98136 101247 54374 24848 127289 133723 63153 38009 66409 66418 64001 51945 454 124971 45859 57168 71983 133724 77501...

result:

ok answer = 286318