# Missing Pieces

## Submit

File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

## Problem

You are given the number of edge/corner and middle pieces of a rectangular jigsaw puzzle. Determine how many pieces are missing as a minimum. All puzzles have a size of at least 2x2.
Example: The first puzzle has 135 edge/corner and 1112 middle pieces. The smallest puzzle with at least that amount of each piece type has size 33x38. Therefore the answer is 33 * 38 - (135 + 1112) = 7.

## Options

exec is denied

rejudge feature is enabled

now post-mortem time, all source codes will be revealed

## Sample input:_

```135 1112
124 925
21 0
179 2068
76 247
160 1576
169 1845
134 1170
99 527
19 7
76 316
120 839
120 750
82 377
103 352
92 294
56 185
76 344
50 38
34 50
24 21
21 19
93 83
166 1792
70 294
54 78
109 553
57 231
73 275
24 25
23 0
54 71
66 90
42 73
61 96
71 141
80 195
156 1502
66 214
70 202
80 144
74 120
87 303
32 70
125 897
78 335
50 90
105 619
63 239
170 1802
146 1295
49 0
48 89
118 836
80 425
93 412
108 610
127 973
53 66
57 189
140 1143
167 1785
116 793
92 92
47 17
48 46
20 32
59 192
138 1216
168 1746
35 76
101 575
61 53
106 623
17 26
106 720
121 920
65 227
67 193
114 754
77 107
35 57
68 26
98 568
108 573
74 61
104 652
117 817
120 753
129 926
26 44
134 964
80 70
104 366
74 375
108 498
88 520
119 818
83 461
36 52
154 1478
108 583
52 137
123 710
36 60
13 14
22 26
65 233
139 1196
69 32
28 42
116 668
140 1246
113 626
89 117
108 753
65 129
86 271
130 924
71 285
115 798
21 7
127 809
90 308
32 35
55 149
102 294
171 1848
186 2109
97 130
129 873
137 1113
128 1020
124 964
114 798
24 0
126 1024
50 106
136 1070
97 88
20 32
121 861
94 441
101 328
74 0
89 290
114 559
178 1870
109 723
32 26
100 360
97 549
97 82
57 73
121 922
93 414
141 1179
153 1437
76 228
99 454
90 320
66 59
60 171
154 1547
179 2109
102 475
23 30
91 419
186 2156
23 36
44 87
80 324
118 477
138 1142
112 693
47 0
108 536
67 230
107 755
52 89
87 483
36 10
32 50
116 753
77 197
92 440
144 1296
59 119
170 1708
117 845
46 129
81 338
29 50
139 1048
25 28
116 825
74 370
98 229
26 19
41 42
128 1035
186 2202
137 1119
127 1014
65 202
68 170
67 210
157 1481
30 7
103 589
36 25
85 405
90 364
6 5
25 42
52 21
87 350
133 1173
102 670
63 86
136 1228
53 128
160 1570
63 234
54 219
136 1214
65 87
170 1804
158 1512
78 340
153 1374
53 107
168 1697
130 878
82 397
88 124
149 1362
118 648
102 510
68 114
44 29
135 1139
113 608
84 410
72 330
65 256
69 115
172 1804
102 695
144 1273
76 338
117 791
70 102
138 1174
106 455
104 629
132 1184
76 158
68 201
160 1502
97 367
94 541
91 559
57 113
100 507
94 215
106 601
89 432
77 270
74 257
76 234
157 1598
78 391
106 659
109 485
70 132
115 622
135 1204
61 258
176 1874
124 666
54 46
74 371
74 333
122 915
157 1495
15 15
105 391
80 306
96 370
67 166
149 1472
78 143
56 181
149 1360
31 45
68 252
142 1272
23 20
102 301
94 447
163 1705
108 592
139 1155
169 1702
175 1967
93 412
130 1058
64 246
104 335
78 306
91 377
126 1024
137 1110
133 960
140 1236
142 1317
174 2016
37 80
65 142
77 356
119 752
125 873
67 269
161 1548
152 1394
127 919
112 323
105 522
127 955
111 569
84 0
95 176
70 242
83 452
79 233
80 279
108 325
96 278
63 77
66 242
129 920
51 17
8 0
74 223
115 662
97 369
166 1714
102 312
133 1050
126 1068
57 175
102 450
94 560
103 673
151 1448
66 278
98 319
127 1081
123 1012
119 776
138 987
52 39
129 957
107 592
92 333
102 627
124 736
69 280
159 1430
57 203
104 407
164 1674
115 812
36 65
86 424
117 854
86 469
159 1616
68 280
143 1356
87 72
167 1840
81 372
21 7
77 92
84 438
131 1106
65 219
112 646
59 247
119 731
63 182
145 1241
8 0
118 796
119 829
144 1283
142 1280
144 1342
125 797
69 276
155 1431
91 257
17 1
148 1357
131 1140
139 1175
49 168
130 910
99 522
69 306
131 1028
57 151
60 198
176 1935
175 1824
33 0
99 462
70 277
109 679
65 144
58 195
148 1437
76 290
156 1514
82 148
89 433
154 1591
39 75
95 518
147 1333
71 340
115 423
111 617
112 721
11 0
96 399
80 377
119 856
108 580
84 203
50 137
154 1433
74 262
109 754
30 34
11 0
68 315
110 724
90 474
53 78
77 415
140 1026
36 57
104 393
71 338
60 146
90 152
120 970
116 799
116 680
84 388
92 461
140 1111
112 777
160 1676
70 119
72 59
90 117
79 348
15 0
172 1886
78 218
82 374
167 1842
139 1177
73 299
131 910
54 188
178 1959
45 138
165 1769
133 903
104 642
110 499
119 950
126 942
106 684
63 231
85 381
151 1394
84 41
163 1579
150 1232
77 267
89 349
91 40
28 26
154 1438```

```7
4
1
7
7
12
7
8
1
1
4
1
10
1
5
4
6
5
4
0
0
2
4
10
4
6
10
11
2
0
1
5
4
4
5
5
5
7
6
7
4
4
6
6
3
1
0
2
4
6
2
1
3
3
8
5
2
7
1
6
4
8
9
8
5
6
8
1
6
6
6
4
2
6
11
6
9
2
10
0
6
4
5
6
3
5
12
9
7
11
7
2
2
3
10
9
8
6
8
2
6
6
3
13
0
8
6
2
9
1
2
8
8
9
4
7
2
3
2
1
5
2
4
9
3
5
0
5
5
3
6
4
4
12
6
0
6
4
3
3
8
4
5
1
0
11
2
2
5
2
2
2
9
5
7
3
6
6
6
2
8
3
0
9
12
8
3
2
4
5
4
1
5
7
0
1
12
2
8
6
5
5
2
5
6
8
4
4
2
10
5
1
5
9
1
4
12
9
3
7
7
9
2
6
8
5
9
2
5
1
3
3
8
9
5
2
5
14
8
6
12
8
9
3
12
10
3
4
2
0
3
8
7
4
4
8
6
8
0
4
7
6
10
6
6
3
2
2
9
9
4
2
8
8
11
3
10
4
6
3
4
9
10
5
5
6
7
1
1
5
9
8
6
3
8
8
11
11
11
8
9
0
11
7
7
4
5
10
4
2
7
11
7
3
3
1
0
12
2
2
3
12
2
1
1
8
5
12
5
1
6
8
6
1
7
10
11
10
3
9
4
9
2
4
1
2
4
6
13
3
8
0
5
0
11
8
1
8
4
5
4
1
7
0
3
2
2
6
9
1
15
2
7
6
7
11
8
3
13
12
2
2
5
6
3
4
6
4
3
6
6
5
7
3
3
3
9
12
10
4
13
9
9
3
2
11
6
10
2
2
9
5
5
6
0
4
4
8
6
10
2
5
5
3
6
7
9
6
7
10
6
5
11
2
2
4
1
1
9
5
4
7
2
11
6
7
4
5
10
3
3
5
7
1
10
4
1
9
3
5
9
1
5
4
2
5
2
1
8
3
3
7
12
7
3
7
9
1
4
12
3
2
3
5
9
7
9
3
5
3
5
1
6
10
0
12
4
2
9
10
5
9
16
14
4
7
11
5
8
5
10
3
4
6
10
4
4
4
1
4```

## Ranking

### Ruby_

RankUserSizeTimeDateStatistics
1rotary-o760.09402022/01/09 15:22:010B / 33B / 40B

### Ruby2_

RankUserSizeTimeDateStatistics
1rotary-o750.13742022/01/09 15:21:480B / 33B / 39B
2hako750.52782022/01/09 21:48:440B / 31B / 40B
3angel_p_571050.21742022/01/05 22:24:170B / ?B / ?B

### Perl_

RankUserSizeTimeDateStatistics
1tails860.07132022/01/06 10:06:480B / 26B / 58B

### Python_

RankUserSizeTimeDateStatistics
1xnor980.05272022/01/05 14:58:260B / 60B / 33B

### C_

RankUserSizeTimeDateStatistics
1rotary-o1190.01652022/01/12 00:04:070B / 54B / 65B
2tails1200.01502022/01/11 00:26:400B / 59B / 61B
3rotary-o(tails)1170.01492022/01/12 00:41:430B / 56B / 61B

### Java_

RankUserSizeTimeDateStatistics
1rotary-o2000.17902022/01/12 00:07:170B / 120B / 74B

### AWK_

RankUserSizeTimeDateStatistics
1Fleur851.42832022/01/06 08:13:170B / 37B / 48B

### Bash (builtins)_

RankUserSizeTimeDateStatistics
1tails931.33552022/01/06 11:59:380B / 37B / 50B
2McBusLuck1160.81432022/01/05 19:18:220B / 47B / 61B

### bc_

RankUserSizeTimeDateStatistics
1McBusLuck1190.27812022/01/07 22:06:160B / 56B / 60B

### gs2_

RankUserSizeTimeDateStatistics
1tails281.96082022/01/06 21:19:4410B / 12B / 5B

### Nibbles_

RankUserSizeTimeDateStatistics
1darrenks160.03392022/01/08 12:01:3411B / ?B / ?B
2tails160.09822022/01/08 15:49:0114B / 2B / 0B

### Scala_

RankUserSizeTimeDateStatistics
1rotary-o1193.03072022/01/09 14:15:080B / 71B / 43B

### Language Ranking_

RankLangUserSizeScore
1Nibblesdarrenks1610000
2gs2tails285714
3Ruby2rotary-o752133
4Rubyrotary-o762105
5AWKFleur851882
6Perltails861860
7Bash (builtins)tails931720
8Pythonxnor981632
9Crotary-o(tails)1171367
10bcMcBusLuck1191344
11Scalarotary-o1191344
12Javarotary-o200800