Record Case Detail

Notes

This function is in beta test. Please help improve it in the issues here.

Stderr


        

Hints

Your answer may be identical to the JOJ answer in the first several lines.

However, you will still get Wrong Answer because the complete output may be longer and there might be errors in the future lines.

Please double check your code to solve this problem and try again.

Your Answer

1661
1035
723
747
1539
890
365
722
991
155
831
705
1115
1007
1235
514
882
1465
1514
1318
441
1608
753
913
861
836
964
685
1021
695
1510
629
1441
1558
833
645
824
612
864
742
955
249
414
824
1590
691
475
857
913
703
687
353
1513
1836
663
1637
911
896
1055
848
718
271
951
619
829
721
457
644
759
320
762
360
943
1429
583
1307
1564
1638
850
1551
361
1485
1123
1077
659
432
775
977
913
935
1737
951
1201
477
566
1187
774
1607
400
1576
847
741
651
821
1058
1276
439
693
668
886
825
910
927
893
776
1128
1559
716
749
717
524
1105
492
1378
1058
700
477
900
774
648
673
1112
737
872
1192
907
1076
906
662
762
1335
1705
1122
1147
764
961
514
805
862
824
479
1423
779
1149
604
880
1516
1305
782
1404
1040
597
217
797
931
869
394
1094
874
1244
689
498
527
1440
314
766
1134
1213
768

JOJ Answer

1289
774
723
747
1007
652
365
722
805
155
831
544
706
361
764
514
882
1046
1045
885
441
1419
753
913
535
638
806
685
946
695
1257
629
1441
1400
833
589
824
612
864
727
955
249
414
824
800
691
475
774
913
638
687
353
940
1051
663
1171
670
813
345
655
718
271
951
619
745
386
433
644
759
320
762
360
710
1009
539
860
637
1216
603
1493
361
1485
998
297
659
432
775
739
603
935
1494
720
591
477
566
609
448
907
400
574
647
689
651
821
1058
678
439
693
668
748
825
437
617
705
776
588
1092
716
749
639
524
914
492
1200
849
700
477
650
774
459
673
695
621
788
857
757
742
457
662
762
1099
733
692
989
758
614
255
654
855
824
479
402
674
966
440
726
1016
367
519
1058
640
576
217
797
931
869
394
625
611
1169
427
498
527
874
314
646
749
817
768