QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#544298#4277. Simple PolygonkuaiqujuanAC ✓1ms3868kbC++141.2kb2024-09-02 14:46:092024-09-02 14:46:09

Judging History

This is the latest submission verdict.

  • [2024-09-02 14:46:09]
  • Judged
  • Verdict: AC
  • Time: 1ms
  • Memory: 3868kb
  • [2024-09-02 14:46:09]
  • Submitted

answer

#include <bits/stdc++.h>

using i64 = long long;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int l, s;
    std::cin >> l >> s;
    
    if (l % 2 == 1) {
        std::cout << -1 << "\n";
        return 0;
    }
    l /= 2;
    
    int a = l / 2;
    int b = l - a;
    
    if (s > 1LL * a * b || s < l - 1) {
        std::cout << -1 << "\n";
        return 0;
    }
    
    std::vector<std::pair<int, int>> ans;
    
    ans.push_back({0, 0});
    ans.push_back({a, 0});
    if (s == 1LL * a * b) {
        ans.push_back({a, b});
    } else {
        s -= l - 1;
        int y = 1 + s / (a - 1);
        ans.push_back({a, y});
        int x = 1 + s % (a - 1);
        if (x == 1) {
            ans.push_back({x, y});
            ans.push_back({1, b});
        } else {
            ans.push_back({x, y});
            ans.push_back({x, y + 1});
            if (y + 1 != b) {
                ans.push_back({1, y + 1});
                ans.push_back({1, b});
            }
        }
    }
    ans.push_back({0, b});
    
    std::cout << ans.size() << "\n";
    for (auto [x, y] : ans) {
        std::cout << x << " " << y << "\n";
    }
    
    return 0;
}

这程序好像有点Bug,我给组数据试试?

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3568kb

input:

4 1

output:

4
0 0
1 0
1 1
0 1

result:

ok good plan

Test #2:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

4 2

output:

-1

result:

ok NO SOLUTION

Test #3:

score: 0
Accepted
time: 0ms
memory: 3512kb

input:

656762045 149404634

output:

-1

result:

ok NO SOLUTION

Test #4:

score: 0
Accepted
time: 0ms
memory: 3868kb

input:

596732449 547492870

output:

-1

result:

ok NO SOLUTION

Test #5:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

490585606 197031926

output:

-1

result:

ok NO SOLUTION

Test #6:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

205935334 671544129

output:

8
0 0
51483833 0
51483833 12
2254312 12
2254312 13
1 13
1 51483834
0 51483834

result:

ok good plan

Test #7:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

122904120 825319663

output:

8
0 0
30726030 0
30726030 25
26442909 25
26442909 26
1 26
1 30726030
0 30726030

result:

ok good plan

Test #8:

score: 0
Accepted
time: 0ms
memory: 3864kb

input:

372662678 542854072

output:

8
0 0
93165669 0
93165669 4
77025731 4
77025731 5
1 5
1 93165670
0 93165670

result:

ok good plan

Test #9:

score: 0
Accepted
time: 0ms
memory: 3512kb

input:

743004999 188616704

output:

-1

result:

ok NO SOLUTION

Test #10:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

842473769 181343779

output:

-1

result:

ok NO SOLUTION

Test #11:

score: 0
Accepted
time: 0ms
memory: 3864kb

input:

850562596 980099219

output:

8
0 0
212640649 0
212640649 3
129536627 3
129536627 4
1 4
1 212640649
0 212640649

result:

ok good plan

Test #12:

score: 0
Accepted
time: 0ms
memory: 3784kb

input:

753747532 906770708

output:

8
0 0
188436883 0
188436883 3
153023180 3
153023180 4
1 4
1 188436883
0 188436883

result:

ok good plan

Test #13:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

421448642 685416185

output:

8
0 0
105362160 0
105362160 5
53243230 5
53243230 6
1 6
1 105362161
0 105362161

result:

ok good plan

Test #14:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

233439847 311101797

output:

-1

result:

ok NO SOLUTION

Test #15:

score: 0
Accepted
time: 0ms
memory: 3824kb

input:

251152449 177137892

output:

-1

result:

ok NO SOLUTION

Test #16:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

770588658 78245838

output:

-1

result:

ok NO SOLUTION

Test #17:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

820350607 531778846

output:

-1

result:

ok NO SOLUTION

Test #18:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

796111246 786209428

output:

8
0 0
199027811 0
199027811 2
189125997 2
189125997 3
1 3
1 199027812
0 199027812

result:

ok good plan

Test #19:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

936453726 441481755

output:

-1

result:

ok NO SOLUTION

Test #20:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

109411058 100658595

output:

8
0 0
27352764 0
27352764 2
18600305 2
18600305 3
1 3
1 27352765
0 27352765

result:

ok good plan

Test #21:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

720248693 974609485

output:

-1

result:

ok NO SOLUTION

Test #22:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

596992030 134373467

output:

-1

result:

ok NO SOLUTION

Test #23:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

277127289 907592028

output:

-1

result:

ok NO SOLUTION

Test #24:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

292844698 273681769

output:

8
0 0
73211174 0
73211174 2
54048249 2
54048249 3
1 3
1 73211175
0 73211175

result:

ok good plan

Test #25:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

335514279 73605709

output:

-1

result:

ok NO SOLUTION

Test #26:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

676664106 632143236

output:

8
0 0
169166026 0
169166026 2
124645160 2
124645160 3
1 3
1 169166027
0 169166027

result:

ok good plan

Test #27:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

888393402 19178143

output:

-1

result:

ok NO SOLUTION

Test #28:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

409352440 130292170

output:

-1

result:

ok NO SOLUTION

Test #29:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

390499700 267683852

output:

8
0 0
97624925 0
97624925 1
72434004 1
72434004 2
1 2
1 97624925
0 97624925

result:

ok good plan

Test #30:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

304232966 470743421

output:

8
0 0
76058241 0
76058241 5
14393980 5
14393980 6
1 6
1 76058242
0 76058242

result:

ok good plan

Test #31:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

748287082 766283467

output:

8
0 0
187071770 0
187071770 3
17996390 3
17996390 4
1 4
1 187071771
0 187071771

result:

ok good plan

Test #32:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

20018876 381657326

output:

8
0 0
5004719 0
5004719 75
1298758 75
1298758 76
1 76
1 5004719
0 5004719

result:

ok good plan

Test #33:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

525757814 846189716

output:

8
0 0
131439453 0
131439453 5
57553003 5
57553003 6
1 6
1 131439454
0 131439454

result:

ok good plan

Test #34:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

713603990 466683797

output:

8
0 0
178400997 0
178400997 1
109881804 1
109881804 2
1 2
1 178400998
0 178400998

result:

ok good plan

Test #35:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

274030892 438235130

output:

8
0 0
68507723 0
68507723 5
27188798 5
27188798 6
1 6
1 68507723
0 68507723

result:

ok good plan

Test #36:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

89061264 641898409

output:

8
0 0
22265316 0
22265316 27
18469589 27
18469589 28
1 28
1 22265316
0 22265316

result:

ok good plan

Test #37:

score: 0
Accepted
time: 0ms
memory: 3784kb

input:

531224402 120862474

output:

-1

result:

ok NO SOLUTION

Test #38:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

773240724 645857013

output:

8
0 0
193310181 0
193310181 2
65926473 2
65926473 3
1 3
1 193310181
0 193310181

result:

ok good plan

Test #39:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

708598658 620359198

output:

8
0 0
177149664 0
177149664 2
88910208 2
88910208 3
1 3
1 177149665
0 177149665

result:

ok good plan

Test #40:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

423968720 535749933

output:

8
0 0
105992180 0
105992180 4
5789038 4
5789038 5
1 5
1 105992180
0 105992180

result:

ok good plan

Test #41:

score: 0
Accepted
time: 0ms
memory: 3824kb

input:

530909092 728244562

output:

8
0 0
132727273 0
132727273 4
64608202 4
64608202 5
1 5
1 132727273
0 132727273

result:

ok good plan

Test #42:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

421139062 273115655

output:

8
0 0
105284765 0
105284765 1
62546126 1
62546126 2
1 2
1 105284766
0 105284766

result:

ok good plan

Test #43:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

604812834 777566583

output:

8
0 0
151203208 0
151203208 4
21550547 4
21550547 5
1 5
1 151203209
0 151203209

result:

ok good plan

Test #44:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

687797172 845256343

output:

8
0 0
171949293 0
171949293 3
157459175 3
157459175 4
1 4
1 171949293
0 171949293

result:

ok good plan

Test #45:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

779271936 373171148

output:

-1

result:

ok NO SOLUTION

Test #46:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

358898894 178215693

output:

-1

result:

ok NO SOLUTION

Test #47:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

182138052 729277997

output:

8
0 0
45534513 0
45534513 15
725805 15
725805 16
1 16
1 45534513
0 45534513

result:

ok good plan

Test #48:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

299640094 747781349

output:

8
0 0
74910023 0
74910023 8
73591150 8
73591150 9
1 9
1 74910024
0 74910024

result:

ok good plan

Test #49:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

199831800 657838219

output:

8
0 0
49957950 0
49957950 12
8384882 12
8384882 13
1 13
1 49957950
0 49957950

result:

ok good plan

Test #50:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

801971048 609973980

output:

8
0 0
200492762 0
200492762 2
8495697 2
8495697 3
1 3
1 200492762
0 200492762

result:

ok good plan

Test #51:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

410125446 499319768

output:

8
0 0
102531361 0
102531361 3
89194327 3
89194327 4
1 4
1 102531362
0 102531362

result:

ok good plan

Test #52:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

664337258 326232892

output:

-1

result:

ok NO SOLUTION

Test #53:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

198336320 502993871

output:

8
0 0
49584080 0
49584080 9
7153081 9
7153081 10
1 10
1 49584080
0 49584080

result:

ok good plan

Test #54:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

770483154 911695281

output:

8
0 0
192620788 0
192620788 3
141212132 3
141212132 4
1 4
1 192620789
0 192620789

result:

ok good plan

Test #55:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

968522752 905800329

output:

8
0 0
242130688 0
242130688 2
179408268 2
179408268 3
1 3
1 242130688
0 242130688

result:

ok good plan

Test #56:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

549864526 688851806

output:

8
0 0
137466131 0
137466131 4
1521155 4
1521155 5
1 5
1 137466132
0 137466132

result:

ok good plan

Test #57:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

694964358 273025751

output:

-1

result:

ok NO SOLUTION

Test #58:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

755213882 589915763

output:

8
0 0
188803470 0
188803470 2
23505355 2
23505355 3
1 3
1 188803471
0 188803471

result:

ok good plan

Test #59:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

853008566 261279048

output:

-1

result:

ok NO SOLUTION

Test #60:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

648529822 825071874

output:

8
0 0
162132455 0
162132455 4
14409603 4
14409603 5
1 5
1 162132456
0 162132456

result:

ok good plan

Test #61:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

109304282 232982785

output:

8
0 0
27326070 0
27326070 7
14374232 7
14374232 8
1 8
1 27326071
0 27326071

result:

ok good plan

Test #62:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

869585024 959944584

output:

8
0 0
217396256 0
217396256 3
90359564 3
90359564 4
1 4
1 217396256
0 217396256

result:

ok good plan

Test #63:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

507663674 88365136

output:

-1

result:

ok NO SOLUTION

Test #64:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

257793806 90998243

output:

-1

result:

ok NO SOLUTION

Test #65:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

919393432 666825571

output:

8
0 0
229848358 0
229848358 1
207128857 1
207128857 2
1 2
1 229848358
0 229848358

result:

ok good plan

Test #66:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

853903384 329850703

output:

-1

result:

ok NO SOLUTION

Test #67:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

335441670 284253394

output:

8
0 0
83860417 0
83860417 2
32672145 2
32672145 3
1 3
1 83860418
0 83860418

result:

ok good plan

Test #68:

score: 0
Accepted
time: 0ms
memory: 3784kb

input:

24544786 390070009

output:

8
0 0
6136196 0
6136196 62
3489723 62
3489723 63
1 63
1 6136197
0 6136197

result:

ok good plan

Test #69:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

323614096 699447036

output:

8
0 0
80903524 0
80903524 7
52218852 7
52218852 8
1 8
1 80903524
0 80903524

result:

ok good plan

Test #70:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

502837028 109125531

output:

-1

result:

ok NO SOLUTION

Test #71:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

664812904 365409364

output:

8
0 0
166203226 0
166203226 1
33002914 1
33002914 2
1 2
1 166203226
0 166203226

result:

ok good plan

Test #72:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

514667768 945027774

output:

8
0 0
128666942 0
128666942 6
44359187 6
44359187 7
1 7
1 128666942
0 128666942

result:

ok good plan

Test #73:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

655380202 337558629

output:

8
0 0
163845050 0
163845050 1
9868530 1
9868530 2
1 2
1 163845051
0 163845051

result:

ok good plan

Test #74:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

371491572 386802836

output:

8
0 0
92872893 0
92872893 3
15311268 3
15311268 4
1 4
1 92872893
0 92872893

result:

ok good plan

Test #75:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

370506158 366579356

output:

8
0 0
92626539 0
92626539 2
88699741 2
88699741 3
1 3
1 92626540
0 92626540

result:

ok good plan

Test #76:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

177655230 841310478

output:

8
0 0
44413807 0
44413807 17
41861969 17
41861969 18
1 18
1 44413808
0 44413808

result:

ok good plan

Test #77:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

135251342 579650917

output:

8
0 0
33812835 0
33812835 16
4832738 16
4832738 17
1 17
1 33812836
0 33812836

result:

ok good plan

Test #78:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

707764652 452687293

output:

8
0 0
176941163 0
176941163 1
98804969 1
98804969 2
1 2
1 176941163
0 176941163

result:

ok good plan

Test #79:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

870115800 430673599

output:

-1

result:

ok NO SOLUTION

Test #80:

score: 0
Accepted
time: 0ms
memory: 3656kb

input:

869686730 712395212

output:

8
0 0
217421682 0
217421682 2
60130168 2
60130168 3
1 3
1 217421683
0 217421683

result:

ok good plan

Test #81:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

948113264 941600913

output:

8
0 0
237028316 0
237028316 2
230515968 2
230515968 3
1 3
1 237028316
0 237028316

result:

ok good plan

Test #82:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

395441280 381620213

output:

8
0 0
98860320 0
98860320 2
85039256 2
85039256 3
1 3
1 98860320
0 98860320

result:

ok good plan

Test #83:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

397094130 636488993

output:

8
0 0
99273532 0
99273532 5
40847806 5
40847806 6
1 6
1 99273533
0 99273533

result:

ok good plan

Test #84:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

932433740 406519991

output:

-1

result:

ok NO SOLUTION

Test #85:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

768238442 525193487

output:

8
0 0
192059610 0
192059610 1
141074268 1
141074268 2
1 2
1 192059611
0 192059611

result:

ok good plan

Test #86:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

659791902 699488585

output:

8
0 0
164947975 0
164947975 3
39696688 3
39696688 4
1 4
1 164947976
0 164947976

result:

ok good plan

Test #87:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

249244600 310497662

output:

8
0 0
62311150 0
62311150 3
61253066 3
61253066 4
1 4
1 62311150
0 62311150

result:

ok good plan

Test #88:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

945387452 838174829

output:

8
0 0
236346863 0
236346863 2
129134243 2
129134243 3
1 3
1 236346863
0 236346863

result:

ok good plan

Test #89:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

365428734 126751007

output:

-1

result:

ok NO SOLUTION

Test #90:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

371260250 528530702

output:

8
0 0
92815062 0
92815062 4
64455396 4
64455396 5
1 5
1 92815063
0 92815063

result:

ok good plan

Test #91:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

872462082 360555751

output:

-1

result:

ok NO SOLUTION

Test #92:

score: 0
Accepted
time: 0ms
memory: 3864kb

input:

386375240 895400111

output:

8
0 0
96593810 0
96593810 8
26055830 8
26055830 9
1 9
1 96593810
0 96593810

result:

ok good plan

Test #93:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

945210142 542830818

output:

8
0 0
236302535 0
236302535 1
70225749 1
70225749 2
1 2
1 236302536
0 236302536

result:

ok good plan

Test #94:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

62895378 546576937

output:

8
0 0
15723844 0
15723844 33
11966274 33
11966274 34
1 34
1 15723845
0 15723845

result:

ok good plan

Test #95:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

311830080 660126790

output:

8
0 0
77957520 0
77957520 7
36466638 7
36466638 8
1 8
1 77957520
0 77957520

result:

ok good plan

Test #96:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

806503838 281477730

output:

-1

result:

ok NO SOLUTION

Test #97:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

302765796 428469874

output:

8
0 0
75691449 0
75691449 4
50012634 4
50012634 5
1 5
1 75691449
0 75691449

result:

ok good plan

Test #98:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

33545294 25336837

output:

8
0 0
8386323 0
8386323 2
177870 2
177870 3
1 3
1 8386324
0 8386324

result:

ok good plan

Test #99:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

879363252 692179827

output:

8
0 0
219840813 0
219840813 2
32657391 2
32657391 3
1 3
1 219840813
0 219840813

result:

ok good plan

Test #100:

score: 0
Accepted
time: 0ms
memory: 3828kb

input:

671000162 234266218

output:

-1

result:

ok NO SOLUTION

Test #101:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

576003508 153049489

output:

-1

result:

ok NO SOLUTION

Test #102:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

771313838 730168850

output:

8
0 0
192828459 0
192828459 2
151683475 2
151683475 3
1 3
1 192828460
0 192828460

result:

ok good plan

Test #103:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

836384904 432562321

output:

8
0 0
209096226 0
209096226 1
14369871 1
14369871 2
1 2
1 209096226
0 209096226

result:

ok good plan

Test #104:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

60293922 420693205

output:

8
0 0
15073480 0
15073480 26
13709271 26
13709271 27
1 27
1 15073481
0 15073481

result:

ok good plan

Test #105:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

338984060 404031611

output:

8
0 0
84746015 0
84746015 3
65047555 3
65047555 4
1 4
1 84746015
0 84746015

result:

ok good plan

Test #106:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

845909332 459008785

output:

8
0 0
211477333 0
211477333 1
36054121 1
36054121 2
1 2
1 211477333
0 211477333

result:

ok good plan

Test #107:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

801550650 756988125

output:

8
0 0
200387662 0
200387662 2
155825141 2
155825141 3
1 3
1 200387663
0 200387663

result:

ok good plan

Test #108:

score: 0
Accepted
time: 0ms
memory: 3864kb

input:

12239258 74994942

output:

8
0 0
3059814 0
3059814 23
1559429 23
1559429 24
1 24
1 3059815
0 3059815

result:

ok good plan

Test #109:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

689920978 647138514

output:

8
0 0
172480244 0
172480244 2
129697784 2
129697784 3
1 3
1 172480245
0 172480245

result:

ok good plan

Test #110:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

184342820 355672159

output:

8
0 0
46085705 0
46085705 6
33072231 6
33072231 7
1 7
1 46085705
0 46085705

result:

ok good plan

Test #111:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

302283400 155643880

output:

8
0 0
75570850 0
75570850 1
4502182 1
4502182 2
1 2
1 75570850
0 75570850

result:

ok good plan

Test #112:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

756062228 683554608

output:

8
0 0
189015557 0
189015557 2
116507940 2
116507940 3
1 3
1 189015557
0 189015557

result:

ok good plan

Test #113:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

291690990 659611467

output:

8
0 0
72922747 0
72922747 8
3306752 8
3306752 9
1 9
1 72922748
0 72922748

result:

ok good plan

Test #114:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

10173072 225574233

output:

8
0 0
2543268 0
2543268 87
1766737 87
1766737 88
1 88
1 2543268
0 2543268

result:

ok good plan

Test #115:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

116613708 99788090

output:

8
0 0
29153427 0
29153427 2
12327812 2
12327812 3
1 3
1 29153427
0 29153427

result:

ok good plan

Test #116:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

413403874 420363396

output:

8
0 0
103350968 0
103350968 3
6959527 3
6959527 4
1 4
1 103350969
0 103350969

result:

ok good plan

Test #117:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

104922974 68977141

output:

8
0 0
26230743 0
26230743 1
16515656 1
16515656 2
1 2
1 26230744
0 26230744

result:

ok good plan

Test #118:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

814481846 347162734

output:

-1

result:

ok NO SOLUTION

Test #119:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

401674718 224548659

output:

8
0 0
100418679 0
100418679 1
23711302 1
23711302 2
1 2
1 100418680
0 100418680

result:

ok good plan

Test #120:

score: 0
Accepted
time: 0ms
memory: 3656kb

input:

406976738 881568779

output:

8
0 0
101744184 0
101744184 7
67615314 7
67615314 8
1 8
1 101744185
0 101744185

result:

ok good plan

Test #121:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

926980270 622679155

output:

8
0 0
231745067 0
231745067 1
159189022 1
159189022 2
1 2
1 231745068
0 231745068

result:

ok good plan

Test #122:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

216852084 338679783

output:

8
0 0
54213021 0
54213021 5
13401663 5
13401663 6
1 6
1 54213021
0 54213021

result:

ok good plan

Test #123:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

610219914 207118079

output:

-1

result:

ok NO SOLUTION

Test #124:

score: 0
Accepted
time: 0ms
memory: 3824kb

input:

328457454 25931709

output:

-1

result:

ok NO SOLUTION

Test #125:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

915520690 118684974

output:

-1

result:

ok NO SOLUTION

Test #126:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

568229720 488525085

output:

8
0 0
142057430 0
142057430 2
62352798 2
62352798 3
1 3
1 142057430
0 142057430

result:

ok good plan

Test #127:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

531827830 685694401

output:

8
0 0
132956957 0
132956957 4
20909620 4
20909620 5
1 5
1 132956958
0 132956958

result:

ok good plan

Test #128:

score: 0
Accepted
time: 0ms
memory: 3828kb

input:

452409802 715329957

output:

8
0 0
113102450 0
113102450 5
36715262 5
36715262 6
1 6
1 113102451
0 113102451

result:

ok good plan

Test #129:

score: 0
Accepted
time: 0ms
memory: 3636kb

input:

739357828 243587585

output:

-1

result:

ok NO SOLUTION

Test #130:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

909250486 881008890

output:

8
0 0
227312621 0
227312621 2
199071029 2
199071029 3
1 3
1 227312622
0 227312622

result:

ok good plan

Test #131:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

190124236 623425506

output:

8
0 0
47531059 0
47531059 12
5521752 12
5521752 13
1 13
1 47531059
0 47531059

result:

ok good plan

Test #132:

score: 0
Accepted
time: 0ms
memory: 3504kb

input:

651638822 573089381

output:

8
0 0
162909705 0
162909705 2
84360268 2
84360268 3
1 3
1 162909706
0 162909706

result:

ok good plan

Test #133:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

118977068 383269885

output:

8
0 0
29744267 0
29744267 11
26338693 11
26338693 12
1 12
1 29744267
0 29744267

result:

ok good plan

Test #134:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

390751760 878353816

output:

8
0 0
97687940 0
97687940 7
96850304 7
96850304 8
1 8
1 97687940
0 97687940

result:

ok good plan