11991 - Easy Problem from Rujia Liu?

All about problems in Volume 119. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11991 - Easy Problem from Rujia Liu?

Post by brianfry713 » Thu Jan 03, 2013 10:34 pm

Try the gift I/O from the link here, problem E:
http://uva.onlinejudge.org/index.php?op ... ontest=278
Input:

Code: Select all

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

Code: Select all

13
3
7
13
4
3
8
5
9
0
8
13
8
12
4
5
13
13
13
6
13
17
13
17
4
3
14
5
15
13
4
3
3
4
4
3
13
10
17
7
4
21
0
18
7
7
7
20
7
7
7
0
8
11
7
7
9
7
20
17
7
7
17
17
7
7
17
7
7
6
18
7
5
7
7
8
7
17
7
7
7
14
7
21
17
0
17
0
21
7
7
8
16
20
29
36
1
34
31
25
22
25
31
0
25
22
31
25
15
12
12
24
2
31
37
10
29
5
19
31
12
12
31
24
31
6
27
0
31
18
17
31
0
15
0
0
0
31
21
22
24
12
0
25
31
17
8
31
12
0
27
14
0
7
16
20
21
26
14
28
20
20
9
0
3
8
13
13
9
7
9
10
9
6
1
15
7
0
10
13
11
2
7
7
7
13
10
3
10
7
6
15
10
10
13
7
9
11
1
9
2
1
15
14
12
2
2
6
9
6
5
3
15
0
6
7
4
13
11
0
4
4
3
1
8
8
3
15
6
8
3
1
3
13
7
4
1
6
16
0
24
16
26
10
28
0
24
16
14
6
29
5
0
0
28
6
18
31
8
23
3
0
18
28
24
17
30
21
37
11
16
0
3
11
6
8
2
3
9
2
2
2
9
4
5
12
2
7
0
0
6
7
0
9
1
4
9
6
8
2
4
1
10
8
11
2
12
2
10
0
7
27
16
3
0
27
16
0
20
14
3
23
23
25
8
16
19
0
16
18
27
24
26
7
0
0
27
26
24
0
23
0
26
19
0
0
13
0
0
3
18
3
19
16
24
20
25
0
0
24
24
3
3
7
2
35
7
8
7
16
4
26
8
9
6
5
8
35
4
13
2
36
8
6
28
6
12
38
10
15
9
34
6
1
4
4
4
7
7
2
4
2
1
2
2
4
1
6
2
2
1
1
3
5
1
5
8
6
7
1
7
6
8
8
8
3
1
8
8
5
3
8
6
3
6
7
1
2
8
1
6
3
8
5
4
4
2
8
6
6
8
4
6
8
3
8
1
8
6
6
3
8
1
6
6
7
8
2
8
6
6
3
4
1
3
3
6
3
8
6
3
8
8
6
5
6
8
1
3
5
4
8
8
52
37
36
72
60
60
30
69
19
19
67
17
64
0
0
47
0
72
34
65
38
37
48
22
54
23
0
33
59
17
68
53
0
57
0
24
49
72
68
27
70
27
9
10
0
11
16
11
35
29
9
23
0
41
24
23
14
34
44
14
0
26
36
0
0
22
33
39
34
32
4
36
16
0
0
0
26
0
15
19
0
19
21
21
19
1
1
1
1
2
1
3
3
1
2
2
2
1
3
1
1
1
33
21
33
26
21
38
38
0
23
40
13
8
0
38
14
33
13
17
0
0
33
24
42
30
0
17
33
23
11
11
0
42
40
23
0
33
36
25
33
17
13
40
29
34
0
38
27
30
33
0
17
36
0
29
16
0
38
33
8
38
39
34
9
42
13
45
30
0
31
0
28
0
53
53
0
40
0
53
19
0
36
51
32
26
0
49
37
52
0
0
18
13
27
22
0
31
22
24
33
10
4
21
13
0
27
31
34
7
26
22
9
31
27
12
0
7
10
26
34
15
32
26
28
0
31
27
21
0
0
21
30
22
9
27
31
10
29
31
0
27
10
0
32
0
14
28
20
0
0
0
24
14
0
22
24
13
0
0
12
14
21
16
6
25
27
16
26
26
0
21
17
0
0
21
22
24
0
15
18
24
27
4
16
16
6
4
16
4
4
4
4
13
16
7
9
8
7
4
0
4
9
6
15
0
10
34
34
48
31
10
22
34
0
0
24
0
40
45
36
0
0
26
35
54
22
32
26
39
16
39
0
50
55
0
56
49
0
39
18
41
36
21
36
24
33
33
52
31
57
43
20
0
32
0
10
21
39
35
0
15
41
19
27
33
55
0
41
0
0
0
74
24
47
27
26
23
28
17
37
23
28
43
40
49
26
28
0
29
0
46
33
37
0
36
0
39
36
29
0
4
18
27
41
6
0
38
39
22
46
0
22
0
32
49
0
48
33
28
30
0
46
10
4
37
31
0
49
6
13
4
42
0
0
14
0
13
28
3
41
20
13
44
16
3
17
41
24
18
28
31
0
33
13
29
23
19
32
47
3
8
6
4
4
2
1
0
1
9
9
5
9
3
4
4
4
8
4
4
4
3
2
3
6
4
5
6
3
7
7
3
9
4
4
4
0
4
4
7
4
0
4
4
1
4
4
8
2
2
4
0
4
8
4
4
6
3
9
4
3
2
3
7
3
4
4
1
4
9
4
4
4
8
4
9
0
3
5
9
7
2
4
4
9
4
9
2
9
1
6
6
3
7
6
9
5
7
7
10
5
5
3
12
5
10
5
12
3
7
7
4
12
6
15
5
4
3
1
14
5
1
11
7
0
0
15
11
13
11
5
1
7
1
5
5
5
0
5
7
10
7
6
1
8
5
7
10
11
13
3
9
7
14
13
15
10
5
10
4
5
13
5
10
5
7
7
12
7
1
1
2
9
2
4
5
2
1
2
4
5
6
3
0
2
5
6
5
6
4
7
2
8
8
4
4
4
2
5
2
5
4
9
5
6
3
0
3
3
1
3
6
6
4
1
4
1
7
6
4
3
5
9
6
2
2
9
4
4
1
1
8
3
0
2
9
3
4
8
0
4
2
2
1
4
37
0
3
23
23
4
26
19
33
29
23
4
24
29
4
2
3
23
33
26
4
6
4
33
6
18
26
37
22
0
33
34
4
41
33
33
32
5
41
6
6
33
36
6
28
25
41
2
6
24
29
6
23
4
5
31
31
33
4
3
23
38
0
29
23
23
2
12
12
3
2
1
9
12
10
7
3
2
12
7
8
11
3
11
4
8
2
4
7
3
8
5
3
4
8
7
11
11
6
6
8
0
2
0
2
9
1
2
7
13
8
9
11
0
11
2
2
1
1
11
2
13
6
12
2
1
2
5
11
5
9
2
10
3
1
6
3
2
7
7
2
9
3
3
2
2
3
3
2
3
0
13
8
13
9
8
2
5
14
11
8
5
8
16
8
13
6
5
5
6
6
6
13
8
13
5
8
0
5
8
5
15
5
5
14
0
46
59
20
32
23
52
17
0
49
67
48
0
27
0
13
14
67
21
19
13
0
59
61
0
36
0
39
31
74
0
0
16
31
12
20
35
21
31
14
28
20
8
1
19
35
11
22
33
14
19
3
53
13
15
20
45
17
9
18
46
15
10
1
18
16
31
7
2
19
27
3
36
47
33
8
25
2
5
46
13
16
2
45
13
19
35
39
31
31
30
11
4
17
12
15
2
10
24
41
52
19
16
0
36
48
13
9
11
30
0
34
27
14
12
36
11
29
34
25
18
13
33
0
18
26
29
13
11
15
0
30
6
34
32
51
0
36
23
34
51
18
31
46
5
8
27
16
8
49
20
41
54
19
52
27
0
40
29
34
23
29
0
48
19
34
38
17
41
2
0
27
2
3
7
10
15
17
11
12
6
4
5
2
27
22
2
18
16
15
27
1
5
22
13
19
20
2
18
18
18
28
13
5
4
16
18
8
18
19
13
25
13
9
6
9
19
15
20
0
13
9
32
17
13
18
28
21
37
27
3
13
29
13
15
0
9
27
12
5
9
18
8
8
6
0
6
37
14
5
9
0
23
25
9
9
25
0
21
13
5
28
0
18
6
15
0
19
24
27
39
45
1
38
8
12
34
42
8
10
42
39
48
34
42
14
8
15
0
8
8
12
11
8
8
10
0
3
8
8
8
7
14
0
0
8
8
15
9
8
8
8
8
3
14
5
8
8
8
10
8
10
14
8
8
0
8
12
7
8
8
4
11
8
15
8
8
10
8
8
8
8
4
8
10
0
10
8
8
15
8
4
8
10
8
5
0
15
8
8
8
8
0
0
11
8
8
14
13
8
14
8
11
8
8
11
8
53
52
0
0
42
36
54
52
38
31
52
31
8
3
0
51
47
36
42
53
21
35
12
30
51
31
54
48
0
0
0
46
28
44
0
37
26
57
3
40
14
14
32
23
20
12
51
17
0
25
0
51
0
37
54
46
17
34
47
11
33
17
0
32
54
7
54
3
12
20
37
50
50
32
32
33
13
24
0
11
9
7
0
38
27
39
31
0
21
25
23
0
16
15
27
13
2
9
17
21
5
9
20
1
12
15
2
0
21
10
26
2
18
9
5
19
20
24
21
0
28
4
34
8
48
1
6
41
22
23
19
18
25
70
60
25
1
21
25
37
24
84
65
46
48
28
10
35
28
28
35
0
35
11
10
28
20
0
20
20
30
15
0
32
0
15
28
0
19
20
9
0
28
9
10
28
0
10
7
10
6
0
2
7
7
12
8
9
7
7
7
12
7
10
4
10
9
0
7
6
8
7
8
8
12
7
9
7
7
15
4
14
19
13
11
5
3
12
3
17
15
3
1
13
3
3
4
11
1
7
3
12
2
15
15
12
1
0
12
3
16
4
1
5
5
2
4
3
16
11
11
0
15
2
1
12
10
5
4
3
15
7
2
3
11
15
11
2
3
3
7
3
8
5
5
1
5
3
4
5
7
5
5
7
7
5
5
5
5
5
5
2
5
5
4
5
2
5
1
7
0
7
3
5
5
5
5
7
0
5
5
5
6
4
8
1
7
4
1
5
5
7
16
32
37
39
21
7
16
54
24
24
40
9
1
18
6
11
16
52
5
10
9
54
9
2
10
21
25
16
25
54
50
14
16
3
1
37
45
20
45
1
38
5
14
1
54
54
54
47
16
49
56
27
52
7
7
54
11
7
51
27
35
36
0
54
36
35
1
31
27
8
19
9
0
23
0
0
8
19
0
21
13
7
30
30
21
21
27
27
21
19
27
30
6
30
26
30
7
21
0
29
30
29
21
10
27
14
21
25
21
0
21
30
30
21
0
12
21
1
1
1
1
16
10
8
1
10
1
0
1
14
9
15
1
1
16
0
15
1
1
0
1
16
1
0
1
8
9
8
1
8
6
1
16
0
16
1
8
1
0
1
15
6
14
1
1
1
16
1
8
13
8
0
1
1
18
16
1
0
6
1
0
19
0
26
33
12
8
0
0
33
25
19
19
4
22
7
19
9
12
17
10
20
7
0
7
18
7
11
19
7
20
9
19
10
10
7
22
7
0
7
7
17
0
19
17
19
9
11
15
14
12
21
22
12
6
19
0
20
14
9
4
8
10
0
19
12
0
19
14
10
6
10
7
22
5
17
5
7
18
0
18
10
20
16
0
16
4
16
6
13
11
11
12
10
12
13
11
7
13
2
16
11
16
10
6
6
11
5
13
16
11
11
13
18
11
10
11
16
1
3
1
18
12
17
1
9
12
7
5
5
11
11
18
13
7
9
17
12
1
2
13
5
12
18
5
6
18
11
5
6
23
16
5
15
12
9
18
11
18
23
21
23
23
16
0
6
23
0
8
13
23
6
17
17
0
16
23
23
0
23
0
14
0
23
23
24
23
18
21
0
18
9
6
0
23
15
23
23
18
5
12
26
23
24
7
17
25
0
23
23
23
23
0
26
0
11
0
19
23
23
23
9
23
14
0
23
16
23
19
17
23
23
0
1
4
2
3
2
1
3
4
4
3
2
2
2
2
5
2
0
32
31
21
27
0
23
25
32
33
16
34
32
0
31
32
27
32
33
32
32
0
14
14
0
32
5
32
9
23
12
32
16
32
21
22
14
32
32
13
14
32
32
30
29
32
11
13
32
32
0
21
31
32
32
32
25
32
32
0
13
23
37
0
0
5
17
16
35
32
28
33
30
0
32
32
32
0
34
31
32
0
16
11
0
30
25
32
0
32
15
23
12
17
32
6
32
32
18
32
9
11
13
7
14
16
4
13
7
8
0
18
7
15
5
9
8
0
0
12
11
7
15
6
9
9
5
11
8
2
0
10
6
7
1
7
7
10
0
5
11
0
9
6
7
11
10
15
3
16
7
8
14
14
7
9
5
9
18
13
10
0
7
3
0
3
16
16
0
2
7
5
15
12
18
5
8
5
3
0
7
5
11
5
13
4
16
9
8
0
7
3
0
36
28
0
19
21
0
7
0
0
14
11
26
15
26
18
38
34
38
21
21
22
16
18
0
15
9
0
9
0
37
32
4
28
19
37
4
27
33
34
29
14
32
17
38
31
19
36
9
12
14
15
9
37
33
0
26
4
4
0
4
10
2
4
0
4
3
4
6
9
12
4
9
7
9
2
2
5
2
9
9
2
2
0
8
10
0
2
2
2
0
2
7
2
8
7
0
0
9
7
2
0
2
8
4
5
2
10
2
20
20
26
12
20
26
2
27
18
21
13
14
15
11
28
7
11
12
12
6
0
11
2
20
15
15
12
0
26
0
4
11
10
15
10
17
10
0
0
10
19
0
16
10
10
11
14
11
11
11
11
10
17
0
10
0
12
0
10
11
10
15
15
17
12
11
10
10
18
0
8
0
10
0
17
11
12
8
12
8
13
8
11
11
15
13
0
10
0
16
10
17
12
10
17
17
15
14
10
18
11
17
5
0
8
11
0
19
7
0
7
4
12
14
10
30
0
0
49
0
0
12
0
0
28
26
50
55
30
0
56
11
12
49
30
13
32
12
49
12
16
19
33
37
32
26
0
12
12
23
0
3
11
19
0
17
12
6
16
17
7
21
8
7
13
12
12
7
12
7
3
22
21
1
0
9
14
15
3
1
15
6
19
6
1
1
1
15
21
15
9
2
17
14
15
15
13
13
12
7
0
6
17
7
1
1
15
15
15
11
15
4
15
12
15
1
14
17
19
2
15
1
9
14
13
17
15
11
18
5
1
2
15
15
2
10
19
7
1
13
11
6
13
6
0
0
19
11
13
1
1
19
7
21
21
7
3
13
13
1
15
21
8
12
15
2
16
7
8
13
6
3
5
2
1
7
7
5
7
1
5
5
3
1
4
3
6
1
11
11
6
1
3
1
3
3
3
9
2
3
7
11
2
4
6
3
4
12
30
4
35
53
48
56
21
24
27
70
4
36
29
10
3
36
17
35
20
4
42
40
60
38
35
9
21
54
9
17
10
46
17
21
9
48
23
53
70
25
0
2
2
12
2
20
1
4
2
9
7
5
11
12
8
2
21
15
5
2
3
2
6
2
10
9
5
2
8
21
8
2
12
6
9
6
7
2
10
20
11
9
7
2
20
3
9
21
4
4
3
2
16
0
2
0
2
6
0
2
9
16
3
2
0
2
2
20
2
2
2
4
21
10
2
27
17
21
8
0
22
27
15
28
29
12
27
29
29
22
10
20
0
26
29
18
6
0
2
29
29
0
2
23
0
11
0
29
17
7
29
10
25
23
20
13
10
25
9
23
29
29
25
27
29
0
16
0
20
29
0
0
20
19
25
13
14
9
29
25
18
6
14
18
10
19
29
22
29
22
13
25
15
16
29
23
23
14
14
29
0
0
22
6
10
0
23
22
23
22
29
29
0
27
5
8
3
13
8
6
8
1
1
1
14
7
12
12
6
0
0
3
0
7
1
4
4
9
1
14
1
1
14
10
6
1
14
14
12
2
1
1
1
1
4
1
3
5
4
3
5
2
4
3
3
2
1
1
2
3
2
1
3
3
2
1
3
4
2
1
5
1
3
1
2
3
1
3
3
1
2
1
3
1
1
3
3
1
3
3
2
4
1
3
5
5
3
5
5
1
1
5
1
3
1
1
1
3
4
1
2
1
5
4
1
1
3
3
3
5
1
1
3
3
3
2
1
4
2
1
3
2
3
1
3
2
4
3
14
6
18
18
18
11
15
16
14
18
2
14
0
2
18
4
22
17
5
4
11
2
18
7
18
4
0
4
15
18
5
12
11
18
0
1
0
0
6
18
0
7
2
9
5
18
6
3
18
0
18
2
18
11
9
18
17
10
18
18
4
18
10
18
12
15
6
18
18
4
18
17
12
8
9
13
5
20
2
1
6
4
7
15
15
3
11
15
9
18
15
0
0
3
0
15
18
0
18
11
10
18
3
10
0
14
19
10
8
10
18
15
4
18
15
7
0
19
16
18
15
15
16
5
6
15
18
0
14
15
12
14
19
9
5
5
15
14
0
16
18
17
15
15
18
10
15
16
15
9
20
16
10
15
18
9
12
17
10
20
10
15
15
18
17
15
15
15
0
18
15
10
13
19
4
16
19
10
1
14
7
2
18
8
18
17
16
12
9
13
0
2
19
5
18
17
2
8
0
12
9
20
13
0
14
0
0
0
1
18
9
6
6
14
0
6
10
5
6
6
0
5
5
10
8
36
15
23
0
46
15
15
8
51
41
38
51
15
41
38
35
0
15
35
51
0
36
43
17
54
0
19
17
28
6
0
33
6
25
8
0
4
40
0
43
32
7
3
9
14
34
12
0
20
6
41
29
18
34
21
14
18
18
9
9
21
0
31
0
35
1
15
42
21
0
44
21
21
34
34
28
0
9
1
18
0
28
21
21
9
1
0
37
23
43
15
10
33
37
1
14
17
1
29
21
13
35
2
0
41
39
38
35
21
21
9
12
46
46
21
21
20
21
3
16
29
32
15
27
34
14
9
9
17
31
11
12
17
31
22
34
31
26
10
33
0
36
4
7
8
14
0
29
31
27
10
24
21
31
0
4
30
32
5
8
12
26
29
23
20
27
5
0
11
18
26
21
25
13
17
5
5
31
22
30
31
36
5
22
23
0
35
28
0
5
26
5
24
0
3
23
2
8
5
5
6
3
12
2
1
10
1
2
2
13
10
7
2
2
7
6
1
2
5
10
6
4
5
2
2
2
7
3
2
5
19
7
12
17
4
5
4
15
1
4
3
3
19
5
9
5
12
10
18
4
13
0
2
9
1
3
18
5
16
5
0
13
0
0
14
1
3
10
13
12
0
18
14
5
2
13
14
10
3
12
6
3
5
5
7
2
1
1
10
18
18
8
10
18
13
4
12
6
11
5
5
19
13
13
16
16
20
5
4
10
19
1
6
6
18
1
1
17
3
19
5
6
12
12
1
4
6
0
0
16
0
14
5
15
0
0
7
13
4
0
12
6
12
19
0
17
18
19
19
4
18
19
18
9
3
8
6
6
0
13
0
1
13
0
8
13
0
13
4
15
6
7
15
5
0
8
9
3
0
3
0
6
16
12
8
0
1
6
8
9
15
4
17
17
29
41
21
39
24
21
8
14
34
34
19
45
35
28
0
9
45
36
0
13
31
19
45
0
43
27
0
32
0
35
20
35
12
11
13
0
11
4
7
1
19
1
17
0
8
0
23
19
13
11
9
25
11
16
0
3
0
9
22
22
23
24
20
18
0
11
23
0
1
7
14
12
0
3
11
21
3
18
14
24
7
0
9
9
0
5
0
0
1
5
0
6
11
9
10
4
0
5
7
13
0
3
16
4
9
0
13
12
11
23
4
3
5
21
12
13
6
4
6
2
3
12
3
12
19
7
9
14
0
23
13
6
3
11
5
3
3
13
9
11
14
16
20
1
3
6
6
17
3
6
6
13
13
21
12
4
12
23
20
6
21
10
4
13
17
6
13
14
5
14
8
0
17
10
13
2
6
6
0
22
13
1
8
6
14
13
3
12
3
17
0
10
14
23
1
2
8
13
6
0
5
22
0
4
22
11
22
23
8
10
0
11
8
14
18
0
0
12
0
0
6
19
18
9
3
11
23
21
6
7
8
12
15
23
0
10
5
18
5
8
16
5
20
10
23
1
11
8
8
20
8
21
18
9
8
11
18
7
15
15
15
16
6
0
8
16
31
30
24
32
11
16
19
18
19
12
14
10
0
25
23
10
0
16
24
0
0
25
17
32
0
18
0
35
31
32
0
16
30
11
26
0
16
19
12
13
23
9
12
0
6
12
11
5
0
15
10
14
0
6
6
17
8
12
12
6
0
12
10
9
7
12
4
13
17
0
17
17
15
17
14
0
3
8
16
6
12
15
0
9
8
9
0
12
6
17
0
15
8
8
7
12
11
17
6
12
15
6
3
17
11
0
10
6
12
12
17
17
0
3
6
0
0
0
10
0
15
0
9
0
0
6
6
0
10
6
9
11
17
9
0
15
16
5
15
13
7
16
14
8
7
0
0
1
0
14
14
16
13
14
11
4
0
0
8
13
11
1
17
6
1
7
7
7
4
0
3
4
0
10
4
14
13
0
10
7
1
9
7
12
7
0
9
0
7
0
8
13
4
17
4
2
4
2
4
2
2
1
2
4
1
4
5
2
1
4
4
5
1
2
12
4
12
10
7
4
10
1
5
5
12
11
0
2
10
10
4
12
7
2
4
12
7
7
12
7
0
35
34
20
2
34
41
31
11
7
15
13
27
35
26
17
31
12
13
2
34
11
12
4
6
27
34
40
6
13
25
45
26
31
13
5
1
2
3
0
5
2
4
7
1
1
2
1
2
4
4
8
2
4
2
1
8
5
1
0
3
3
1
1
1
2
1
4
4
5
5
3
4
4
1
0
6
5
4
5
5
1
1
5
5
3
0
4
2
0
6
6
2
0
4
6
5
5
1
1
7
2
1
6
1
6
4
5
5
2
2
5
2
2
0
2
5
6
5
2
0
2
3
7
2
5
1
7
5
3
4
60
15
37
41
25
54
19
17
5
14
8
31
49
53
23
22
1
28
23
44
4
20
27
5
28
16
8
8
37
58
23
26
30
22
49
20
33
30
47
22
17
14
23
40
2
22
33
24
37
21
6
8
11
8
46
55
41
18
25
26
26
39
8
37
54
3
44
5
5
29
23
62
22
11
5
0
5
9
15
12
0
9
11
5
18
12
18
5
10
18
17
14
0
9
5
5
8
5
5
5
16
5
11
7
18
11
5
5
0
14
5
5
0
18
7
5
5
3
0
8
21
3
11
3
0
18
0
4
14
18
20
0
15
11
8
7
20
3
9
10
4
20
18
11
18
18
18
17
0
16
20
4
4
3
0
20
3
14
19
0
4
6
17
10
19
0
9
4
32
32
2
30
32
4
16
12
28
5
30
1
8
1
29
19
18
14
14
29
1
6
25
12
1
19
16
32
5
2
23
1
23
1
15
27
23
32
22
15
29
2
29
13
6
4
15
5
1
19
6
23
10
2
2
27
2
15
29
8
26
31
29
17
29
32
10
15
16
10
1
18
12
10
21
4
8
15
1
18
14
2
14
29
22
5
1
6
5
2
5
6
9
10
5
9
9
9
9
8
11
9
11
11
2
2
5
6
2
6
6
3
6
2
6
5
7
5
3
2
7
5
5
5
2
4
9
3
11
4
2
10
4
5
8
4
3
5
9
10
6
2
5
2
9
6
7
11
9
3
3
8
10
10
0
34
11
24
31
13
16
21
17
23
16
26
29
29
27
29
16
22
3
26
16
30
7
16
5
0
35
12
10
25
33
32
37
16
15
14
10
14
33
23
1
0
31
0
34
10
23
16
31
28
1
23
16
20
19
10
10
16
0
23
11
1
6
1
1
8
11
7
3
16
8
15
4
11
11
9
8
8
13
0
15
1
0
17
13
2
19
10
18
13
Check input and AC output for thousands of problems on uDebug!

zlshang
New poster
Posts: 4
Joined: Wed Jan 02, 2013 8:51 pm

Re: 11991 - Easy Problem from Rujia Liu?

Post by zlshang » Fri Jan 04, 2013 7:02 pm

I think I can find my fault with your I/O.. Thanks ! :D But may I ask you a question ? How can you foud these I/O which you provide for me ? :D :D I'm sorry! I am green hand in this website!

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11991 - Easy Problem from Rujia Liu?

Post by brianfry713 » Fri Jan 04, 2013 9:47 pm

The problem statement lists that this was from the contest: Rujia Liu's Present 3. I went to "Contests", "Past contests", and found the link below and go to "Problem Descriptions" for a path to the zip file containing the gift I/O.
http://uva.onlinejudge.org/index.php?op ... ontest=278
http://uva.onlinejudge.org/contests/278 ... _files.zip
Check input and AC output for thousands of problems on uDebug!

raj
Learning poster
Posts: 78
Joined: Fri Feb 15, 2013 5:39 pm

Re: 11991 Time Limit Exceeded

Post by raj » Sat Sep 28, 2013 7:38 pm

facing Time Limit Exceed Need Help :( :( :(

Code: Select all

import java.io.*;
import java.util.*;

class IntegerPairr implements Comparable {
    Integer _first, _second;
    
    public IntegerPairr(Integer f, Integer s) {
        _first = f;
        _second = s;
    }
    
    public int compareTo(Object o) {
        if (this.first() != ((IntegerPairr )o).first())
            return this.first() - ((IntegerPairr )o).first();
        else
            return this.second() - ((IntegerPairr )o).second();
    }
    
    
    
    Integer first() { return _first; }
    Integer second() { return _second; }
}


public class Main{

	/**
	 * @param args
	 */
	public static void main(String[] args)throws IOException {
		BufferedReader k = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader k = new BufferedReader(new FileReader("D:/Uva-input.txt.txt"));
		BufferedWriter z = new BufferedWriter(new OutputStreamWriter(System.out));
		String line;
		while((line = k.readLine())!=null){
			StringTokenizer s = new StringTokenizer(line);
			int n = Integer.valueOf(s.nextToken());
			int m = Integer.valueOf(s.nextToken());
			ArrayList<ArrayList<IntegerPairr>> list = new ArrayList<ArrayList<IntegerPairr>>();
			StringTokenizer ss = new StringTokenizer(k.readLine());
			int [] y = new int[1000000+1];
			for(int u = 0; u<=100000; u++){
	            // blank neibogur banlam ta protekkek node er sathe adjlist er sathe add korlam... 
	            ArrayList<IntegerPairr>  Neibhour = new ArrayList<IntegerPairr>();
	            list.add(Neibhour);
	        }
			int c = 1;
			while(ss.hasMoreTokens()){
				int num = Integer.valueOf(ss.nextToken());
				y[num]++;
				list.get(y[num]).add(new IntegerPairr(num,c));
				c++;
			}
			while(m-->0){
				StringTokenizer r = new StringTokenizer(k.readLine());
				int occ = Integer.valueOf(r.nextToken());
				int value = Integer.valueOf(r.nextToken());
				int ans = 0;
				for(int d = 0;d<list.get(occ).size();d++){
					if(list.get(occ).get(d).first()==value){
						ans = list.get(occ).get(d).second();
						break;
					}
				}
				z.write(ans+"");
				z.newLine();
			}
			z.flush();
		}
	}
}

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11991 run time error

Post by brianfry713 » Tue Oct 01, 2013 11:01 pm

You need to precompute the answer for all possible queries.
Check input and AC output for thousands of problems on uDebug!

rafid059
New poster
Posts: 13
Joined: Thu Feb 27, 2014 6:35 pm

Re: 11991 run time error

Post by rafid059 » Fri Jul 18, 2014 2:13 pm

brianfry713 wrote:You need to precompute the answer for all possible queries.
i don't get it. please explain

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11991 run time error

Post by brianfry713 » Fri Jul 18, 2014 8:59 pm

For each test case, start with 1,000,000 empty vectors. For each of the n elements, push it's location to the back of that element's vector. Then you can answer each query in constant time.
Check input and AC output for thousands of problems on uDebug!

rafid059
New poster
Posts: 13
Joined: Thu Feb 27, 2014 6:35 pm

Re: 11991 run time error

Post by rafid059 » Mon Jul 21, 2014 11:39 pm

thanks.. that really helped :)

lighted
Guru
Posts: 585
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 11991 run time error

Post by lighted » Tue Jul 22, 2014 12:29 pm

I solved it by sorting array first by number and second by position.

After sorting i counted occurrence of each number in O(n).

For each query i made binary search. :)
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman

ssavi
New poster
Posts: 28
Joined: Thu Nov 20, 2014 9:57 pm

Re: 11991 - Easy Problem from Rujia Liu?

Post by ssavi » Thu Dec 11, 2014 8:45 pm

I Am Getting TLE ?? My code works for test inputs and inputs of heres . What shoukd i do ?? ho can i optimize ?? Please help . here is my code .

Code: Select all

#include<stdio.h>
int main()
{
    long long int a[100001], i, j, m, n, x, y, k, loc, count;
    while(scanf("%lld %lld",&m,&n)==2)
    {
        for(i=1;i<=m;i++)
            scanf("%lld",&a[i]);
        for(j=1;j<=n;j++)
        {
            scanf("%lld %lld",&x,&y);
            count=0;
            for(i=1;i<=m;i++)
            {
              if(a[i]==y)
              {
                count++;
                if(count==x)
                {
                    loc=i;
                    break;
                }
                else if(count!=x)
                {loc=0;}
              }
            }
            printf("%lld\n",loc);
        }
    }
    return 0;
}
I know I am a Failure Guy . :(

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11991 - Easy Problem from Rujia Liu?

Post by brianfry713 » Thu Dec 11, 2014 9:19 pm

Try reading the solution descriptions in this thread. Your running time for each test case is: O(n * m), you can solve this problem in O(n + m + max_v).
Check input and AC output for thousands of problems on uDebug!

uohzxela
New poster
Posts: 4
Joined: Thu Jan 01, 2015 2:51 pm

Re: 11991 - Easy Problem from Rujia Liu?

Post by uohzxela » Sun Jan 04, 2015 3:13 pm

I'll appreciate it if you guys can give me hint how to optimize my Java solution. I'm sure the algorithm is asymptotically performant (I followed brianfry's suggestion); I think I/O is the bottleneck here. I ended up using BufferedReader and StringTokenizer but still TLE. Any ideas?

Code: Select all

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.StringTokenizer;

class Main {
	public static void main(String args[]) throws IOException, URISyntaxException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		String input;
		while ((input = br.readLine()) != null) {

			if (input.equals(""))
				break;
			StringTokenizer r = new StringTokenizer(input);
			int n = Integer.parseInt(r.nextToken());
			int m = Integer.parseInt(r.nextToken());
			String[] numbers = br.readLine().split(" ");
			ArrayList[] map = new ArrayList[1000000];
			int num;
			int i1=0;
			for (String s : numbers) {
				num = Integer.parseInt(s);
				ArrayList<Integer> list = map[num - 1];
				if (list != null) {
					list.add(i1 + 1);
					map[num - 1] = list;
				} else {
					list = new ArrayList<Integer>();
					list.add(i1 + 1);
					map[num - 1] = list;
				}
				i1++;
			}
			int k, v;
			StringTokenizer r1;
			for (int i = 0; i < m; i++) {
				input = br.readLine();
				r1 = new StringTokenizer(input);
				k = Integer.parseInt(r1.nextToken());
				v = Integer.parseInt(r1.nextToken());
				int ans;
				ArrayList<Integer> list = map[v - 1];
				if (list != null) {
					if (k - 1 < list.size()) {
						ans = list.get(k - 1);
					} else {
						ans = 0;
					}
				} else {
					ans = 0;
				}
				out.printf("%d\n", ans);
			}
		}
		out.close();
	}
	

}

Zyaad Jaunnoo
Experienced poster
Posts: 122
Joined: Tue Apr 16, 2002 10:07 am

Re: 11991 run time error

Post by Zyaad Jaunnoo » Mon Jan 05, 2015 8:21 pm

lighted wrote:I solved it by sorting array first by number and second by position.

After sorting i counted occurrence of each number in O(n).

For each query i made binary search. :)
After sorting, use lower_bound to find if the element v is in the list.
If it is found, add (k - 1) to its index.
If the new index is within range and points to an element v, output its position.

ricardodps
New poster
Posts: 1
Joined: Tue Jan 06, 2015 2:32 am

Re: 11991 - Easy Problem from Rujia Liu?

Post by ricardodps » Tue Jan 06, 2015 2:43 am

uohzxela wrote:I'll appreciate it if you guys can give me hint how to optimize my Java solution. I'm sure the algorithm is asymptotically performant (I followed brianfry's suggestion); I think I/O is the bottleneck here. I ended up using BufferedReader and StringTokenizer but still TLE. Any ideas?

Code: Select all

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.StringTokenizer;

class Main {
	public static void main(String args[]) throws IOException, URISyntaxException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		String input;
		while ((input = br.readLine()) != null) {

			if (input.equals(""))
				break;
			StringTokenizer r = new StringTokenizer(input);
			int n = Integer.parseInt(r.nextToken());
			int m = Integer.parseInt(r.nextToken());
			String[] numbers = br.readLine().split(" ");
			ArrayList[] map = new ArrayList[1000000];
			int num;
			int i1=0;
			for (String s : numbers) {
				num = Integer.parseInt(s);
				ArrayList<Integer> list = map[num - 1];
				if (list != null) {
					list.add(i1 + 1);
					map[num - 1] = list;
				} else {
					list = new ArrayList<Integer>();
					list.add(i1 + 1);
					map[num - 1] = list;
				}
				i1++;
			}
			int k, v;
			StringTokenizer r1;
			for (int i = 0; i < m; i++) {
				input = br.readLine();
				r1 = new StringTokenizer(input);
				k = Integer.parseInt(r1.nextToken());
				v = Integer.parseInt(r1.nextToken());
				int ans;
				ArrayList<Integer> list = map[v - 1];
				if (list != null) {
					if (k - 1 < list.size()) {
						ans = list.get(k - 1);
					} else {
						ans = 0;
					}
				} else {
					ans = 0;
				}
				out.printf("%d\n", ans);
			}
		}
		out.close();
	}
	

}

Hi @uohzxela, I had a hard time with this dmn problem because its very time sensitive. Finally I got AC

You have to take out the Array Initialization on the while, becouse that takes time (1000000 each )
ArrayList[] map = new ArrayList[1000000];

I know that cause a new problem (Old values). For that you should use some way to validate that you are not reading old data. I created an array like:
testCaseNum[ 1000000]

and then every time I access the map I do something like:
testCaseNum[pod] != currentTestCase


Also try to use StringTokenizer instead of split.

It seems like the code is easier to AC with c++ :S

waled_salah
New poster
Posts: 7
Joined: Fri Dec 06, 2013 3:38 pm

Re: 11991 - Easy Problem from Rujia Liu?

Post by waled_salah » Mon Jan 26, 2015 12:25 am

got TLE , are there improve ?

Code: Select all

package Main;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.StringTokenizer;

public class cxz {

	public static void main(String[] args) throws IOException {
		
      StringBuilder sb = new StringBuilder("");
      Scanner sc = new Scanner(System.in);
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      String first="";
      
      while((first=br.readLine())!=null)
      {
    	  StringTokenizer st = new StringTokenizer(first);
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		
		Hashtable<String,Integer>map = new Hashtable<String,Integer>();
		Hashtable<String,Integer>map2 = new Hashtable<String,Integer>();
		
		
		 st = new StringTokenizer(br.readLine());
       for(int i = 0 ; i < n ;++i)
       {
    	 int num = Integer.parseInt(st.nextToken());  
    	  if(!map2.containsKey(num+"")) 
    	  {
    		  map2.put(""+num, 1);
    		  if(map.containsKey(num+" "+map2.get(num+"")))
    		  map.put(num+" "+(map2.get(num+"")), i+1);
    		  else
    			  map.put(num+" "+1, i+1);
    		  
    	  }
    	  else
    	  {
    		  map2.put(num+"", map2.get(num+"")+1);
    		  if(map.containsKey(num+" "+map2.get(num+""))||map.containsKey(num+" "+1))
        		  map.put(num+" "+(map2.get(num+"")), i+1);
        		  else
        			  map.put(num+" "+1, i+1);
    		  
    	  }
    	  
       }
       while(m-->0)
       {
    	   st = new StringTokenizer(br.readLine());
    	   int s = Integer.parseInt(st.nextToken()),f=Integer.parseInt(st.nextToken());
    	   if(map.containsKey(f+" "+s))
	      System.out.println(map.get(f+" "+s));
    	   else
    		   System.out.println(0);
		
       }
       
      }
     
      
	}

}


Post Reply

Return to “Volume 119 (11900-11999)”