QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#696904 | #6677. Puzzle: Sashigane | pppwolf | AC ✓ | 1ms | 3900kb | C++20 | 8.1kb | 2024-11-01 06:16:51 | 2024-11-01 06:16:51 |
Judging History
answer
#include <bits/stdc++.h>
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;
using i128 = __int128;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, a, b;
std::cin >> n >> a >> b;
if (n == 1) {
std::cout << "Yes\n0";
return 0;
}
int r = std::max(std::min(n - a + 1, a), std::min(n - b + 1, b));
int dx[4] = {-1, -1, 1, 1}, dy[4] = {-1, 1, 1, -1};
std::vector<std::array<int, 4>> ans;
if (a > n / 2 && b <= n / 2) {
//std::cerr << "zx\n";
int pa = n - r + 1, pb = r;
int op = 0;
for (int i = 0; i < 4; i++) {
int px = dx[i] + a, py = dy[i] + b;
if (px <= n && px >= pa && py <= pb && py >= 1) {
op = i;
break;
}
}
int nop = 0;
if (a == pa || a == n || a == 1) {
if (op == 0) {
nop = 1;
} else if (op == 1) {
nop = 0;
} else if (op == 2) {
nop = 3;
} else if (op == 3) {
nop = 2;
}
} else if (b == pb || b == n || b == 1) {
if (op == 0) {
nop = 3;
} else if (op == 1) {
nop = 2;
} else if (op == 2) {
nop = 1;
} else if (op == 3) {
nop = 0;
}
}
//std::cerr << "nop " << nop << "\n";
a += dx[op], b += dy[op];
int cnt = 1;
while (a <= n && a >= pa && b <= pb && b > 0) {
ans.push_back({a, b, -dx[op] * cnt, -dy[op] * cnt});
a += dx[op];
b += dy[op];
cnt++;
}
if (op == 0 && nop == 3) {
a += (cnt + 1) * dx[nop];
} else if (op == 0 && nop == 1) {
b += (cnt + 1) * dy[nop];
} else if (op == 1 && nop == 0) {
b += (cnt + 1) * dy[nop];
} else if (op == 1 && nop == 2) {
a += (cnt + 1) * dx[nop];
} else if (op == 2 && nop == 3) {
b += (cnt + 1) * dy[nop];
} else if (op == 2 && nop == 1) {
a += (cnt + 1) * dx[nop];
} else if (op == 3 && nop == 2) {
b += (cnt + 1) * dy[nop];
} else if (op == 3 && nop == 0) {
a += (cnt + 1) * dx[nop];
}
while (a <= n && a >= pa && b <= pb && b > 0) {
ans.push_back({a, b, -dx[nop] * cnt, -dy[nop] * cnt});
a += dx[nop];
b += dy[nop];
cnt++;
}
a = pa - 1;
b = pb + 1;
//std::cerr << a << " " << b << " " << cnt << "\n";
int nnop = 1;
while (a < pa && a >= 1 && b > pb && b <= n) {
ans.push_back({a, b, -dx[nnop] * cnt, -dy[nnop] * cnt});
a += dx[nnop];
b += dy[nnop];
cnt++;
}
} else if (a > n / 2 && b > n / 2) {
//std::cerr << "yx\n";
int pa = n - r + 1, pb = n - r + 1;
int op = 0;
for (int i = 0; i < 4; i++) {
int px = dx[i] + a, py = dy[i] + b;
if (px <= n && px >= pa && py <= n && py >= pb) {
op = i;
break;
}
}
int nop = 0;
if (a == pa || a == n || a == 1) {
if (op == 0) {
nop = 1;
} else if (op == 1) {
nop = 0;
} else if (op == 2) {
nop = 3;
} else if (op == 3) {
nop = 2;
}
} else if (b == pb || b == n || b == 1) {
if (op == 0) {
nop = 3;
} else if (op == 1) {
nop = 2;
} else if (op == 2) {
nop = 1;
} else if (op == 3) {
nop = 0;
}
}
a += dx[op], b += dy[op];
int cnt = 1;
while (a <= n && a >= pa && b <= n && b >= pb) {
ans.push_back({a, b, -dx[op] * cnt, -dy[op] * cnt});
//std::cerr << a << " " << b << "\n";
a += dx[op];
b += dy[op];
cnt++;
}
if (op == 0 && nop == 3) {
a += (cnt + 1) * dx[nop];
} else if (op == 0 && nop == 1) {
b += (cnt + 1) * dy[nop];
} else if (op == 1 && nop == 0) {
b += (cnt + 1) * dy[nop];
} else if (op == 1 && nop == 2) {
a += (cnt + 1) * dx[nop];
} else if (op == 2 && nop == 3) {
b += (cnt + 1) * dy[nop];
} else if (op == 2 && nop == 1) {
a += (cnt + 1) * dx[nop];
} else if (op == 3 && nop == 2) {
b += (cnt + 1) * dy[nop];
} else if (op == 3 && nop == 0) {
a += (cnt + 1) * dx[nop];
}
while (a <= n && a >= pa && b <= n && b >= pb) {
ans.push_back({a, b, -dx[nop] * cnt, -dy[nop] * cnt});
a += dx[nop];
b += dy[nop];
cnt++;
}
a = pa - 1;
b = pb - 1;
int nnop = 0;
//std::cerr << nnop << " " << pa << " " << pb << "\n";
while (a < pa && a >= 1 && b < pb && b >= 1) {
ans.push_back({a, b, -dx[nnop] * cnt, -dy[nnop] * cnt});
a += dx[nnop];
b += dy[nnop];
cnt++;
}
} else if (a <= n / 2 && b > n / 2) {
//std::cerr << "ys\n";
int pa = r, pb = n - r + 1;
int op = 0;
for (int i = 0; i < 4; i++) {
int px = dx[i] + a, py = dy[i] + b;
if (px <= pa && px >= 1 && py <= n && py >= pb) {
op = i;
break;
}
}
int nop = 0;
if (a == pa || a == n || a == 1) {
if (op == 0) {
nop = 1;
} else if (op == 1) {
nop = 0;
} else if (op == 2) {
nop = 3;
} else if (op == 3) {
nop = 2;
}
} else if (b == pb || b == n || b == 1) {
if (op == 0) {
nop = 3;
} else if (op == 1) {
nop = 2;
} else if (op == 2) {
nop = 1;
} else if (op == 3) {
nop = 0;
}
}
//std::cerr << a << " " << b << " " << op << "\n";
a += dx[op], b += dy[op];
int cnt = 1;
while (a <= pa && a >= 1 && b <= n && b >= pb) {
ans.push_back({a, b, -dx[op] * cnt, -dy[op] * cnt});
a += dx[op];
b += dy[op];
cnt++;
}
if (op == 0 && nop == 3) {
a += (cnt + 1) * dx[nop];
} else if (op == 0 && nop == 1) {
b += (cnt + 1) * dy[nop];
} else if (op == 1 && nop == 0) {
b += (cnt + 1) * dy[nop];
} else if (op == 1 && nop == 2) {
a += (cnt + 1) * dx[nop];
} else if (op == 2 && nop == 3) {
b += (cnt + 1) * dy[nop];
} else if (op == 2 && nop == 1) {
a += (cnt + 1) * dx[nop];
} else if (op == 3 && nop == 2) {
b += (cnt + 1) * dy[nop];
} else if (op == 3 && nop == 0) {
a += (cnt + 1) * dx[nop];
}
while (a <= pa && a >= 1 && b <= n && b >= pb) {
ans.push_back({a, b, -dx[nop] * cnt, -dy[nop] * cnt});
a += dx[nop];
b += dy[nop];
cnt++;
}
//std::cerr << a << " " << b << " " << cnt << "\n";
a = pa + 1;
b = pb - 1;
//std::cerr << a << " " << b << " " << cnt << "\n";
int nnop = 3;
while (a > pa && a <= n && b < pb && b >= 1) {
ans.push_back({a, b, -dx[nnop] * cnt, -dy[nnop] * cnt});
a += dx[nnop];
b += dy[nnop];
cnt++;
}
} else if (a <= n / 2 && b <= n / 2) {
//std::cerr << "zs\n";
int pa = r, pb = r;
int op = 0;
for (int i = 0; i < 4; i++) {
int px = dx[i] + a, py = dy[i] + b;
if (px <= pa && px >= 1 && py <= pb && py >= 1) {
op = i;
break;
}
}
//std::cerr << "op " << op << " " << r << "\n";
int nop = 0;
if (a == pa || a == n || a == 1) {
if (op == 0) {
nop = 1;
} else if (op == 1) {
nop = 0;
} else if (op == 2) {
nop = 3;
} else if (op == 3) {
nop = 2;
}
} else if (b == pb || b == n || b == 1) {
if (op == 0) {
nop = 3;
} else if (op == 1) {
nop = 2;
} else if (op == 2) {
nop = 1;
} else if (op == 3) {
nop = 0;
}
}
a += dx[op], b += dy[op];
int cnt = 1;
while (a <= pa && a >= 1 && b <= pb && b >= 1) {
ans.push_back({a, b, -dx[op] * cnt, -dy[op] * cnt});
a += dx[op];
b += dy[op];
cnt++;
}
if (op == 0 && nop == 3) {
a += (cnt + 1) * dx[nop];
} else if (op == 0 && nop == 1) {
b += (cnt + 1) * dy[nop];
} else if (op == 1 && nop == 0) {
b += (cnt + 1) * dy[nop];
} else if (op == 1 && nop == 2) {
a += (cnt + 1) * dx[nop];
} else if (op == 2 && nop == 3) {
b += (cnt + 1) * dy[nop];
} else if (op == 2 && nop == 1) {
a += (cnt + 1) * dx[nop];
} else if (op == 3 && nop == 2) {
b += (cnt + 1) * dy[nop];
} else if (op == 3 && nop == 0) {
a += (cnt + 1) * dx[nop];
}
while (a <= pa && a >= 1 && b <= pb && b >= 1) {
ans.push_back({a, b, -dx[nop] * cnt, -dy[nop] * cnt});
a += dx[nop];
b += dy[nop];
cnt++;
}
a = pa + 1;
b = pb + 1;
int nnop = 2;
while (a > pa && a <= n && b <= n && b > pb) {
ans.push_back({a, b, -dx[nnop] * cnt, -dy[nnop] * cnt});
a += dx[nnop];
b += dy[nnop];
cnt++;
//std::cerr << a << " " << b << " " << cnt << "\n";
}
}
std::cout << "Yes\n" << ans.size() << "\n";
for (auto [a, b, x, y] : ans) {
std::cout << a << " " << b << " " << x << " " << y << "\n";
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3784kb
input:
5 3 4
output:
Yes 4 4 5 -1 -1 5 3 -2 2 2 2 3 3 1 1 4 4
result:
ok Correct. (1 test case)
Test #2:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
1 1 1
output:
Yes 0
result:
ok Correct. (1 test case)
Test #3:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
3 2 3
output:
Yes 2 3 2 -1 1 1 1 2 2
result:
ok Correct. (1 test case)
Test #4:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
10 10 5
output:
Yes 9 9 4 1 1 8 3 2 2 7 2 3 3 6 1 4 4 5 6 5 -5 4 7 6 -6 3 8 7 -7 2 9 8 -8 1 10 9 -9
result:
ok Correct. (1 test case)
Test #5:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
10 5 7
output:
Yes 9 4 6 1 1 3 8 2 -2 2 9 3 -3 1 10 4 -4 6 5 -5 5 7 4 -6 6 8 3 -7 7 9 2 -8 8 10 1 -9 9
result:
ok Correct. (1 test case)
Test #6:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
10 9 2
output:
Yes 9 10 1 -1 1 8 3 2 -2 7 4 3 -3 6 5 4 -4 5 6 5 -5 4 7 6 -6 3 8 7 -7 2 9 8 -8 1 10 9 -9
result:
ok Correct. (1 test case)
Test #7:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
10 6 10
output:
Yes 9 7 9 -1 1 8 8 -2 2 9 7 -3 3 10 6 -4 4 5 5 5 5 4 4 6 6 3 3 7 7 2 2 8 8 1 1 9 9
result:
ok Correct. (1 test case)
Test #8:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
10 8 4
output:
Yes 9 7 3 1 1 9 2 -2 2 10 1 -3 3 6 5 4 -4 5 6 5 -5 4 7 6 -6 3 8 7 -7 2 9 8 -8 1 10 9 -9
result:
ok Correct. (1 test case)
Test #9:
score: 0
Accepted
time: 1ms
memory: 3896kb
input:
999 396 693
output:
Yes 998 395 692 1 1 394 691 2 2 393 690 3 3 392 689 4 4 391 688 5 5 390 687 6 6 389 686 7 7 388 685 8 8 387 684 9 9 386 683 10 10 385 682 11 11 384 681 12 12 383 680 13 13 382 679 14 14 381 678 15 15 380 677 16 16 379 676 17 17 378 675 18 18 377 674 19 19 376 673 20 20 375 672 21 21 374 671 22 22 37...
result:
ok Correct. (1 test case)
Test #10:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
999 963 827
output:
Yes 998 962 828 1 -1 961 829 2 -2 960 830 3 -3 959 831 4 -4 958 832 5 -5 957 833 6 -6 956 834 7 -7 955 835 8 -8 954 836 9 -9 953 837 10 -10 952 838 11 -11 951 839 12 -12 950 840 13 -13 949 841 14 -14 948 842 15 -15 947 843 16 -16 946 844 17 -17 945 845 18 -18 944 846 19 -19 943 847 20 -20 942 848 21...
result:
ok Correct. (1 test case)
Test #11:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
999 871 185
output:
Yes 998 870 184 1 1 869 183 2 2 868 182 3 3 867 181 4 4 866 180 5 5 865 179 6 6 864 178 7 7 863 177 8 8 862 176 9 9 861 175 10 10 860 174 11 11 859 173 12 12 858 172 13 13 857 171 14 14 856 170 15 15 855 169 16 16 854 168 17 17 853 167 18 18 852 166 19 19 851 165 20 20 850 164 21 21 849 163 22 22 84...
result:
ok Correct. (1 test case)
Test #12:
score: 0
Accepted
time: 1ms
memory: 3660kb
input:
999 787 812
output:
Yes 998 788 813 -1 -1 789 814 -2 -2 790 815 -3 -3 791 816 -4 -4 792 817 -5 -5 793 818 -6 -6 794 819 -7 -7 795 820 -8 -8 796 821 -9 -9 797 822 -10 -10 798 823 -11 -11 799 824 -12 -12 800 825 -13 -13 801 826 -14 -14 802 827 -15 -15 803 828 -16 -16 804 829 -17 -17 805 830 -18 -18 806 831 -19 -19 807 83...
result:
ok Correct. (1 test case)
Test #13:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
999 396 199
output:
Yes 998 395 198 1 1 394 197 2 2 393 196 3 3 392 195 4 4 391 194 5 5 390 193 6 6 389 192 7 7 388 191 8 8 387 190 9 9 386 189 10 10 385 188 11 11 384 187 12 12 383 186 13 13 382 185 14 14 381 184 15 15 380 183 16 16 379 182 17 17 378 181 18 18 377 180 19 19 376 179 20 20 375 178 21 21 374 177 22 22 37...
result:
ok Correct. (1 test case)
Test #14:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
999 1 1
output:
Yes 998 2 2 -1 -1 3 3 -2 -2 4 4 -3 -3 5 5 -4 -4 6 6 -5 -5 7 7 -6 -6 8 8 -7 -7 9 9 -8 -8 10 10 -9 -9 11 11 -10 -10 12 12 -11 -11 13 13 -12 -12 14 14 -13 -13 15 15 -14 -14 16 16 -15 -15 17 17 -16 -16 18 18 -17 -17 19 19 -18 -18 20 20 -19 -19 21 21 -20 -20 22 22 -21 -21 23 23 -22 -22 24 24 -23 -23 25 2...
result:
ok Correct. (1 test case)
Test #15:
score: 0
Accepted
time: 1ms
memory: 3896kb
input:
999 163 1
output:
Yes 998 162 2 1 -1 161 3 2 -2 160 4 3 -3 159 5 4 -4 158 6 5 -5 157 7 6 -6 156 8 7 -7 155 9 8 -8 154 10 9 -9 153 11 10 -10 152 12 11 -11 151 13 12 -12 150 14 13 -13 149 15 14 -14 148 16 15 -15 147 17 16 -16 146 18 17 -17 145 19 18 -18 144 20 19 -19 143 21 20 -20 142 22 21 -21 141 23 22 -22 140 24 23 ...
result:
ok Correct. (1 test case)
Test #16:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
999 999 1
output:
Yes 998 998 2 1 -1 997 3 2 -2 996 4 3 -3 995 5 4 -4 994 6 5 -5 993 7 6 -6 992 8 7 -7 991 9 8 -8 990 10 9 -9 989 11 10 -10 988 12 11 -11 987 13 12 -12 986 14 13 -13 985 15 14 -14 984 16 15 -15 983 17 16 -16 982 18 17 -17 981 19 18 -18 980 20 19 -19 979 21 20 -20 978 22 21 -21 977 23 22 -22 976 24 23 ...
result:
ok Correct. (1 test case)
Test #17:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
999 1 969
output:
Yes 998 2 970 -1 -1 3 971 -2 -2 4 972 -3 -3 5 973 -4 -4 6 974 -5 -5 7 975 -6 -6 8 976 -7 -7 9 977 -8 -8 10 978 -9 -9 11 979 -10 -10 12 980 -11 -11 13 981 -12 -12 14 982 -13 -13 15 983 -14 -14 16 984 -15 -15 17 985 -16 -16 18 986 -17 -17 19 987 -18 -18 20 988 -19 -19 21 989 -20 -20 22 990 -21 -21 23 ...
result:
ok Correct. (1 test case)
Test #18:
score: 0
Accepted
time: 1ms
memory: 3696kb
input:
999 999 780
output:
Yes 998 998 781 1 -1 997 782 2 -2 996 783 3 -3 995 784 4 -4 994 785 5 -5 993 786 6 -6 992 787 7 -7 991 788 8 -8 990 789 9 -9 989 790 10 -10 988 791 11 -11 987 792 12 -12 986 793 13 -13 985 794 14 -14 984 795 15 -15 983 796 16 -16 982 797 17 -17 981 798 18 -18 980 799 19 -19 979 800 20 -20 978 801 21...
result:
ok Correct. (1 test case)
Test #19:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
999 1 999
output:
Yes 998 2 998 -1 1 3 997 -2 2 4 996 -3 3 5 995 -4 4 6 994 -5 5 7 993 -6 6 8 992 -7 7 9 991 -8 8 10 990 -9 9 11 989 -10 10 12 988 -11 11 13 987 -12 12 14 986 -13 13 15 985 -14 14 16 984 -15 15 17 983 -16 16 18 982 -17 17 19 981 -18 18 20 980 -19 19 21 979 -20 20 22 978 -21 21 23 977 -22 22 24 976 -23...
result:
ok Correct. (1 test case)
Test #20:
score: 0
Accepted
time: 1ms
memory: 3900kb
input:
999 686 999
output:
Yes 998 687 998 -1 1 688 997 -2 2 689 996 -3 3 690 995 -4 4 691 994 -5 5 692 993 -6 6 693 992 -7 7 694 991 -8 8 695 990 -9 9 696 989 -10 10 697 988 -11 11 698 987 -12 12 699 986 -13 13 700 985 -14 14 701 984 -15 15 702 983 -16 16 703 982 -17 17 704 981 -18 18 705 980 -19 19 706 979 -20 20 707 978 -2...
result:
ok Correct. (1 test case)
Test #21:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
999 999 999
output:
Yes 998 998 998 1 1 997 997 2 2 996 996 3 3 995 995 4 4 994 994 5 5 993 993 6 6 992 992 7 7 991 991 8 8 990 990 9 9 989 989 10 10 988 988 11 11 987 987 12 12 986 986 13 13 985 985 14 14 984 984 15 15 983 983 16 16 982 982 17 17 981 981 18 18 980 980 19 19 979 979 20 20 978 978 21 21 977 977 22 22 97...
result:
ok Correct. (1 test case)
Test #22:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
1000 757 728
output:
Yes 999 756 729 1 -1 755 730 2 -2 754 731 3 -3 753 732 4 -4 752 733 5 -5 751 734 6 -6 750 735 7 -7 749 736 8 -8 748 737 9 -9 747 738 10 -10 746 739 11 -11 745 740 12 -12 744 741 13 -13 743 742 14 -14 742 743 15 -15 741 744 16 -16 740 745 17 -17 739 746 18 -18 738 747 19 -19 737 748 20 -20 736 749 21...
result:
ok Correct. (1 test case)
Test #23:
score: 0
Accepted
time: 1ms
memory: 3660kb
input:
1000 132 993
output:
Yes 999 131 992 1 1 130 991 2 2 129 990 3 3 128 989 4 4 127 988 5 5 126 987 6 6 125 986 7 7 124 985 8 8 123 984 9 9 122 983 10 10 121 982 11 11 120 981 12 12 119 980 13 13 118 979 14 14 117 978 15 15 116 977 16 16 115 976 17 17 114 975 18 18 113 974 19 19 112 973 20 20 111 972 21 21 110 971 22 22 10...
result:
ok Correct. (1 test case)
Test #24:
score: 0
Accepted
time: 1ms
memory: 3664kb
input:
1000 703 499
output:
Yes 999 702 498 1 1 701 497 2 2 700 496 3 3 699 495 4 4 698 494 5 5 697 493 6 6 696 492 7 7 695 491 8 8 694 490 9 9 693 489 10 10 692 488 11 11 691 487 12 12 690 486 13 13 689 485 14 14 688 484 15 15 687 483 16 16 686 482 17 17 685 481 18 18 684 480 19 19 683 479 20 20 682 478 21 21 681 477 22 22 68...
result:
ok Correct. (1 test case)
Test #25:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
1000 910 298
output:
Yes 999 909 297 1 1 908 296 2 2 907 295 3 3 906 294 4 4 905 293 5 5 904 292 6 6 903 291 7 7 902 290 8 8 901 289 9 9 900 288 10 10 899 287 11 11 898 286 12 12 897 285 13 13 896 284 14 14 895 283 15 15 894 282 16 16 893 281 17 17 892 280 18 18 891 279 19 19 890 278 20 20 889 277 21 21 888 276 22 22 88...
result:
ok Correct. (1 test case)
Test #26:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
1000 171 322
output:
Yes 999 170 321 1 1 169 320 2 2 168 319 3 3 167 318 4 4 166 317 5 5 165 316 6 6 164 315 7 7 163 314 8 8 162 313 9 9 161 312 10 10 160 311 11 11 159 310 12 12 158 309 13 13 157 308 14 14 156 307 15 15 155 306 16 16 154 305 17 17 153 304 18 18 152 303 19 19 151 302 20 20 150 301 21 21 149 300 22 22 14...
result:
ok Correct. (1 test case)
Test #27:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
1000 1 1
output:
Yes 999 2 2 -1 -1 3 3 -2 -2 4 4 -3 -3 5 5 -4 -4 6 6 -5 -5 7 7 -6 -6 8 8 -7 -7 9 9 -8 -8 10 10 -9 -9 11 11 -10 -10 12 12 -11 -11 13 13 -12 -12 14 14 -13 -13 15 15 -14 -14 16 16 -15 -15 17 17 -16 -16 18 18 -17 -17 19 19 -18 -18 20 20 -19 -19 21 21 -20 -20 22 22 -21 -21 23 23 -22 -22 24 24 -23 -23 25 2...
result:
ok Correct. (1 test case)
Test #28:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
1000 480 1
output:
Yes 999 479 2 1 -1 478 3 2 -2 477 4 3 -3 476 5 4 -4 475 6 5 -5 474 7 6 -6 473 8 7 -7 472 9 8 -8 471 10 9 -9 470 11 10 -10 469 12 11 -11 468 13 12 -12 467 14 13 -13 466 15 14 -14 465 16 15 -15 464 17 16 -16 463 18 17 -17 462 19 18 -18 461 20 19 -19 460 21 20 -20 459 22 21 -21 458 23 22 -22 457 24 23 ...
result:
ok Correct. (1 test case)
Test #29:
score: 0
Accepted
time: 1ms
memory: 3856kb
input:
1000 1000 1
output:
Yes 999 999 2 1 -1 998 3 2 -2 997 4 3 -3 996 5 4 -4 995 6 5 -5 994 7 6 -6 993 8 7 -7 992 9 8 -8 991 10 9 -9 990 11 10 -10 989 12 11 -11 988 13 12 -12 987 14 13 -13 986 15 14 -14 985 16 15 -15 984 17 16 -16 983 18 17 -17 982 19 18 -18 981 20 19 -19 980 21 20 -20 979 22 21 -21 978 23 22 -22 977 24 23 ...
result:
ok Correct. (1 test case)
Test #30:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
1000 1 339
output:
Yes 999 2 338 -1 1 3 337 -2 2 4 336 -3 3 5 335 -4 4 6 334 -5 5 7 333 -6 6 8 332 -7 7 9 331 -8 8 10 330 -9 9 11 329 -10 10 12 328 -11 11 13 327 -12 12 14 326 -13 13 15 325 -14 14 16 324 -15 15 17 323 -16 16 18 322 -17 17 19 321 -18 18 20 320 -19 19 21 319 -20 20 22 318 -21 21 23 317 -22 22 24 316 -23...
result:
ok Correct. (1 test case)
Test #31:
score: 0
Accepted
time: 1ms
memory: 3880kb
input:
1000 1000 161
output:
Yes 999 999 160 1 1 998 159 2 2 997 158 3 3 996 157 4 4 995 156 5 5 994 155 6 6 993 154 7 7 992 153 8 8 991 152 9 9 990 151 10 10 989 150 11 11 988 149 12 12 987 148 13 13 986 147 14 14 985 146 15 15 984 145 16 16 983 144 17 17 982 143 18 18 981 142 19 19 980 141 20 20 979 140 21 21 978 139 22 22 97...
result:
ok Correct. (1 test case)
Test #32:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
1000 1 1000
output:
Yes 999 2 999 -1 1 3 998 -2 2 4 997 -3 3 5 996 -4 4 6 995 -5 5 7 994 -6 6 8 993 -7 7 9 992 -8 8 10 991 -9 9 11 990 -10 10 12 989 -11 11 13 988 -12 12 14 987 -13 13 15 986 -14 14 16 985 -15 15 17 984 -16 16 18 983 -17 17 19 982 -18 18 20 981 -19 19 21 980 -20 20 22 979 -21 21 23 978 -22 22 24 977 -23...
result:
ok Correct. (1 test case)
Test #33:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
1000 759 1000
output:
Yes 999 760 999 -1 1 761 998 -2 2 762 997 -3 3 763 996 -4 4 764 995 -5 5 765 994 -6 6 766 993 -7 7 767 992 -8 8 768 991 -9 9 769 990 -10 10 770 989 -11 11 771 988 -12 12 772 987 -13 13 773 986 -14 14 774 985 -15 15 775 984 -16 16 776 983 -17 17 777 982 -18 18 778 981 -19 19 779 980 -20 20 780 979 -2...
result:
ok Correct. (1 test case)
Test #34:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
1000 1000 1000
output:
Yes 999 999 999 1 1 998 998 2 2 997 997 3 3 996 996 4 4 995 995 5 5 994 994 6 6 993 993 7 7 992 992 8 8 991 991 9 9 990 990 10 10 989 989 11 11 988 988 12 12 987 987 13 13 986 986 14 14 985 985 15 15 984 984 16 16 983 983 17 17 982 982 18 18 981 981 19 19 980 980 20 20 979 979 21 21 978 978 22 22 97...
result:
ok Correct. (1 test case)
Test #35:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
2 1 1
output:
Yes 1 2 2 -1 -1
result:
ok Correct. (1 test case)
Test #36:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
2 1 2
output:
Yes 1 2 1 -1 1
result:
ok Correct. (1 test case)
Test #37:
score: 0
Accepted
time: 0ms
memory: 3448kb
input:
2 2 1
output:
Yes 1 1 2 1 -1
result:
ok Correct. (1 test case)
Test #38:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
2 2 2
output:
Yes 1 1 1 1 1
result:
ok Correct. (1 test case)
Test #39:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
810 114 514
output:
Yes 809 113 515 1 -1 112 516 2 -2 111 517 3 -3 110 518 4 -4 109 519 5 -5 108 520 6 -6 107 521 7 -7 106 522 8 -8 105 523 9 -9 104 524 10 -10 103 525 11 -11 102 526 12 -12 101 527 13 -13 100 528 14 -14 99 529 15 -15 98 530 16 -16 97 531 17 -17 96 532 18 -18 95 533 19 -19 94 534 20 -20 93 535 21 -21 92...
result:
ok Correct. (1 test case)
Test #40:
score: 0
Accepted
time: 1ms
memory: 3896kb
input:
810 514 114
output:
Yes 809 515 115 -1 -1 516 116 -2 -2 517 117 -3 -3 518 118 -4 -4 519 119 -5 -5 520 120 -6 -6 521 121 -7 -7 522 122 -8 -8 523 123 -9 -9 524 124 -10 -10 525 125 -11 -11 526 126 -12 -12 527 127 -13 -13 528 128 -14 -14 529 129 -15 -15 530 130 -16 -16 531 131 -17 -17 532 132 -18 -18 533 133 -19 -19 534 13...
result:
ok Correct. (1 test case)