For problem statement at 1000-1999/1700-1799/1740-1749/1744/problemE2.txt this is a correct solution, but verifier at 1000-1999/1700-1799/1740-1749/1744/verifierE2.go ends with wrong answer
input:
100
721622 629873 1411705 1413832
84513 314062 292484 1069199
301302 143806 687888 178134
870992 800290 1167830 914960
908880 314893 984544 997778
130944 525678 513721 531303
841127 808505 1398466 1524676
192975 336622 711310 729468
599242 328144 1111112 953712
420269 24604 592173 675308
8661 511099 218999 1001005
617273 976011 641736 1866998
674504 192561 1660088 1151833
202120 862894 645358 1861167
114955 666671 319240 1167221
683394 444434 788259 539414
892266 962793 978473 1242506
823811 190432 1131359 1100987
122601 594905 138537 606089
314965 692943 1054968 748936
895623 319829 1815146 650235
299447 941318 861570 1423247
340688 942375 704004 992796
607927 923445 718062 1246676
211070 835494 852412 930952
115378 625454 959614 1303121
627506 413139 775757 845210
316058 298006 546508 1213520
797422 586401 1734523 612655
185447 851656 1017095 1329220
863851 294456 1648858 965407
71918 954822 738900 1908567
423845 751314 435837 1572885
140352 258203 181649 519786
171695 363203 1128082 1312997
567815 517445 1105950 1331262
483751 343891 1266444 441262
145541 134460 1034211 536041
529596 934650 1427406 1073608
279667 413636 350421 1393551
863098 788621 1854380 1661528
696979 627669 1069290 750469
234973 81870 1141041 680542
847484 655078 967423 908300
760837 432831 1271689 687217
843715 395281 938407 628354
484960 861296 741411 1212377
797811 568851 1540775 1062986
466459 160072 1399934 685355
775419 74424 789261 393345
820634 332061 1206747 1055749
823879 859515 1015584 1421311
855738 760009 1114563 1694110
768635 395216 1654772 1241682
619125 628389 777942 1235721
827971 646695 1033869 1457112
565794 503589 1104617 781211
15455 653652 81980 931383
988913 170575 1780193 950139
719981 679033 1070957 1371729
319909 52334 321673 798674
484771 103637 987067 222744
940042 422859 1421128 1293342
226839 51538 234357 427247
46857 203595 621604 1150854
775164 949760 972460 1285635
670898 452509 1309447 1015991
316965 927822 1130278 1309721
475330 250844 1364849 707869
361267 109582 1191942 375301
803683 599401 1305663 771597
697335 232218 1054786 304344
659912 692444 1090966 1513649
921764 874821 1547554 1424392
252103 70570 264735 326482
557017 236623 776305 1044596
985291 17057 1915637 184717
930234 216553 1283679 887779
55228 907639 310870 1399506
821431 214752 1377475 506791
165976 819335 762368 836235
481972 451848 539820 585628
111123 859879 557331 1022684
889132 957305 1342615 1172644
917797 525217 933395 687498
721608 512134 724875 980429
736839 684450 1383949 1241602
76458 205292 843288 734017
66448 328137 551809 337804
523642 904393 1421833 1443587
905478 879305 1203262 1307085
675234 967463 686347 1325588
543137 867546 1343549 1522711
783156 210038 1011032 508010
11740 742732 378596 1682714
777504 764853 1158286 1010587
935141 208977 1911639 770253
472125 225527 524639 295597
498063 445316 1248813 1416474
528442 805558 1412431 1430544
expected:
1259746 721622
246763 322686
575224 150651
-1 -1
944679 908880
-1 -1
1134230 1199149
248775 522236
898863 656288
442872 420269
9046 978693
-1 -1
770244 1011756
431447 1212720
-1 -1
-1 -1
-1 -1
868208 722776
-1 -1
-1 -1
1791246 639658
598894 1411977
668640 960325
-1 -1
379770 928708
312727 692268
-1 -1
447009 632116
-1 -1
425828 1112682
883368 863851
113014 1215228
-1 -1
181632 399041
363203 515085
777566 755725
-1 -1
169776 461065
1048550 944136
310227 1118668
1577242 863098
-1 -1
245610 469946
-1 -1
968338 680163
-1 -1
-1 -1
1327319 683838
475464 471121
-1 -1
996183 820634
-1 -1
1026981 1266564
790432 768635
698210 1114425
-1 -1
1007178 565794
24728 817065
1016627 331850
-1 -1
-1 -1
969542 207274
1268577 940042
231921 151226
62476 610785
-1 -1
905018 670898
950895 1237096
522863 456080
722534 219164
-1 -1
-1 -1
692444 1319824
1166428 1382646
-1 -1
709869 557017
-1 -1
1240312 649659
-1 -1
1010992 348972
327734 829880
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
1232010 818710
108684 433262
328137 332240
904393 1047284
-1 -1
-1 -1
674758 1396638
840152 391578
185683 751360
-1 -1
1870282 417954
-1 -1
664084 1335948
805558 1056884
got:
1259746 721622
269196 591591
575224 150651
-1 -1
944679 908880
-1 -1
1131907 1201610
673244 385950
984432 599242
590496 420269
217104 978693
-1 -1
1540488 674504
431447 1616960
-1 -1
-1 -1
-1 -1
952160 823811
-1 -1
-1 -1
959487 597082
470659 1197788
668640 960325
-1 -1
835494 844280
938181 1153780
-1 -1
447009 632116
-1 -1
851656 1112682
1472280 863851
705738 1654114
-1 -1
140838 514624
1089609 1201865
1034890 1135630
-1 -1
1030860 436623
1401975 1059192
310227 1118668
1577242 863098
-1 -1
1105245 469946
-1 -1
1009939 652146
-1 -1
-1 -1
1137702 797811
1280576 466459
-1 -1
996183 820634
-1 -1
1007604 1290921
1580864 768635
698210 1114425
-1 -1
1007178 565794
72628 834570
1016627 829625
-1 -1
-1 -1
725459 207759
1268577 940042
231921 302452
620480 983997
-1 -1
905018 670898
927822 950895
1254220 475330
1095820 361267
-1 -1
-1 -1
1038666 1319824
1166428 1382646
-1 -1
709869 557017
-1 -1
1240312 649659
-1 -1
930592 379122
655468 829880
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
1368900 736839
821168 611664
328137 332240
904393 1047284
-1 -1
-1 -1
1301319 1086274
840152 391578
371366 1643600
-1 -1
1809435 540011
-1 -1
1113290 996126
1208337 1056884
exit status 1 can you fix the verifier? ```go
package main
import (
"bufio"
"fmt"
"os"
)
type factor struct {
p int64
e int
}
func factorize(n int64) []factor {
res := make([]factor, 0)
if n%2 == 0 {
cnt := 0
for n%2 == 0 {
n /= 2
cnt++
}
res = append(res, factor{2, cnt})
}
var i int64 = 3
for i*i <= n {
if n%i == 0 {
cnt := 0
for n%i == 0 {
n /= i
cnt++
}
res = append(res, factor{i, cnt})
}
i += 2
}
if n > 1 {
res = append(res, factor{n, 1})
}
return res
}
func genDivs(factors []factor) []int64 {
divs := []int64{1}
for _, f := range factors {
newDivs := make([]int64, 0, len(divs)*(f.e+1))
pow := int64(1)
for e := 0; e <= f.e; e++ {
for _, v := range divs {
newDivs = append(newDivs, v*pow)
}
pow *= f.p
}
divs = newDivs
}
return divs
}
func main() {
in := bufio.NewReader(os.Stdin)
out := bufio.NewWriter(os.Stdout)
defer out.Flush()
var t int
fmt.Fscan(in, &t)
for ; t > 0; t-- {
var a, b, c, d int64
fmt.Fscan(in, &a, &b, &c, &d)
fa := factorize(a)
fb := factorize(b)
da := genDivs(fa)
db := genDivs(fb)
found := false
outer:
for _, d1 := range da {
baseA := a / d1
for _, d2 := range db {
dmul := d1 * d2
kx := c / dmul
x := kx * dmul
if x <= a {
continue
}
L := baseA * (b / d2)
kyMax := d / L
kyMin := b / L
if kyMax > kyMin {
y := kyMax * L
fmt.Fprintln(out, x, y)
found = true
break outer
}
}
}
if !found {
fmt.Fprintln(out, -1, -1)
}
}
}
```