QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#673237#2390. InversionYarema#AC ✓6ms24156kbC++231.6kb2024-10-24 21:18:242024-10-24 21:18:25

Judging History

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

  • [2024-10-24 21:18:25]
  • 评测
  • 测评结果:AC
  • 用时:6ms
  • 内存:24156kb
  • [2024-10-24 21:18:24]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef double db;

const int N = 147;

bitset<N> b[N];
LL dp[N][N][N];

int main()
{
	ios::sync_with_stdio(0); 
	cin.tie(0);
	
	int n, m;
	cin >> n >> m;
	FOR (i, 0, m)
	{
		int u, v;
		cin >> u >> v;
		u--, v--;
		b[u][v] = b[v][u] = 1;
	}
	FOR (i, 0, n) b[i][i] = 1;
	VI vec(n);
	iota(ALL(vec), 1);
	VI p(n);
	FOR (i, 0, n)
	{
		int idx = 0;
		FOR (j, i + 1, n)
			if (b[i][j])
				idx++;
		p[i] = vec[idx];
		vec.erase(vec.begin() + idx);
	}
	//FOR (i, 0, n)
	//	cerr << p[i] << ' ';
	//cerr << '\n';
	dp[0][0][0] = 1;
	FOR (i, 0, n)
	{
		FOR (mn, 0, n + 1)
		{
			FOR (mx, 0, n + 1)
			{
				//if (dp[i][mn][mx])
				//	cerr << i << ' ' << p[i] << ' ' << mn << ' ' << mx << ' ' << dp[i][mn][mx] << '\n';
				if (p[i] < mn && p[i] > mx)
					dp[i + 1][0][max(mx, p[i])] += dp[i][mn][mx];
				else if (p[i] > mx)
					dp[i + 1][mn][max(mx, p[i])] += dp[i][mn][mx];
				
				if (p[i] < mx)
					dp[i + 1][mn][mx] += dp[i][mn][mx];
				else
					dp[i + 1][mn == 0 ? p[i] : min(mn, p[i])][mx] += dp[i][mn][mx];
			}
		}
	}
	LL ans = 0;
	FOR (mx, 0, n + 1)
		ans += dp[n][0][mx];
	cout << ans << '\n';
	
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3560kb

input:

4 2
2 3
2 4

output:

2

result:

ok single line: '2'

Test #2:

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

input:

5 7
2 5
1 5
3 5
2 3
4 1
4 3
4 2

output:

3

result:

ok single line: '3'

Test #3:

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

input:

7 7
5 6
2 3
6 7
2 7
3 1
7 5
7 4

output:

6

result:

ok single line: '6'

Test #4:

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

input:

5 6
1 3
4 5
1 4
2 3
1 2
1 5

output:

5

result:

ok single line: '5'

Test #5:

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

input:

5 5
4 2
5 2
4 1
4 3
5 3

output:

3

result:

ok single line: '3'

Test #6:

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

input:

1 0

output:

1

result:

ok single line: '1'

Test #7:

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

input:

10 0

output:

1

result:

ok single line: '1'

Test #8:

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

input:

4 6
2 1
3 1
4 1
3 2
4 2
4 3

output:

4

result:

ok single line: '4'

Test #9:

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

input:

8 10
6 1
3 2
6 4
4 1
3 1
4 2
6 5
5 1
5 2
6 2

output:

3

result:

ok single line: '3'

Test #10:

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

input:

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

output:

1125899906842624

result:

ok single line: '1125899906842624'

Test #11:

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

input:

100 993
33 20
85 82
92 7
27 18
85 58
41 29
77 57
59 56
68 63
54 23
65 62
92 1
74 34
35 26
92 22
81 75
87 35
92 29
66 17
41 7
12 10
68 31
85 61
81 79
77 71
85 71
29 25
51 50
92 28
7 3
92 48
54 28
85 77
77 52
54 30
20 16
41 13
68 43
68 49
45 30
45 22
77 48
54 3
74 42
92 49
74 20
46 6
33 4
54 49
41 28
...

output:

783903759

result:

ok single line: '783903759'

Test #12:

score: 0
Accepted
time: 5ms
memory: 20636kb

input:

100 992
22 21
72 32
40 31
58 45
69 55
69 33
62 51
66 16
56 51
69 19
72 12
59 53
69 3
66 53
58 41
87 56
14 6
87 59
58 28
45 27
54 18
84 83
58 11
26 20
36 16
87 46
87 12
66 6
54 10
69 24
72 41
89 85
33 4
57 8
72 18
62 27
72 33
87 31
87 13
25 23
42 38
45 43
54 3
84 59
57 14
90 62
21 15
87 42
50 35
64 6...

output:

587163974

result:

ok single line: '587163974'

Test #13:

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

input:

100 991
70 62
66 37
10 8
32 4
60 11
87 49
66 51
81 8
75 49
21 17
88 40
27 18
93 86
88 79
54 8
51 40
31 20
54 12
33 28
50 23
88 36
88 70
75 50
88 11
26 12
87 72
50 37
66 16
81 53
81 17
57 28
66 21
81 32
81 2
21 8
57 40
62 58
75 37
33 7
79 78
27 7
81 20
15 12
26 10
32 15
88 45
81 16
37 35
38 36
47 46
...

output:

595131855

result:

ok single line: '595131855'

Test #14:

score: 0
Accepted
time: 5ms
memory: 20760kb

input:

100 990
40 39
62 49
72 19
42 15
72 62
82 10
83 71
42 9
93 24
42 31
54 7
83 64
42 25
40 24
75 38
75 21
7 5
42 22
65 20
41 36
23 9
37 9
57 6
37 6
55 24
82 24
37 20
55 33
53 51
55 38
76 71
72 52
55 32
82 38
65 27
18 17
72 49
83 78
98 95
96 91
75 74
55 17
57 52
75 34
93 76
24 12
93 17
93 71
23 20
55 31
...

output:

894045480

result:

ok single line: '894045480'

Test #15:

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

input:

2 0

output:

1

result:

ok single line: '1'

Test #16:

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

input:

2 1
2 1

output:

2

result:

ok single line: '2'

Test #17:

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

input:

3 0

output:

1

result:

ok single line: '1'

Test #18:

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

input:

3 3
2 1
3 2
3 1

output:

3

result:

ok single line: '3'

Test #19:

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

input:

3 1
2 1

output:

2

result:

ok single line: '2'

Test #20:

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

input:

100 110
33 22
48 38
33 18
60 58
95 93
16 1
71 68
67 66
33 32
16 14
33 19
48 36
45 44
46 44
24 18
8 7
40 35
54 51
6 3
33 26
15 11
15 12
16 12
16 4
48 41
21 19
65 62
16 8
48 39
40 39
40 36
19 18
43 42
71 70
47 44
54 52
62 59
71 69
48 42
2 1
40 38
33 17
50 49
45 43
27 26
6 4
33 29
40 34
54 53
65 59
33 ...

output:

172339200

result:

ok single line: '172339200'

Test #21:

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

input:

3 1
3 2

output:

2

result:

ok single line: '2'

Test #22:

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

input:

100 120
3 1
27 17
13 10
57 55
21 19
14 11
36 35
21 11
59 58
34 23
24 23
52 50
27 26
27 25
34 25
52 48
11 10
24 22
80 79
78 76
66 63
70 69
32 31
51 50
14 12
13 8
65 63
13 3
13 11
57 54
57 56
19 15
17 16
36 31
19 16
52 49
45 44
53 50
67 63
13 2
78 77
61 60
32 28
46 43
36 33
7 6
7 5
21 14
19 17
41 39
4...

output:

1007271936

result:

ok single line: '1007271936'

Test #23:

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

input:

3 2
3 1
3 2

output:

2

result:

ok single line: '2'

Test #24:

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

input:

3 2
2 1
3 1

output:

2

result:

ok single line: '2'

Test #25:

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

input:

100 130
58 55
34 16
47 44
69 66
31 22
47 43
31 28
69 65
34 31
34 12
34 15
14 8
20 18
31 27
15 10
54 52
50 46
34 32
43 42
60 59
50 48
39 36
34 11
47 42
88 87
86 85
34 28
34 25
38 36
56 53
69 68
31 30
31 24
31 23
34 24
20 19
83 81
6 3
29 26
34 26
39 37
79 76
34 9
34 5
34 27
34 29
58 53
34 21
31 21
6 1...

output:

79925760

result:

ok single line: '79925760'

Test #26:

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

input:

100 140
21 18
63 62
61 60
45 44
56 47
61 58
51 47
75 74
28 25
20 16
56 49
51 49
28 26
21 14
50 49
17 10
46 41
27 24
36 29
21 12
36 24
56 55
36 30
20 14
14 13
5 3
20 15
53 52
21 9
92 91
9 7
28 27
21 6
74 73
12 10
56 54
36 34
8 3
9 8
17 16
4 3
20 13
28 22
21 10
34 32
56 48
53 49
21 20
21 11
29 26
9 3
...

output:

95302656

result:

ok single line: '95302656'

Test #27:

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

input:

100 0

output:

1

result:

ok single line: '1'

Test #28:

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

input:

100 150
10 7
41 34
41 38
41 39
33 8
14 13
74 73
58 56
60 46
18 12
27 23
33 14
74 69
35 28
33 24
27 24
60 49
33 6
33 2
45 44
24 20
27 16
10 6
38 37
60 51
60 55
21 12
33 7
33 25
21 17
23 20
8 7
60 43
4 2
33 23
27 19
33 16
29 26
33 19
8 6
21 16
33 32
55 54
18 13
21 19
79 78
21 20
27 15
21 15
41 37
33 2...

output:

1538976

result:

ok single line: '1538976'

Test #29:

score: 0
Accepted
time: 5ms
memory: 20632kb

input:

100 1
11 10

output:

2

result:

ok single line: '2'

Test #30:

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

input:

100 2
30 29
46 45

output:

4

result:

ok single line: '4'

Test #31:

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

input:

100 3
6 4
30 29
6 5

output:

4

result:

ok single line: '4'

Test #32:

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

input:

100 4
20 19
59 58
74 73
34 33

output:

16

result:

ok single line: '16'

Test #33:

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

input:

100 5
16 15
52 51
46 44
45 44
25 24

output:

16

result:

ok single line: '16'

Test #34:

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

input:

100 6
4 2
51 50
65 64
4 3
63 62
84 83

output:

32

result:

ok single line: '32'

Test #35:

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

input:

100 7
29 28
61 60
27 26
25 24
100 99
15 14
30 28

output:

64

result:

ok single line: '64'

Test #36:

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

input:

100 8
3 2
7 6
11 10
61 60
43 42
41 40
5 4
23 22

output:

256

result:

ok single line: '256'

Test #37:

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

input:

100 9
58 57
4 2
24 23
12 11
4 3
36 35
64 63
25 23
7 6

output:

128

result:

ok single line: '128'

Test #38:

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

input:

100 10
52 51
63 62
10 9
24 23
83 82
39 38
22 21
18 17
73 72
65 64

output:

1024

result:

ok single line: '1024'

Test #39:

score: 0
Accepted
time: 5ms
memory: 20560kb

input:

100 20
71 70
8 7
10 9
41 40
24 22
2 1
24 23
28 27
75 74
71 69
8 5
24 21
54 53
42 40
44 43
60 59
42 41
8 6
24 20
26 25

output:

6144

result:

ok single line: '6144'

Test #40:

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

input:

100 30
36 34
13 12
8 7
67 66
2 1
44 43
42 41
30 29
58 57
53 52
25 24
14 12
71 70
45 43
17 16
23 21
23 22
50 49
36 35
91 90
5 4
27 26
30 28
64 63
23 20
50 48
15 12
8 4
85 84
6 4

output:

786432

result:

ok single line: '786432'

Test #41:

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

input:

100 40
32 31
5 4
39 38
32 29
78 77
9 8
6 3
34 33
50 49
76 74
54 52
12 10
39 36
6 4
39 35
76 73
54 53
45 43
12 11
20 19
32 30
25 23
22 21
20 17
2 1
76 75
82 81
12 8
25 24
13 11
20 18
6 5
39 37
45 44
56 55
63 62
9 7
13 10
76 72
22 19

output:

491520

result:

ok single line: '491520'

Test #42:

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

input:

100 50
40 38
29 28
8 4
31 30
65 64
19 17
37 36
35 34
67 66
49 47
24 22
40 39
81 80
5 4
10 9
8 7
42 40
13 11
53 52
7 4
42 37
63 62
86 85
5 3
23 22
13 9
56 55
6 4
58 57
19 18
24 23
13 4
48 46
6 2
84 83
42 38
49 46
42 41
48 47
75 74
19 16
6 3
6 5
42 39
54 52
42 36
13 10
92 91
49 48
13 12

output:

29491200

result:

ok single line: '29491200'

Test #43:

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

input:

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

output:

950400

result:

ok single line: '950400'

Test #44:

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

input:

100 70
26 16
69 68
72 71
26 14
46 45
36 35
62 61
28 27
58 57
64 61
43 42
13 10
75 74
43 41
26 12
62 59
37 34
26 23
7 6
85 82
87 86
88 86
21 18
5 2
26 11
26 15
47 45
5 3
37 33
4 2
21 20
62 60
29 27
83 82
85 84
62 57
77 76
29 25
40 39
89 86
26 18
4 3
64 63
36 34
26 19
75 71
40 38
75 73
3 2
53 52
29 28...

output:

47775744

result:

ok single line: '47775744'

Test #45:

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

input:

100 80
61 60
10 6
61 58
27 24
39 38
30 24
79 76
36 31
41 40
45 44
10 5
2 1
11 6
16 14
75 73
16 15
79 77
36 32
30 26
62 60
8 3
26 24
36 29
10 3
69 68
36 34
18 14
4 3
4 2
8 6
25 23
11 9
55 53
75 74
21 20
85 84
55 52
78 77
83 82
25 24
43 42
57 56
41 35
93 92
4 1
7 6
64 63
74 73
45 38
41 39
87 86
17 14
...

output:

318504960

result:

ok single line: '318504960'

Test #46:

score: 0
Accepted
time: 5ms
memory: 21988kb

input:

100 90
39 36
30 29
13 10
80 79
6 1
46 43
3 1
18 17
20 17
73 71
38 34
22 21
38 37
13 5
22 15
69 68
95 94
38 36
58 54
39 32
6 4
67 66
72 70
44 43
93 92
8 7
9 1
39 33
64 63
6 3
8 5
9 3
44 42
45 43
39 35
64 60
56 54
51 48
51 49
44 41
22 10
22 18
22 11
22 12
9 4
39 31
74 71
50 49
9 5
13 11
27 23
51 50
2 ...

output:

34421760

result:

ok single line: '34421760'

Test #47:

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

input:

100 100
10 9
24 16
85 83
24 12
55 53
2 1
64 59
64 61
4 1
54 52
55 51
8 7
47 46
14 13
20 19
17 16
15 12
82 79
45 44
24 19
24 13
72 71
10 7
64 62
3 1
24 21
57 56
15 13
32 31
9 5
15 4
64 58
89 88
15 5
15 14
29 27
64 56
54 51
24 7
37 35
15 11
29 28
42 41
55 50
24 20
24 22
64 60
24 17
67 66
10 8
36 33
49...

output:

182736000

result:

ok single line: '182736000'

Test #48:

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

input:

100 1000
56 35
63 33
93 84
30 25
76 68
70 54
53 27
52 39
17 9
56 47
52 6
60 31
19 18
21 13
76 71
14 7
21 5
74 23
63 41
93 14
37 26
63 50
84 62
52 7
30 2
60 55
74 19
70 35
23 12
10 4
52 16
39 26
53 38
45 41
53 18
52 1
63 44
84 58
85 81
21 14
37 15
38 33
52 10
52 50
37 32
93 58
23 19
63 47
39 27
80 29...

output:

13561914

result:

ok single line: '13561914'

Test #49:

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

input:

100 999
77 62
35 8
83 23
77 32
83 36
66 36
91 40
91 2
51 36
91 89
83 8
55 36
77 16
77 25
51 41
66 63
91 7
49 13
78 69
91 17
35 26
15 13
78 71
32 10
51 37
75 29
12 10
29 9
49 7
41 39
68 1
60 59
83 15
85 65
15 5
49 16
83 61
66 41
75 53
85 20
6 1
75 50
55 26
68 9
83 40
91 13
77 14
83 25
4 1
19 11
27 26...

output:

372581168

result:

ok single line: '372581168'

Test #50:

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

input:

100 998
34 24
39 13
46 42
8 6
63 51
17 5
31 25
92 76
34 23
71 56
83 56
93 1
34 12
71 7
80 52
46 40
14 10
80 78
59 39
46 43
89 87
69 64
71 16
92 57
80 62
59 47
49 32
47 5
83 75
59 21
76 75
83 37
83 40
71 52
92 25
83 60
41 15
93 67
41 21
59 58
49 42
80 12
35 22
45 2
93 11
93 60
45 26
16 6
26 4
26 24
2...

output:

55990872

result:

ok single line: '55990872'

Test #51:

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

input:

100 997
30 12
45 38
93 16
39 31
86 33
21 13
44 4
39 33
86 6
30 20
22 6
83 7
52 33
48 45
24 7
48 2
48 37
48 44
93 51
83 71
79 2
65 46
83 72
83 24
65 11
44 17
81 3
44 2
93 20
10 2
65 7
62 61
48 22
81 6
62 9
52 32
29 26
86 19
79 71
65 25
81 78
81 41
52 42
86 65
62 2
83 1
30 29
48 4
19 11
48 25
35 27
48...

output:

67201564

result:

ok single line: '67201564'

Test #52:

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

input:

100 996
82 65
82 26
16 10
75 64
50 30
16 9
89 18
89 20
63 60
27 20
89 17
53 50
82 41
30 15
33 8
24 20
38 17
37 3
28 15
51 19
39 35
34 31
89 2
98 58
98 69
89 66
75 13
50 46
14 9
47 43
48 46
37 14
89 79
74 38
98 79
30 17
37 2
89 44
7 4
98 94
28 11
98 85
37 35
75 62
82 80
66 57
33 24
98 63
98 10
82 37
...

output:

25754269

result:

ok single line: '25754269'

Test #53:

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

input:

100 995
56 40
41 15
85 76
12 7
65 28
60 18
56 8
56 26
87 51
72 12
87 16
77 38
49 11
63 62
93 55
77 62
93 92
56 27
87 71
72 7
12 3
77 64
81 64
87 22
7 1
60 33
61 45
12 8
42 38
81 69
77 6
72 20
41 37
35 1
41 22
87 36
65 12
87 53
83 60
72 9
83 64
87 59
49 7
35 17
35 19
72 6
41 5
13 5
31 4
83 1
41 20
4 ...

output:

66300606

result:

ok single line: '66300606'

Test #54:

score: 0
Accepted
time: 5ms
memory: 20808kb

input:

100 994
46 43
88 70
45 42
68 42
28 24
94 35
68 62
36 6
75 32
68 59
83 58
94 19
71 70
83 7
68 39
94 46
75 29
17 8
94 93
53 4
75 62
68 56
20 11
94 16
60 40
83 36
45 28
53 21
20 6
39 33
49 48
75 54
42 38
82 78
71 28
19 13
94 1
76 42
53 47
59 18
45 34
60 47
94 64
83 18
25 15
59 11
36 12
54 19
75 19
54 9...

output:

30297230

result:

ok single line: '30297230'

Test #55:

score: 0
Accepted
time: 5ms
memory: 21968kb

input:

100 993
48 36
42 27
23 1
96 90
86 9
20 9
74 65
57 40
85 77
85 76
37 29
81 23
19 9
48 15
48 20
85 10
24 4
77 50
52 17
11 1
10 2
64 33
48 38
51 39
30 11
51 42
77 72
83 75
15 6
86 27
86 18
86 11
51 2
42 35
81 38
62 60
24 14
30 14
52 4
64 52
55 50
64 53
14 12
52 18
35 26
48 43
86 48
86 50
19 1
81 42
42 ...

output:

43686427

result:

ok single line: '43686427'

Test #56:

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

input:

100 991
77 66
92 15
63 57
89 1
92 39
59 31
65 51
32 13
42 41
95 45
59 32
29 25
42 16
30 26
92 36
48 39
18 14
24 2
49 44
42 24
95 30
65 60
95 9
32 11
39 26
89 63
24 18
59 7
53 24
95 43
77 28
70 66
95 38
32 22
59 14
89 68
89 54
24 15
18 12
42 21
33 17
59 26
53 36
41 11
49 7
32 14
49 46
54 1
33 15
54 2...

output:

7495528

result:

ok single line: '7495528'

Test #57:

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

input:

100 990
37 4
68 62
21 15
50 19
38 10
55 54
92 84
92 52
74 49
27 25
33 4
40 39
28 20
71 62
72 4
38 7
72 5
55 31
74 37
55 27
92 71
59 2
92 2
92 23
20 15
20 17
92 24
88 34
33 11
85 47
88 14
72 47
28 25
92 63
52 42
92 41
88 18
33 18
12 7
85 21
72 43
55 50
72 28
85 54
37 20
67 58
85 56
74 56
74 57
92 75
...

output:

26697574

result:

ok single line: '26697574'

Test #58:

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

input:

100 160
17 9
48 37
48 35
30 18
48 43
26 24
63 61
55 53
22 21
70 69
85 84
20 6
54 52
38 33
27 25
82 77
20 3
6 4
48 40
20 18
32 31
20 4
17 8
48 41
20 13
30 27
33 31
37 34
38 25
28 21
36 34
30 23
46 45
30 28
26 25
17 14
20 12
6 5
20 16
63 58
17 7
16 12
20 14
20 1
48 47
68 66
82 78
38 27
68 67
13 10
82 ...

output:

38463264

result:

ok single line: '38463264'

Test #59:

score: 0
Accepted
time: 5ms
memory: 20956kb

input:

100 170
43 21
18 16
42 40
87 86
41 38
51 45
80 78
64 58
11 6
54 53
7 2
22 19
42 38
18 9
68 63
43 28
18 15
18 11
16 15
51 50
35 32
42 39
80 77
68 62
8 6
64 60
69 65
41 31
17 15
74 73
17 13
16 10
99 98
18 13
94 92
18 12
64 62
18 6
41 29
43 39
49 45
84 83
41 27
41 26
51 46
35 30
43 30
16 9
43 24
51 48
...

output:

1574052480

result:

ok single line: '1574052480'

Test #60:

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

input:

100 180
24 14
38 16
38 30
48 44
36 34
49 43
15 11
49 48
15 1
12 9
61 58
38 29
10 7
38 18
60 55
38 24
71 68
48 46
15 5
48 45
17 16
74 70
65 64
6 4
65 58
66 65
38 26
24 17
12 3
80 79
85 84
61 59
15 14
38 33
12 5
36 31
38 7
36 33
15 6
21 18
32 30
15 2
15 10
38 14
15 13
60 58
24 16
41 40
38 34
25 23
35 ...

output:

738374400

result:

ok single line: '738374400'

Test #61:

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

input:

100 190
57 56
55 50
55 54
85 84
63 60
37 14
87 84
77 76
31 25
17 15
77 73
74 71
37 11
21 8
37 13
35 34
52 51
46 34
37 20
65 60
21 2
31 24
21 7
12 4
57 53
37 34
55 51
37 9
31 27
55 41
35 22
35 26
31 30
35 29
21 20
37 25
12 3
12 6
55 44
37 27
7 5
55 53
35 31
43 42
21 9
70 62
55 52
80 76
80 73
47 42
55...

output:

56487600

result:

ok single line: '56487600'

Test #62:

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

input:

100 200
57 56
49 43
41 20
29 28
30 11
22 20
30 24
30 23
40 39
5 3
23 20
41 9
41 17
47 39
68 67
41 40
98 97
81 80
41 25
83 80
41 12
50 44
30 28
57 53
40 37
5 4
41 28
41 8
61 58
36 32
41 5
21 18
36 35
74 71
13 7
33 32
41 15
30 19
30 22
45 43
30 21
17 14
47 31
2 1
74 72
30 17
40 38
30 12
66 62
13 10
34...

output:

3604269312

result:

ok single line: '3604269312'

Test #63:

score: 0
Accepted
time: 5ms
memory: 22312kb

input:

100 220
81 75
80 73
36 35
6 3
29 7
45 43
5 3
42 34
23 22
56 55
87 84
53 51
41 38
29 18
50 49
53 49
21 18
29 28
42 38
79 77
17 13
29 10
32 27
50 44
69 66
81 78
11 3
29 3
50 43
71 65
42 36
92 90
10 7
29 15
29 1
20 15
80 74
60 58
81 79
29 2
69 62
19 10
53 52
50 46
71 66
10 8
11 6
68 65
19 13
26 25
37 3...

output:

1741525920

result:

ok single line: '1741525920'

Test #64:

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

input:

100 240
5 1
49 22
60 57
61 58
14 6
49 42
54 51
47 43
47 40
42 35
17 9
38 34
47 37
49 33
42 39
90 89
4 3
23 16
41 40
49 32
33 27
14 10
25 19
36 31
10 8
44 43
36 30
22 20
28 15
25 24
23 13
28 26
14 13
85 84
59 55
23 19
23 15
23 10
31 27
14 11
31 29
45 44
26 24
47 34
79 77
49 19
36 32
69 68
17 15
11 9
...

output:

193082940

result:

ok single line: '193082940'

Test #65:

score: 0
Accepted
time: 5ms
memory: 20732kb

input:

100 260
38 36
19 2
63 60
42 12
66 42
23 18
86 81
76 67
42 37
66 19
42 38
9 7
86 82
42 20
66 57
42 26
65 64
19 17
40 36
94 93
13 5
66 14
66 28
66 5
66 53
66 62
61 55
89 88
23 22
61 54
65 59
53 49
50 47
58 56
42 2
46 45
50 43
17 16
84 83
66 26
38 33
23 12
66 22
66 50
20 14
58 57
38 27
55 49
63 62
61 5...

output:

401054220

result:

ok single line: '401054220'

Test #66:

score: 0
Accepted
time: 5ms
memory: 20896kb

input:

100 280
18 13
79 8
85 82
11 4
33 30
22 21
79 68
25 12
79 53
79 73
29 16
52 50
49 43
45 40
46 38
86 84
79 57
16 15
2 1
14 13
88 84
29 13
36 27
33 31
29 4
79 32
52 47
79 42
10 4
25 24
88 81
60 56
25 18
8 5
10 1
59 56
79 37
79 13
88 86
79 28
23 21
36 24
45 39
60 57
36 28
28 27
29 8
79 72
36 21
79 15
52...

output:

100849092

result:

ok single line: '100849092'

Test #67:

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

input:

100 300
48 45
45 41
51 46
86 78
81 56
58 56
48 43
81 74
54 39
63 57
54 18
70 69
25 13
86 82
71 70
48 5
28 15
81 64
52 50
27 11
25 16
27 21
48 6
48 18
28 26
38 35
28 20
48 25
54 10
49 42
48 22
48 19
24 18
29 23
58 55
54 8
81 77
54 3
48 33
28 24
24 21
81 61
24 23
75 72
48 24
60 55
48 46
54 2
28 5
54 2...

output:

1015443904

result:

ok single line: '1015443904'

Test #68:

score: 0
Accepted
time: 5ms
memory: 20940kb

input:

100 330
10 3
24 3
30 27
62 26
9 2
10 2
62 25
13 4
62 22
30 6
33 31
18 14
20 17
20 19
58 39
33 32
30 2
30 18
62 45
35 26
77 75
62 23
49 27
58 50
49 47
24 12
13 9
62 53
24 1
49 37
62 54
41 31
72 66
57 55
36 35
24 2
58 40
24 7
49 41
35 31
62 48
58 31
52 51
62 8
30 19
67 63
13 8
36 32
36 21
49 48
30 17
...

output:

3356404512

result:

ok single line: '3356404512'

Test #69:

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

input:

100 360
85 83
57 43
38 15
77 73
11 8
11 1
11 6
90 83
38 20
5 2
38 7
44 29
49 46
15 2
57 47
8 4
6 4
66 45
71 7
71 60
57 45
3 1
66 51
64 58
71 5
62 40
71 62
36 20
46 45
37 35
85 84
19 18
44 34
38 5
15 3
44 33
70 69
44 41
75 73
90 88
57 55
44 27
38 8
71 41
15 1
35 34
71 53
38 11
66 65
71 8
7 3
71 1
66 ...

output:

162041408

result:

ok single line: '162041408'

Test #70:

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

input:

100 390
79 74
42 20
18 6
14 13
42 32
26 11
24 8
42 13
76 70
42 38
72 52
42 37
83 77
26 23
76 46
72 65
2 1
42 16
10 7
42 39
72 37
72 6
54 52
72 39
54 46
76 73
83 73
9 5
14 1
54 53
18 9
83 75
76 45
54 21
35 31
44 41
42 36
76 56
42 25
18 10
76 47
18 16
14 12
88 87
72 56
54 14
91 89
63 57
23 22
76 60
63...

output:

184281540

result:

ok single line: '184281540'

Test #71:

score: 0
Accepted
time: 5ms
memory: 21092kb

input:

100 420
53 42
58 56
49 47
31 25
17 10
79 77
21 16
64 37
21 19
32 4
34 1
29 27
81 68
38 36
45 40
95 94
6 5
64 19
57 54
32 31
34 22
75 74
28 22
32 26
16 14
64 17
81 63
49 37
32 18
15 6
64 6
41 36
15 13
21 4
72 61
64 50
34 31
53 25
60 55
15 1
64 1
21 20
28 27
72 63
50 47
60 58
45 43
88 86
34 8
64 51
80...

output:

35498808

result:

ok single line: '35498808'

Test #72:

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

input:

100 460
15 10
79 34
12 6
98 96
79 7
34 30
50 43
64 58
30 28
46 42
79 31
15 3
31 29
66 36
79 19
66 48
66 38
66 13
79 45
79 65
79 78
66 40
79 71
35 24
11 7
46 6
35 27
5 3
46 2
60 58
21 13
31 20
61 58
79 56
21 5
79 66
11 5
94 93
66 45
82 78
34 31
66 16
13 10
66 63
9 7
66 26
79 61
38 32
79 53
63 62
46 2...

output:

1147924806

result:

ok single line: '1147924806'

Test #73:

score: 0
Accepted
time: 5ms
memory: 20544kb

input:

100 500
50 49
28 24
64 63
76 70
76 61
16 3
58 52
11 4
38 18
32 8
76 58
64 54
38 22
35 30
57 52
70 52
76 25
76 2
69 67
76 7
48 31
64 47
7 3
73 72
76 64
87 75
54 53
35 33
35 29
96 95
64 58
60 13
70 63
83 81
60 36
76 42
64 36
64 25
48 28
48 7
32 1
32 31
28 23
48 23
64 18
15 6
64 55
76 3
42 37
76 46
60 ...

output:

1402428828

result:

ok single line: '1402428828'

Test #74:

score: 0
Accepted
time: 5ms
memory: 20592kb

input:

100 550
79 71
98 94
84 27
29 24
60 38
34 27
79 66
70 49
34 30
11 5
34 22
84 55
62 59
42 37
60 47
60 53
50 48
42 6
61 51
61 36
82 78
17 8
60 56
61 13
70 19
24 23
70 44
42 38
90 86
84 2
79 67
42 33
84 43
70 45
84 73
61 56
22 20
42 30
90 89
34 18
70 62
68 67
61 37
2 1
42 22
61 19
9 1
42 9
50 45
34 19
4...

output:

92038956

result:

ok single line: '92038956'

Test #75:

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

input:

100 600
64 62
68 66
25 23
85 80
5 1
68 64
76 29
65 55
76 37
86 83
47 44
15 3
85 84
13 8
30 12
91 82
52 49
12 9
70 56
70 50
70 2
30 19
91 89
48 23
13 2
70 5
91 38
48 31
91 81
76 41
9 7
48 29
91 66
32 7
8 4
76 38
76 27
70 26
52 51
91 90
65 61
17 9
52 15
70 40
25 16
8 5
32 4
76 34
73 72
70 9
70 37
70 4...

output:

71806500

result:

ok single line: '71806500'

Test #76:

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

input:

100 660
74 12
32 22
51 22
74 13
20 8
41 40
71 34
65 62
74 25
51 50
51 31
89 41
46 39
51 15
82 75
82 62
46 23
89 84
46 36
82 4
75 73
51 16
34 29
51 40
82 32
25 19
89 1
89 31
82 21
41 37
71 33
89 46
25 16
89 8
33 26
89 51
71 21
74 52
71 12
71 18
74 8
60 56
82 15
89 81
74 59
46 21
74 36
51 33
71 45
82 ...

output:

445873832

result:

ok single line: '445873832'

Test #77:

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

input:

100 720
84 53
78 47
55 9
66 65
84 49
60 3
34 11
19 4
60 13
73 64
12 5
17 14
60 35
88 86
77 34
68 66
54 52
78 13
41 24
84 2
60 32
55 53
17 16
78 70
78 22
78 15
11 10
76 72
68 30
78 69
68 8
84 78
42 39
78 72
12 4
34 23
17 10
45 30
41 28
17 7
19 10
24 16
84 31
38 37
45 8
68 33
84 7
38 30
55 35
84 11
77...

output:

319151532

result:

ok single line: '319151532'

Test #78:

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

input:

100 790
83 2
31 20
68 13
44 38
83 72
51 49
22 14
29 13
58 28
82 9
46 45
82 77
51 35
70 60
18 1
14 3
47 13
82 75
83 71
68 36
47 24
34 9
18 14
82 45
51 38
58 54
40 39
66 3
36 2
17 3
47 21
22 19
82 47
80 79
36 26
17 15
78 75
82 18
66 61
70 67
32 6
58 37
83 77
18 3
47 6
29 20
73 67
68 39
18 15
58 31
58 ...

output:

59272428

result:

ok single line: '59272428'

Test #79:

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

input:

100 860
33 22
32 29
86 33
84 27
43 40
86 52
84 59
81 74
55 17
44 37
47 31
86 31
26 6
86 24
60 42
43 41
72 64
81 69
72 18
72 48
5 1
30 4
72 63
59 26
21 14
27 9
86 69
84 28
55 5
59 3
59 28
75 49
67 64
11 5
83 82
72 65
59 30
81 13
55 15
81 56
65 54
13 7
86 16
11 10
39 34
86 9
55 6
22 7
44 34
86 27
10 7...

output:

66635796

result:

ok single line: '66635796'

Test #80:

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

input:

100 940
59 56
49 34
88 44
88 56
88 5
59 13
65 43
51 36
60 32
85 76
93 9
88 83
88 50
20 14
85 69
44 13
28 21
36 27
15 6
85 43
60 42
44 27
52 49
29 27
93 76
88 84
85 42
52 21
85 18
36 15
26 24
88 66
60 43
85 28
15 4
51 3
44 15
52 10
93 46
85 51
65 41
88 2
58 27
59 30
52 5
25 12
60 6
93 48
51 26
50 43
...

output:

37067440

result:

ok single line: '37067440'

Test #81:

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

input:

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

output:

45

result:

ok single line: '45'

Test #82:

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

input:

46 1000
24 3
32 10
34 27
31 7
10 4
22 3
13 5
40 24
27 23
36 5
25 16
16 14
34 1
40 30
33 32
45 10
31 12
17 6
45 42
14 4
46 19
19 5
43 2
38 37
27 8
45 20
30 23
40 35
38 24
37 5
26 17
28 24
15 14
19 11
33 1
38 36
23 12
34 7
33 4
28 8
26 16
46 7
46 40
45 11
36 34
42 6
43 15
36 15
17 5
38 35
22 6
21 20
4...

output:

34

result:

ok single line: '34'

Test #83:

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

input:

50 1000
35 16
50 25
47 22
48 7
50 32
39 29
28 12
47 16
46 8
20 2
41 22
34 15
39 28
22 11
33 25
35 11
50 34
42 2
36 19
33 30
39 15
34 11
44 36
9 8
20 14
47 2
20 9
39 10
38 22
11 4
47 20
33 31
39 32
11 6
42 10
27 23
45 10
30 8
20 8
33 22
47 17
21 5
27 4
38 2
31 11
48 32
28 23
35 27
50 18
12 8
50 9
49 ...

output:

65

result:

ok single line: '65'

Test #84:

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

input:

60 1000
50 44
12 11
45 36
45 34
50 8
48 16
24 16
41 25
34 31
45 27
53 17
35 23
46 9
60 19
56 47
24 21
53 51
55 42
50 3
43 13
38 32
25 15
45 33
28 3
3 1
48 36
50 2
17 16
29 5
35 32
5 3
22 11
25 13
46 42
19 12
26 6
49 29
32 30
56 40
59 55
35 11
59 12
43 6
46 5
60 25
44 16
51 47
50 46
42 20
48 7
36 31
...

output:

2581

result:

ok single line: '2581'

Test #85:

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

input:

70 1000
69 9
65 17
69 63
44 6
69 6
39 37
65 54
70 6
36 15
44 17
69 23
62 40
44 13
36 22
69 66
41 16
44 36
29 27
65 62
40 28
70 66
44 42
50 11
69 61
52 1
41 25
52 7
43 38
34 31
65 31
69 51
23 17
39 38
59 5
44 38
34 4
70 42
52 38
48 37
70 8
23 14
19 2
70 23
50 10
37 31
65 56
40 10
48 45
62 55
36 13
40...

output:

152978

result:

ok single line: '152978'

Test #86:

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

input:

80 1000
63 50
72 71
11 8
36 35
49 35
52 29
73 66
57 51
35 14
56 50
32 15
52 35
46 6
73 4
36 19
30 16
36 15
46 17
10 9
14 13
26 24
72 45
3 1
49 19
73 27
53 39
28 27
21 20
65 17
65 63
77 71
63 51
65 9
70 68
36 1
73 53
56 14
52 15
32 16
63 15
31 8
30 4
31 12
49 45
49 24
65 10
65 29
61 60
63 55
52 7
63 ...

output:

354344

result:

ok single line: '354344'

Test #87:

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

input:

90 1000
58 25
41 24
60 22
55 31
60 56
72 7
60 55
41 5
88 8
41 29
60 33
53 14
32 25
60 21
56 51
58 27
53 15
55 5
83 76
88 5
53 51
19 9
53 3
11 10
60 2
83 26
72 51
62 41
62 58
53 38
83 36
53 40
83 4
34 33
57 4
68 56
53 6
55 1
68 50
55 20
81 79
53 41
87 84
62 8
55 25
72 35
58 45
72 17
83 56
60 28
38 24...

output:

3698534

result:

ok single line: '3698534'

Test #88:

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

input:

100 100
8 4
64 63
22 19
7 2
9 6
21 20
32 31
45 44
9 3
29 28
15 13
43 40
7 5
73 71
69 68
51 47
6 5
29 25
30 28
7 3
61 59
39 36
3 1
9 8
48 46
51 49
89 87
12 11
77 74
14 13
82 81
22 17
70 68
22 16
29 24
53 50
61 58
22 20
19 18
41 37
47 46
61 56
72 71
41 40
9 7
51 44
41 39
15 12
43 42
61 60
9 2
51 50
35...

output:

6193152000

result:

ok single line: '6193152000'

Test #89:

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

input:

100 200
57 56
62 61
12 11
32 29
20 17
12 10
34 7
43 42
30 24
37 35
58 56
36 35
54 47
69 68
20 6
20 18
34 18
12 9
23 8
20 10
54 32
93 92
34 6
34 3
43 40
85 84
71 68
53 52
19 17
54 38
8 7
20 15
67 65
54 53
34 19
23 15
20 3
25 24
34 27
53 48
67 56
34 25
66 64
54 43
34 17
83 81
30 28
7 6
34 33
67 63
34 ...

output:

31690057728

result:

ok single line: '31690057728'

Test #90:

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

input:

100 300
17 13
20 17
55 53
66 61
18 10
56 41
30 26
25 22
56 32
44 42
58 10
56 52
87 86
72 54
58 15
20 10
79 78
58 25
58 19
56 14
63 62
37 27
58 48
58 40
56 27
20 16
18 7
8 4
38 30
20 14
58 52
58 51
31 28
56 20
58 21
58 54
72 52
56 4
56 36
37 32
61 60
58 14
66 63
18 13
31 27
56 17
56 35
12 10
44 41
44...

output:

12813072960

result:

ok single line: '12813072960'

Test #91:

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

input:

100 400
32 27
39 26
52 48
28 20
50 38
39 17
68 9
31 11
84 83
50 45
55 30
68 63
91 90
68 19
31 19
84 62
68 20
28 23
55 16
39 28
30 29
31 20
28 26
39 38
31 13
20 9
36 27
39 29
55 31
31 18
84 56
73 72
20 16
55 36
71 65
39 30
36 29
31 9
39 22
84 70
28 9
15 13
61 60
55 4
84 72
20 10
93 92
20 13
6 2
25 17...

output:

7916438792

result:

ok single line: '7916438792'

Test #92:

score: 0
Accepted
time: 5ms
memory: 20888kb

input:

100 500
24 4
14 12
20 16
19 15
24 11
59 47
28 12
59 6
37 19
47 26
64 63
59 29
10 1
64 52
9 4
76 41
64 20
59 52
39 38
37 2
60 54
64 59
59 36
59 38
60 57
59 23
64 57
59 58
21 15
64 35
59 13
37 4
28 22
28 26
30 25
5 1
17 16
59 8
47 30
59 11
47 19
47 20
59 48
76 38
64 4
64 58
64 9
64 36
76 71
76 69
76 4...

output:

12547707616

result:

ok single line: '12547707616'

Test #93:

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

input:

100 600
79 13
79 36
67 55
32 16
67 56
79 77
8 7
80 52
96 92
80 7
70 49
28 4
70 39
51 47
28 12
11 9
80 24
80 14
28 16
50 27
46 27
5 3
32 20
79 16
70 23
53 12
79 19
46 43
50 9
51 49
50 14
39 37
80 56
80 72
11 8
20 15
67 54
58 49
70 31
79 35
80 26
53 16
83 82
41 26
80 20
22 18
79 68
70 22
22 9
53 17
96...

output:

6038113536

result:

ok single line: '6038113536'

Test #94:

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

input:

100 700
81 9
76 38
76 56
58 53
36 34
81 24
67 66
76 60
63 39
73 16
75 62
73 56
25 6
46 29
46 40
10 7
48 42
76 35
9 5
81 16
55 52
46 34
81 58
25 20
15 7
76 25
76 2
51 49
51 5
38 13
63 45
23 14
38 3
76 72
92 85
46 23
55 54
16 7
35 33
51 12
73 10
40 37
76 54
50 45
51 30
73 18
31 28
50 47
35 22
55 45
31...

output:

3231958992

result:

ok single line: '3231958992'

Test #95:

score: 0
Accepted
time: 5ms
memory: 21156kb

input:

100 800
61 19
95 91
97 96
71 24
20 17
64 38
20 12
64 31
81 49
77 6
61 44
81 34
77 58
81 47
56 54
14 6
77 4
57 16
71 22
57 1
95 83
22 18
77 74
77 33
81 56
77 23
61 32
61 39
26 8
93 92
77 55
22 10
20 1
55 42
53 47
63 45
64 47
64 59
79 78
64 30
71 41
53 30
71 7
43 35
57 33
77 25
63 33
14 4
77 7
77 31
5...

output:

2290982832

result:

ok single line: '2290982832'

Test #96:

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

input:

100 900
74 65
64 14
68 41
68 7
66 59
78 19
68 12
92 6
68 31
39 16
17 10
83 22
66 65
52 31
52 41
42 33
78 72
74 73
16 2
52 5
78 16
78 70
68 24
74 68
16 15
68 28
64 13
74 40
83 47
55 53
74 20
60 59
68 19
13 9
78 63
92 56
68 57
52 9
68 65
64 41
78 41
92 49
92 16
83 41
57 47
52 32
78 11
3 1
74 56
78 1
3...

output:

1555533940

result:

ok single line: '1555533940'

Test #97:

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

input:

100 1000
37 23
84 80
24 19
87 39
87 28
68 61
46 13
84 44
53 20
76 54
84 54
84 28
68 32
51 4
52 47
46 39
84 77
57 18
37 10
62 21
87 22
18 3
96 64
8 3
52 3
46 20
46 7
84 62
9 8
68 45
96 28
57 31
52 39
96 59
62 30
87 69
52 44
66 13
72 67
51 25
53 46
62 44
69 67
57 52
52 49
41 39
51 43
87 34
34 5
51 18
...

output:

537203982

result:

ok single line: '537203982'

Test #98:

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

input:

100 999
59 37
96 11
96 61
88 58
96 58
76 33
85 9
8 1
76 66
80 27
55 29
46 12
59 49
43 5
96 92
43 8
88 32
56 34
46 28
60 48
80 28
42 35
88 42
68 61
85 70
43 22
59 50
76 72
24 3
76 45
52 21
85 6
76 20
88 80
85 61
88 6
35 32
88 83
59 28
96 27
85 66
80 25
52 27
55 40
52 25
85 22
43 32
80 31
76 63
46 30
...

output:

575589222

result:

ok single line: '575589222'

Test #99:

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

input:

100 998
58 40
74 29
61 56
61 55
62 59
58 49
42 2
17 13
20 11
74 28
58 32
96 94
32 11
74 48
46 28
58 12
69 20
18 4
68 7
74 30
46 34
68 59
40 2
70 67
87 24
75 45
69 53
97 38
87 20
61 49
75 17
75 70
22 9
49 48
61 37
87 79
46 37
87 51
97 95
15 13
42 35
76 73
40 19
84 82
10 4
14 11
87 64
61 40
69 6
58 46...

output:

478878944

result:

ok single line: '478878944'

Test #100:

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

input:

100 997
41 15
74 65
30 23
69 11
93 59
93 70
89 70
43 29
66 58
55 25
42 39
37 13
81 33
68 27
89 50
81 14
41 27
86 44
42 40
93 16
55 20
89 47
93 22
89 33
86 2
83 79
62 61
69 54
53 52
50 23
43 35
80 79
86 21
89 54
87 77
42 37
81 20
22 18
69 37
63 14
30 15
63 22
55 45
69 33
42 26
81 16
28 22
86 16
32 19...

output:

1295747748

result:

ok single line: '1295747748'

Test #101:

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

input:

100 996
63 39
78 75
87 46
30 25
73 63
73 59
63 28
32 14
94 17
53 25
53 29
77 15
94 30
42 26
58 56
94 10
32 2
73 28
69 2
73 29
26 12
69 63
77 63
37 32
77 73
77 31
19 16
52 45
77 68
87 70
50 47
61 55
52 51
91 89
63 16
32 20
31 30
73 19
69 30
94 26
49 13
21 15
37 19
73 30
53 13
77 52
73 16
94 62
49 35
...

output:

721144191

result:

ok single line: '721144191'

Test #102:

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

input:

100 995
67 62
23 10
75 47
53 28
20 12
8 7
14 7
63 46
77 69
94 65
16 3
73 68
94 39
32 25
16 10
54 23
27 24
16 14
23 14
42 6
77 17
67 60
35 21
54 35
15 12
79 78
54 34
73 71
42 18
94 77
77 61
63 60
77 18
56 43
52 50
67 52
49 30
63 9
67 30
17 7
32 12
66 4
75 16
27 21
49 2
61 59
66 1
77 46
66 29
21 18
49...

output:

553770444

result:

ok single line: '553770444'

Test #103:

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

input:

100 994
38 35
62 42
49 47
36 26
13 1
80 76
97 25
61 4
41 36
62 40
29 10
74 58
97 59
53 48
53 30
36 33
97 49
62 34
71 40
21 2
97 81
46 14
74 1
60 58
41 1
46 5
77 61
21 18
97 58
94 49
71 39
41 40
94 58
53 2
60 24
41 38
74 25
30 16
71 54
94 18
62 38
91 87
30 7
94 11
93 92
77 54
74 8
97 70
77 35
97 57
7...

output:

995395580

result:

ok single line: '995395580'