10717 - Mint
Moderator: Board moderators
Input:
- 4 10
54
115
28
103
32
1186
631
812
368
1151
508
540
930
817
28 8
80
104
100
91
41
127
33
130
83
165
16
162
74
76
39
124
141
44
38
169
147
70
106
129
81
25
79
140
964
360
1108
243
1064
160
733
656
52 6
86
117
137
121
33
152
82
107
180
120
182
120
164
20
40
62
41
145
142
73
170
173
165
85
132
24
128
195
183
12
2
69
81
139
141
113
90
22
171
69
94
153
141
9
172
180
22
164
125
163
188
46
887
152
330
219
976
609
76 4
165
158
173
167
178
53
105
118
165
146
92
136
15
137
40
155
145
163
86
118
126
162
32
113
7
119
17
89
137
192
49
53
101
21
19
31
73
123
148
190
69
191
77
35
127
68
141
23
30
26
92
155
188
124
19
146
42
35
186
130
178
35
182
79
7
1
109
80
75
8
21
95
151
49
81
29
516
773
652
745
100 1
199
95
51
138
18
21
35
11
56
21
140
185
7
74
15
13
26
75
44
100
83
64
147
185
64
27
13
131
152
16
27
102
111
77
39
128
98
25
91
105
197
182
89
3
55
56
16
80
130
59
132
164
75
78
148
138
56
161
69
7
176
47
60
86
124
50
166
173
75
8
29
71
189
69
74
44
124
89
123
54
147
54
17
173
83
165
111
91
125
131
49
52
177
109
90
52
158
7
176
32
414
0 0
- 0 8954820
0 8954820
0 8954820
0 8954820
0 8954820
0 8954820
0 8954820
0 8954820
0 8954820
0 8954820
800 1040
0 400
1040 1120
0 400
1040 1120
0 400
700 800
560 700
880 900
144 164
330 330
216 220
972 984
600 612
511 520
770 775
651 660
744 750
414 414
"Everything should be made simple, but not always simpler"
-
- Experienced poster
- Posts: 110
- Joined: Tue May 06, 2008 2:18 pm
- Location: CSE-DU, Bangladesh
- Contact:
Re: 10717 - Mint
Last two cases on the above post are invalid, as, according to problem statement, n <= 50.
You should not always say what you know, but you should always know what you say.
Re: 10717 - Mint
Here's a shorter case.
In:
5 1
72
6
36
20
7
143
0 0
Out:
0 360
In:
5 1
72
6
36
20
7
143
0 0
Out:
0 360
Life shouldn't be null.