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

375
497
342
553
640
574
304
233
562
816
439
561
449
1239
488
840
663
523
558
138
441
622
753
691
465
204
178
654
466
761
1056
503
613
612
1452
391
787
380
625
728
733
249
463
476
565
469
402
707
691
126
607
353
552
621
598
708
467
525
1223
597
413
725
276
1085
237
424
558
847
655
387
762
341
1403
745
583
536
601
766
298
651
361
524
658
297
593
624
484
615
620
774
250
793
432
496
339
344
448
1408
400
611
881
330
600
241
1593
627
439
392
606
343
408
315
402
446
699
564
531
661
508
404
443
687
717
600
703
74
496
545
635
539
673
635
546
368
549
1084
381
242
678
762
343
982
1199
188
455
310
283
663
501
787
500
706
422
633
440
551
139
586
369
791
194
573
613
510
132
588
394
668
611
385
173
986
246
527
314
522
715
241
387

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