-
Notifications
You must be signed in to change notification settings - Fork 23
/
random.input
executable file
·100000 lines (100000 loc) · 380 KB
/
random.input
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
752
925
634
454
862
488
775
797
452
254
708
266
987
371
75
162
196
520
784
103
234
827
486
821
107
607
676
770
213
397
742
477
293
925
229
741
233
922
365
941
870
982
621
318
461
828
276
530
936
121
257
51
235
999
768
321
760
426
894
442
34
158
226
59
261
355
0
662
155
390
962
937
571
89
825
241
753
201
239
252
225
758
890
353
641
881
586
370
70
299
603
287
766
571
541
92
230
303
521
703
197
242
56
428
762
59
59
34
350
65
574
994
26
196
95
835
286
407
491
748
573
170
829
698
541
366
464
243
485
540
660
123
48
21
412
944
573
208
560
34
991
611
544
647
239
149
918
525
185
214
309
465
981
209
651
690
510
683
612
771
763
626
443
836
899
54
857
642
799
9
821
559
92
91
404
803
689
625
455
600
491
613
205
599
370
502
307
650
767
651
536
406
459
838
603
478
39
936
4
465
894
732
722
976
8
531
788
675
52
31
532
479
401
561
73
56
362
191
171
566
48
449
593
124
718
2
481
236
383
370
247
937
922
609
921
399
686
144
290
303
6
579
887
636
525
253
954
876
141
701
538
185
154
825
327
952
896
466
271
874
894
20
746
207
491
102
398
848
697
360
61
172
231
895
438
176
111
269
664
463
560
309
14
874
753
75
329
46
895
91
350
290
796
333
330
277
604
469
211
23
725
602
34
505
116
590
548
512
713
557
509
542
832
364
504
385
952
884
444
480
418
806
139
870
855
621
466
467
60
917
495
700
756
379
292
68
597
695
398
114
361
210
403
813
974
654
229
613
947
400
353
988
523
104
301
324
822
464
741
111
36
794
554
672
687
710
197
701
178
184
565
981
675
828
115
483
2
236
792
2
299
531
109
45
448
332
958
371
822
383
99
587
857
97
267
471
423
636
666
117
239
822
203
581
193
542
418
82
681
39
366
766
21
51
361
921
384
304
120
75
488
60
632
319
460
81
532
259
566
345
552
320
799
928
229
648
918
616
75
397
48
346
33
395
128
137
942
116
491
453
491
121
275
897
356
78
673
743
243
206
260
460
668
737
734
388
398
778
406
907
601
815
263
990
86
490
832
846
493
936
115
442
639
734
942
145
576
591
173
165
149
309
736
945
562
656
761
316
386
15
394
499
672
904
514
632
468
537
288
866
110
344
963
982
138
462
786
826
203
989
927
586
650
272
22
343
777
780
495
213
274
934
139
259
771
595
591
107
55
502
560
8
186
203
705
347
386
454
457
119
700
800
740
194
854
179
417
421
455
299
89
667
542
399
545
348
394
844
821
90
764
649
250
91
233
51
186
310
256
265
731
241
2
880
114
342
327
521
740
64
968
997
902
406
589
380
13
617
354
970
646
946
612
972
939
268
950
813
757
69
555
705
168
875
347
558
7
30
868
732
729
948
792
824
789
369
599
630
67
429
236
169
955
612
831
246
51
980
438
453
870
138
692
872
972
816
71
38
629
695
594
188
922
412
249
13
91
798
660
438
944
584
611
664
85
313
280
897
103
984
126
629
81
210
371
512
679
924
337
506
960
877
40
940
612
311
814
214
13
927
151
908
58
52
461
349
697
121
827
286
512
20
219
131
784
260
546
348
47
52
326
253
361
437
904
503
397
468
285
856
169
870
735
424
940
146
89
152
618
779
422
282
411
292
261
615
84
185
209
862
347
316
659
633
309
90
109
427
956
143
21
770
440
835
350
626
932
325
410
606
402
502
285
895
10
647
116
914
868
674
488
963
106
202
223
396
36
599
771
349
682
727
864
203
340
533
579
137
99
658
387
929
359
713
577
48
854
886
885
22
816
391
626
415
946
262
45
631
815
887
289
722
837
698
705
136
190
491
870
224
598
749
33
702
494
516
444
422
29
380
813
552
62
899
607
513
47
950
39
387
201
550
152
452
921
385
770
426
883
672
484
542
277
312
815
654
665
845
697
220
979
700
845
550
522
663
542
711
652
145
920
135
564
578
868
847
263
954
646
431
388
147
272
376
910
497
846
341
823
830
551
517
622
444
335
183
295
584
473
872
683
995
983
413
54
327
820
185
605
792
78
345
428
251
62
115
239
42
916
785
530
942
467
444
908
113
572
433
149
386
56
460
213
316
639
453
696
384
257
754
264
280
637
690
587
575
761
356
655
236
554
75
189
215
643
148
789
553
383
916
560
615
738
669
69
787
117
940
10
426
396
578
519
912
967
897
923
271
403
145
386
31
830
93
911
66
377
843
434
103
441
720
442
670
109
885
533
204
973
959