QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#627217 | #7800. Every Queen | IllusionaryDominance# | AC ✓ | 73ms | 11472kb | C++20 | 2.8kb | 2024-10-10 15:14:19 | 2024-10-10 15:14:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const long long dA[] = {1, 0, 1, 1};
const long long dB[] = {0, 1, 1, -1};
struct Point{
long long x, y;
}P[N];
int n;
struct Line{long long A, B, C;};
bool check_on_line(Point p, Line l){return abs(l.A * p.x + l.B * p.y + l.C) == 0;}
bool legal_point(Point p){return abs(p.x) <= 1e9 && abs(p.y) <= 1e9;}
Line calc_line(Point p, int fx){return (Line){dA[fx], dB[fx], - dA[fx] * p.x - dB[fx] * p.y};}
Point cross_line(Line l1, Line l2){
if(l1.A == l2.A && l1.B == l2.B) return (Point){(long long)2e9, (long long)2e9};
if(l1.A == 0) swap(l1, l2);
if(l2.A){l2.A -= l1.A, l2.B -= l1.B, l2.C -= l1.C;}
long long y = -l2.C / l2.B;
if(l2.C % l2.B) y = 2e9;
long long x = (-l1.B * y - l1.C) / l1.A;
return (Point){x, y};
}
map<double, int>ids;
bool check(Point p){
for (int i = 1; i <= n; ++ i){
int flag = 0;
for (int fx = 0; fx < 4; ++ fx) flag |= check_on_line(p, (Line){dA[fx], dB[fx], - dA[fx] * P[i].x - dB[fx] * P[i].y});
if(flag == 0) return 0;
}
return 1;
}
pair<int, Point> two_point_check(Point p1, Point p2){
for (int fx1 = 0; fx1 < 4; ++ fx1)
for (int fx2 = 0; fx2 < 4; ++ fx2){
if(fx1 == fx2) continue;
Point p = cross_line((Line){dA[fx1], dB[fx1], - dA[fx1] * p1.x - dB[fx1] * p1.y}, (Line){dA[fx2], dB[fx2], - dA[fx2] * p2.x - dB[fx2] * p2.y});
if(legal_point(p) && check(p)) return make_pair(1, p);
}
return make_pair(-1, (Point){0, 0});
}
pair<int, Point> find(long long A, long long B){
ids.clear();
for (int i2 = 1; i2 <= n; ++ i2){
if(ids[A * P[i2].x + B * P[i2].y]){
int i1 = ids[A * P[i2].x + B * P[i2].y];
Line l = (Line){A, B, - A * P[i2].x - B * P[i2].y};
for (int i = 1; i <= n; ++ i)
if (!check_on_line(P[i], l)){
for (int fx = 0; fx < 4; ++ fx){
Point p = cross_line(l, (Line){dA[fx], dB[fx], - dA[fx] * P[i].x - dB[fx] * P[i].y});
if(legal_point(p) && check(p)) return make_pair(1, p);
}
break;
}
pair<int, Point> re = two_point_check(P[i1], P[i2]);
return re;
}
ids[A * P[i2].x + B * P[i2].y] = i2;
}
return make_pair(0, (Point){0, 0});
}
void print(pair<int, Point> ans){
cout << (ans.first == 1 ? "Yes\n" : "No\n");
if(ans.first == 1) cout << ans.second.x << " " << ans.second.y << "\n";
}
int main(){
ios::sync_with_stdio(0); cin.tie(0), cout.tie(0);
int T; cin >> T;
while(T --){
cin >> n;
for (int i = 1; i <= n; ++ i) cin >> P[i].x >> P[i].y;
if(n == 1) {print(make_pair(1, P[1])); continue;}
int flag = 0;
for (int i = 0; i < 4; ++ i){
pair<int, Point> ans = find(dA[i], dB[i]);
if(ans.first != 0){print(ans); flag = 1; break;}
}
if(flag) continue;
pair<int, Point> ans = two_point_check(P[1], P[2]);
print(ans);
}
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3592kb
input:
3 2 1 1 2 2 4 0 1 1 0 3 1 4 0 5 0 1 1 0 1 2 2 2 4 2
output:
Yes 1 2 No Yes 1 2
result:
ok OK (3 test cases)
Test #2:
score: 0
Accepted
time: 1ms
memory: 3604kb
input:
1 4 -100000000 -100000000 100000000 -100000000 -100000000 100000000 100000000 100000000
output:
Yes -100000000 -100000000
result:
ok OK (1 test case)
Test #3:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
330 3 5 1 -3 -5 -2 2 2 1 4 4 0 4 2 -5 3 -3 -5 4 2 -2 2 -4 1 2 4 1 1 5 4 3 5 -2 3 5 2 -3 -3 5 -3 -4 2 -1 -2 -2 1 0 -1 -5 5 4 -3 -2 -4 2 2 0 -5 -4 -3 4 0 0 -3 -5 0 5 5 0 1 1 -1 5 0 2 3 4 1 4 4 5 5 0 3 -4 -5 -5 -3 5 -5 3 -1 2 -4 -4 -1 5 4 1 1 4 5 -1 0 5 2 1 -3 2 5 5 0 4 1 -3 -5 3 -3 0 0 5 0 1 -5 4 -5 5...
output:
Yes 5 -5 Yes 1 0 Yes 2 -3 Yes -4 4 Yes 1 5 No No No Yes 0 -5 Yes 1 -1 No Yes -5 -5 Yes -1 -4 Yes 1 2 Yes -3 2 No Yes -5 -4 Yes -3 2 Yes -5 -4 Yes -2 0 No Yes 2 0 Yes -1 -2 Yes 5 1 Yes 0 -1 Yes 1 5 Yes -5 -2 Yes 4 6 No Yes 5 -4 No Yes 4 3 Yes 3 5 Yes -1 3 Yes -5 1 No No Yes 3 -2 Yes 2 4 Yes 1 -4 Yes ...
result:
ok OK (330 test cases)
Test #4:
score: 0
Accepted
time: 25ms
memory: 3600kb
input:
33773 4 -2 -5 4 -1 -5 4 2 -1 3 5 1 1 0 -2 4 1 -5 -4 4 -3 1 5 -1 1 -2 -3 5 2 -2 -2 0 2 4 -2 -1 4 -5 1 1 1 -4 3 -5 -5 -5 0 -3 -5 1 -3 0 4 -5 -4 2 2 -5 -3 5 -3 1 -5 0 2 -3 -3 -4 -3 1 3 -2 3 -2 -2 5 -4 5 -3 2 5 -1 -5 2 4 0 -1 5 1 0 0 -4 -1 1 -5 4 4 -5 3 3 0 -1 -3 0 3 2 4 0 0 -3 2 -2 4 0 1 2 -3 3 4 1 3 -...
output:
No Yes 5 4 Yes -5 -4 No Yes -2 2 No Yes -5 -5 Yes -3 0 No Yes -5 0 Yes -3 -3 Yes 3 -2 Yes 5 -2 Yes 5 2 No Yes -5 4 No Yes 4 -3 Yes -2 1 Yes -3 1 Yes -2 -3 No Yes 0 1 Yes 3 5 No No Yes 2 2 Yes -4 -4 Yes 2 -3 Yes 4 -5 Yes 4 -2 Yes -1 7 No Yes 4 0 No Yes 1 -3 Yes 3 -1 No No Yes 0 2 No Yes 1 -5 Yes -1 4...
result:
ok OK (33773 test cases)
Test #5:
score: 0
Accepted
time: 19ms
memory: 3596kb
input:
100000 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0...
output:
Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes 0 0 Yes ...
result:
ok OK (100000 test cases)
Test #6:
score: 0
Accepted
time: 19ms
memory: 3660kb
input:
41344 4 -2 1 -1 -1 2 -1 -1 2 2 1 2 -1 1 2 -1 2 1 -2 3 -1 2 1 -2 -2 0 3 2 -1 1 2 1 -2 2 0 -1 -1 0 1 -1 2 1 -2 -1 1 2 2 3 0 -2 -2 -2 0 1 4 2 -1 -2 2 -1 0 -2 1 3 0 0 1 1 2 2 3 0 -1 -1 -1 -2 -1 1 -2 -1 1 0 -1 1 0 0 1 -2 -2 2 1 -1 -2 -1 4 -2 -1 1 1 0 -1 -2 0 4 -1 1 -2 0 2 2 0 2 2 1 -2 -1 1 4 2 1 -2 1 -1 ...
output:
Yes -1 2 Yes 1 1 Yes -1 -2 Yes -1 0 Yes 1 -1 Yes 0 0 Yes -1 2 Yes -2 -1 Yes 2 2 Yes 0 -2 Yes -2 -1 Yes 0 2 Yes 0 -1 Yes -2 -1 Yes 0 -1 Yes 0 0 Yes -2 -2 Yes 1 -1 Yes -2 1 Yes -2 2 Yes 1 1 Yes 2 5 Yes 0 -1 Yes 0 1 Yes 0 0 Yes 2 -1 Yes 1 2 Yes 1 0 Yes -2 2 Yes 1 0 Yes -2 0 Yes 0 0 Yes -1 -2 Yes 0 -2 Y...
result:
ok OK (41344 test cases)
Test #7:
score: 0
Accepted
time: 15ms
memory: 3660kb
input:
10663 7 3 1 -1 -1 1 2 0 1 3 0 2 -2 -2 -1 11 2 -2 1 -2 -1 0 1 3 -3 0 2 2 -1 -3 1 2 3 -1 -3 3 2 0 8 -2 0 0 -2 1 1 -2 -1 -3 -3 -2 -3 -1 0 1 0 15 2 -3 -3 2 1 1 -2 1 -2 -2 3 3 -2 0 -1 -1 -1 2 0 3 0 1 -3 1 0 0 0 2 -2 -3 10 -1 0 0 2 -3 -2 -1 -1 0 0 -3 0 1 2 0 -1 -3 -3 2 2 4 -1 0 3 -2 -3 0 3 2 8 -3 0 2 -1 -...
output:
No No No No No Yes 3 0 No Yes -1 -1 No No Yes -2 0 Yes -3 -2 No No No No No No No No Yes 3 -1 No Yes 3 -2 No No Yes 2 -2 Yes -3 2 No No Yes 3 2 No Yes 0 3 No Yes 5 -1 No No Yes 0 2 No No No No No Yes 4 1 No No Yes -2 -4 No No No Yes -3 2 No No No No No No No Yes -3 -2 No No No No No No No Yes 0 1 Ye...
result:
ok OK (10663 test cases)
Test #8:
score: 0
Accepted
time: 15ms
memory: 3664kb
input:
9675 4 5 -8 -6 -10 10 2 -1 10 8 -8 -1 -9 4 -10 -2 -8 -8 -10 1 -8 -5 2 -4 -3 4 2 2 -5 -3 -4 18 6 -2 8 -7 3 -2 10 8 -2 -2 -1 -10 0 -6 -6 10 9 0 7 -1 -4 10 2 3 -9 -3 5 -9 0 -1 8 5 -9 -7 0 6 14 5 -8 4 9 -2 7 -6 -4 -8 -5 3 -10 2 1 -6 1 -8 -6 -5 -10 -10 0 -7 9 9 7 10 -10 3 2 3 2 4 -8 2 2 0 10 5 1 8 -5 -5 ...
output:
No No Yes 2 -4 No No Yes 2 2 Yes 0 1 No No No No No Yes -5 -1 No Yes -5 -9 No No No No No No No No No No No No Yes 1 3 No No No No No No No Yes -2 -7 No No No No No No No No No No No No No No No No No No No Yes 6 8 No No No No No No No No Yes 1 -10 No No No No No No No No No No No Yes -7 -4 Yes 5 -1...
result:
ok OK (9675 test cases)
Test #9:
score: 0
Accepted
time: 22ms
memory: 3636kb
input:
18336 2 -28 -3 -27 -8 2 21 -25 23 18 6 2 -16 -24 0 19 -18 -7 8 12 -29 29 20 7 -22 -16 8 -28 12 -9 5 14 18 -15 16 -7 26 -12 3 -21 -30 26 18 15 13 5 29 12 -30 -27 -15 -15 7 -3 -6 -20 8 -28 -11 27 8 25 8 11 14 3 -15 3 -14 1 -14 28 -25 8 -11 -9 -7 14 -30 1 19 -29 21 -25 -14 -14 -25 -15 3 17 5 13 4 -23 -...
output:
Yes -28 -8 Yes 21 18 No No No No No No No Yes 23 -4 No Yes 21 16 No Yes 1 22 No No No No No Yes -8 3 Yes -9 29 No No No No Yes 16 29 No No No No Yes 29 5 No No No Yes 16 -17 No No Yes -23 -24 Yes 2 25 No No No No Yes -2 -16 Yes 28 -30 Yes -24 7 Yes -28 -18 Yes 16 -18 No No No Yes -12 -1 No No No No ...
result:
ok OK (18336 test cases)
Test #10:
score: 0
Accepted
time: 33ms
memory: 3656kb
input:
39738 2 31 35 44 8 1 4 -28 2 12 43 -12 13 2 -16 -16 19 -6 3 -1 40 -18 11 17 -46 1 9 36 4 29 -32 13 -7 5 24 18 -31 3 -13 -43 -2 -50 -10 31 2 -25 -12 -20 30 1 49 29 2 14 41 49 19 4 45 -26 5 26 15 21 -9 0 4 -29 6 0 41 34 -11 -7 -3 1 -35 18 4 -31 50 -33 16 -36 -19 9 12 4 -11 -8 2 37 6 13 5 -40 1 30 20 2...
output:
Yes 31 8 Yes 4 -28 Yes 12 13 Yes -16 -6 No Yes 9 36 No No Yes -25 30 Yes 49 29 Yes 14 19 No No Yes -35 18 No No Yes 30 20 Yes 39 36 Yes 2 -28 Yes -6 5 Yes 37 46 No Yes -7 15 Yes -41 -23 Yes -23 31 Yes 19 -27 No Yes 31 46 Yes -11 11 No Yes 34 18 Yes 42 10 No Yes 16 25 Yes -46 16 No No Yes -10 -13 No ...
result:
ok OK (39738 test cases)
Test #11:
score: 0
Accepted
time: 19ms
memory: 3624kb
input:
100000 1 25720 -7437 1 41161 -43283 1 301 -2068 1 -83347 60319 1 -81716 28835 1 -72575 65116 1 8859 -27828 1 34738 92440 1 80487 91784 1 -5793 -21239 1 -60334 -75846 1 79009 -16026 1 78558 -1651 1 -52829 -58727 1 -2153 -58876 1 -64746 30799 1 69134 82923 1 -10500 -77083 1 -15959 -46509 1 17184 18402...
output:
Yes 25720 -7437 Yes 41161 -43283 Yes 301 -2068 Yes -83347 60319 Yes -81716 28835 Yes -72575 65116 Yes 8859 -27828 Yes 34738 92440 Yes 80487 91784 Yes -5793 -21239 Yes -60334 -75846 Yes 79009 -16026 Yes 78558 -1651 Yes -52829 -58727 Yes -2153 -58876 Yes -64746 30799 Yes 69134 82923 Yes -10500 -77083 ...
result:
ok OK (100000 test cases)
Test #12:
score: 0
Accepted
time: 35ms
memory: 3724kb
input:
33248 4 4011 53911 -65222 72560 -58309 -72652 54087 -77099 3 84215 93494 -39147 9885 -99743 50164 4 -86020 42500 -31132 51501 -95265 -73272 79336 -52301 3 35424 75664 68639 -55324 -97553 -81811 5 -52662 -87598 -61048 -71133 57071 -96841 -92280 96599 -12314 79758 5 -30239 91586 -42080 -30101 47354 11...
output:
No No No No No No No Yes -53834 30857 Yes -33238 -24440 No No No Yes -91380 98975 Yes -34037 -47723 No No No No No Yes 69622 87622 Yes 64870 -69058 Yes 95719 -62818 No Yes 33027 69204 No No No No No No No No No Yes 59722 82446 No Yes -70292 -30378 No Yes 13813 -67363 Yes -97591 16425 Yes 41714 87917...
result:
ok OK (33248 test cases)
Test #13:
score: 0
Accepted
time: 37ms
memory: 3720kb
input:
18213 2 83560 -16394 -64607 -2972 4 -97408 -96045 73180 -49275 77310 -53026 60293 82128 2 89814 -68477 9551 2526 4 45152 53548 -98942 91447 76012 71607 -54940 53136 1 53895 13657 2 6991 5450 -48933 8147 2 2375 89999 -23250 71842 9 52896 -51251 -41169 -74405 -9804 -58661 99052 -65848 93012 16117 5504...
output:
Yes 83560 -2972 No Yes 89814 2526 No Yes 53895 13657 Yes 6991 8147 Yes 2375 71842 No No Yes 39469 -33250 No No Yes 3039 68860 No No Yes -45169 15355 No Yes 84770 -65606 No No No No No No No No No No No Yes 70930 -16981 No No No No Yes 91247 59737 Yes 1714 -52312 No Yes -52273 -73438 No Yes 38002 -11...
result:
ok OK (18213 test cases)
Test #14:
score: 0
Accepted
time: 12ms
memory: 4880kb
input:
12 73282 48456 9658 -44253 -47777 70415 89736 -7902 -40555 21517 -46397 12398 64467 -76104 -83148 -36156 91008 -71906 -12870 -56634 9176 -29904 83593 43413 -21468 23018 38228 -39705 -9294 78799 80256 51880 -32455 -27784 94899 -48629 -22413 -57032 -60008 -96094 45483 90292 88165 -59153 -78792 55143 -...
output:
No No No No No No No No No No No Yes 22817 54633
result:
ok OK (12 test cases)
Test #15:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
376 3 21 -12 -44 56 -29 71 1 -37 -6 5 -51 49 3 25 -7 69 -19 47 -32 60 3 -89 19 6 -75 -33 75 4 -82 4 -66 -29 -55 4 -51 4 1 -98 -59 3 -53 -53 -10 25 -28 -51 1 -54 55 3 50 -55 -44 -19 -6 -33 3 44 -10 2 20 16 -41 3 90 99 81 55 81 83 3 -47 18 -4 59 -12 53 1 43 98 1 -57 12 1 -5 -1 4 48 89 -41 -45 -75 -79 ...
output:
Yes 21 121 Yes -37 -6 No Yes 6 114 Yes -66 4 Yes -98 -59 No Yes -54 55 No No Yes 81 99 Yes -4 61 Yes 43 98 Yes -57 12 Yes -5 -1 Yes 48 44 Yes 23 1 Yes 47 17 Yes -60 16 Yes 52 -71 No Yes -90 3 Yes -16 -91 Yes 8 74 Yes -20 -29 Yes 50 36 Yes -48 -87 Yes -55 63 Yes 62 -10 Yes -51 -60 Yes -10 -91 Yes -80...
result:
ok OK (376 test cases)
Test #16:
score: 0
Accepted
time: 1ms
memory: 3664kb
input:
36 7 5 -12 -37 -46 -62 -12 -19 -30 -60 -12 -48 -12 -65 -12 53 75 16 38 16 49 16 88 16 27 16 36 16 55 16 53 16 95 16 94 16 20 16 21 -21 65 16 70 16 69 16 66 16 76 16 33 16 58 -33 44 16 59 16 72 16 8 16 23 16 9 16 13 16 64 16 32 16 58 0 24 16 48 16 100 16 41 16 67 16 68 16 22 16 87 16 73 16 39 16 12 1...
output:
Yes -37 -12 Yes 58 16 Yes 26 100 Yes -74 -14 No Yes -26 107 Yes 58 -20 No Yes -21 7 Yes -38 4 Yes 33 -100 Yes -88 -50 Yes 37 -96 Yes 97 -35 Yes -61 -94 No Yes 15 81 Yes 29 18 Yes -56 87 Yes 57 -20 Yes -85 61 Yes -38 -46 Yes 23 -47 No No Yes -98 -12 Yes 10 17 Yes -81 -13 Yes 25 -24 Yes -37 -97 Yes -2...
result:
ok OK (36 test cases)
Test #17:
score: 0
Accepted
time: 26ms
memory: 3660kb
input:
38250 1 -71 -9 5 -35 4 13 17 36 4 -4 4 -11 4 2 32 -58 -6 -73 3 -66 -21 -65 -20 -66 -62 1 -47 -90 1 67 -1 1 -40 -34 3 -12 71 -46 71 -68 71 3 -45 85 -6 60 -9 82 2 8 84 86 -47 3 -63 55 30 90 -56 40 5 81 -27 -74 -20 -30 53 -69 -15 -30 -2 5 -69 -51 -38 -56 3 -97 -43 -96 -70 -24 1 -85 -75 5 -15 -53 -95 -1...
output:
Yes -71 -9 Yes 13 4 Yes 32 -73 Yes -66 -20 Yes -47 -90 Yes 67 -1 Yes -40 -34 Yes -12 71 Yes -6 85 Yes 8 -47 No No Yes -43 -51 Yes -85 -75 No Yes 61 69 Yes 27 79 Yes -31 59 Yes -97 39 Yes 26 89 Yes -61 -47 Yes 14 41 Yes -18 55 Yes 33 -18 Yes 37 47 Yes -46 -48 Yes -17 -95 Yes -20 -59 Yes -48 8 Yes -80...
result:
ok OK (38250 test cases)
Test #18:
score: 0
Accepted
time: 22ms
memory: 3596kb
input:
21678 7 57 83 63 77 68 72 45 95 85 55 71 69 60 96 4 51 91 44 84 43 -55 53 51 2 -86 81 5 -56 3 -48 -6 -80 -38 -62 6 7 -15 73 -15 59 -15 83 -15 49 -15 76 -15 94 -15 60 9 -13 8 -13 17 -13 18 -13 -50 -13 35 -13 -23 -13 34 -13 -6 -13 42 3 40 -63 83 -36 44 -67 5 -57 64 -47 40 -54 40 -95 40 -22 40 9 -87 -7...
output:
Yes 60 80 No Yes -86 -56 Yes -62 -20 Yes -15 59 Yes -13 17 Yes 83 -106 Yes -57 40 No No Yes 99 90 No Yes 98 50 Yes 93 -56 No Yes 34 -84 Yes 32 -30 No Yes 8 -74 Yes -10 77 No No Yes -43 10 Yes 74 81 Yes -32 -29 Yes -18 -49 No No Yes 34 -82 Yes 68 -51 Yes 60 138 Yes -42 69 Yes -76 -94 Yes 81 1 Yes -47...
result:
ok OK (21678 test cases)
Test #19:
score: 0
Accepted
time: 32ms
memory: 3644kb
input:
38031 2 34020723 8239345 96663022 -53883165 3 86840549 -42430280 71644095 5956538 49933723 30642832 5 55112712 33477733 33812854 13213047 55468132 -8442231 63342437 -16316536 45778536 33477733 5 -40033178 50867370 -8653896 53384752 -9420867 50867370 -3826315 50867370 12182283 50867370 3 -69673375 91...
output:
Yes 34020723 -53883165 No Yes 13548168 33477733 Yes -8653896 50867370 No Yes 77957797 8615711 No Yes -95477857 6807868 Yes -10973397 -46321533 Yes 29067626 -37879764 Yes -56081973 -20683199 Yes 44076829 34198829 Yes -44728643 77741768 Yes 94570174 -85962294 Yes 79270965 32547632 Yes 17818216 -957152...
result:
ok OK (38031 test cases)
Test #20:
score: 0
Accepted
time: 24ms
memory: 3724kb
input:
21402 2 -64579901 -74329677 -20994959 -45151167 4 76282770 54962460 76282770 90135060 76282770 87339000 76282770 90059212 7 -78215169 9670558 -29772494 9670558 -58300956 9670558 -20921867 9670558 -5374544 9670558 -60834676 9670558 -77752192 9670558 2 72103587 61733561 41131637 93025543 2 48107017 -9...
output:
Yes -64579901 -45151167 Yes 76282770 90135060 Yes -78215169 9670558 Yes 72103587 93025543 Yes 48107017 -49022126 No Yes 95305394 -65871859 Yes 85302550 47064195 Yes 45931184 -26379913 Yes 16429362 22770100 Yes 92854648 -58989609 No Yes 39771370 67262990 Yes -15252818 47155441 Yes 69704734 -56802751 ...
result:
ok OK (21402 test cases)
Test #21:
score: 0
Accepted
time: 25ms
memory: 3716kb
input:
11466 15 59883513 -2073195 72007848 10051140 72894155 10937447 21210749 -40745959 69730665 7773957 13463482 -48493226 81294534 19337826 82764975 20808267 74693443 12736735 48056353 -13900355 74056094 63649616 26024854 -35931854 30806547 -31150161 51863468 -10093240 26040272 -35916436 1 8906295 76373...
output:
Yes 74056094 12099386 Yes 8906295 76373253 Yes -66554988 -62523894 Yes 41111496 61138114 Yes 95075800 52750455 Yes -79116470 54206114 No Yes -94685176 -99505284 Yes -22668385 44659674 Yes 43299608 18117481 Yes -26462700 63271615 Yes -85127986 41770447 Yes -14780418 -89727803 No Yes 69343557 56765770...
result:
ok OK (11466 test cases)
Test #22:
score: 0
Accepted
time: 26ms
memory: 3672kb
input:
2374 8 80171282 -7970988 90530464 -7970988 94515630 -7970988 67903596 -7970988 68473134 -7970988 66846181 -7970988 89920403 -7970988 77340189 -7970988 47 -80585182 73218352 -50635638 43268808 -58967884 51601054 -71338457 63971627 -95428893 88062063 -27599821 20232991 -45242309 37875479 -81024686 736...
output:
Yes 80171282 -7970988 Yes -80585182 73218352 No Yes 18226365 34002270 Yes 40572801 42904910 Yes 13601122 -24205245 Yes -26267527 58352122 Yes 8099865 -65610049 No Yes -67654562 52808377 No No Yes 53367018 -24986288 No Yes -36480703 -45718682 Yes -22857945 -13904913 Yes 13160351 29667948 Yes 83529831...
result:
ok OK (2374 test cases)
Test #23:
score: 0
Accepted
time: 29ms
memory: 3676kb
input:
495 64 -21368080 -72850405 -85833696 90257396 -35915936 -58302549 -15925459 -78293026 -30025678 -64192807 -20646405 -73572080 160784 -79015396 -29013484 -65205001 -33711159 -60507326 -56255295 -37963190 -59625837 -34592648 -43071457 -51147028 -56204310 -38014175 -5994443 -88224042 -41934232 -5228425...
output:
No Yes -29395158 34645498 Yes -36890600 15479221 No No Yes -60911690 55429433 Yes -5539709 -10114835 No Yes 4859968 39029958 No No No Yes 35039029 72031692 No No Yes 72026368 -19639807 Yes 24017187 -9384822 Yes -75397783 -37470215 No Yes -47008899 67349531 No Yes 42236203 69440652 Yes 91434570 -9490...
result:
ok OK (495 test cases)
Test #24:
score: 0
Accepted
time: 32ms
memory: 3740kb
input:
248 625 -81955368 42113025 -59734335 19891992 -49896979 10054636 -93943839 54101496 -57293721 17451378 -95370351 55528008 -80969337 41126994 -59859616 20017273 -80746055 40903712 -63054108 23211765 -85729412 45887069 -79459890 39617547 -75207406 35365063 -96821217 56978874 -68473967 28631624 -917114...
output:
Yes -81955368 42113025 No No Yes -63305508 96308920 Yes -94463280 171358527 Yes -28759823 35797945 Yes -40767426 15678156 No Yes 60065553 74277233 No Yes -54954518 -125808042 Yes 69590952 -65105937 Yes 42972981 -38779275 Yes -26191094 -21885510 Yes 94165006 -51077522 Yes -80160899 -11658069 No Yes 2...
result:
ok OK (248 test cases)
Test #25:
score: 0
Accepted
time: 45ms
memory: 4392kb
input:
33 6818 -64604806 -76001331 -2467317 -76001331 -57044757 -76001331 -9135480 -76001331 -9998308 -76001331 -72127204 -76001331 -85067127 -76001331 -77665130 -76001331 -33241448 -76001331 -35999647 -76001331 -14392790 -76001331 -67179688 -76001331 -79626590 -76001331 -54021051 -76001331 -51851904 -7600...
output:
Yes -71517096 -76001331 No Yes -75294964 70854008 No Yes -34128783 33043663 Yes 83734080 -78573243 Yes 51944890 50843188 Yes -50601348 37596513 Yes 1765713 109521367 No Yes 85478121 -85233459 No Yes 60504699 49894914 Yes 31623922 24903534 Yes 79076289 -67291753 No No Yes -58430685 35457104 Yes 22500...
result:
ok OK (33 test cases)
Test #26:
score: 0
Accepted
time: 28ms
memory: 5488kb
input:
17 7908 84275976 60856253 84275976 31641554 84275976 61036050 84275976 89857801 84275976 43497229 84275976 92130777 84275976 83307782 84275976 44228789 84275976 76193303 84275976 74671612 84275976 77654406 84275976 85472464 84275976 67678331 84275976 40701720 84275976 64574338 84275976 93233738 8427...
output:
Yes 84275976 79697092 Yes 45253181 75086775 Yes -1877237 -53223053 No Yes 96959994 -22168055 No Yes 15298623 -51882222 No Yes 52990382 -43957802 Yes -48375204 47446129 Yes -92569150 -65291983 Yes 60256342 -141625148 Yes 85547432 37365195 Yes 65014505 95582360 Yes -10417414 1120001 Yes 2828343 -59870...
result:
ok OK (17 test cases)
Test #27:
score: 0
Accepted
time: 47ms
memory: 5036kb
input:
19 13815 76199909 64782203 96380409 84962703 63439444 52021738 99623586 88205880 79335901 67918195 73300481 61882775 46498808 35081102 57971554 46553848 36393618 24975912 57106554 45688848 95888945 84471239 69715057 58297351 68912613 57494907 71586866 60169160 43638549 32220843 42737438 31319732 771...
output:
Yes 76199909 64782203 Yes -87216993 22463943 No Yes 89912555 -51815596 Yes -54200240 -14496401 Yes 74984191 -34161003 Yes 5301332 -47942594 No Yes -12641122 72266413 Yes -82564980 51778844 Yes 85124164 -196077099 Yes -44975181 28043760 Yes 26921008 -17210122 No Yes 9997399 150534503 No Yes -60357520...
result:
ok OK (19 test cases)
Test #28:
score: 0
Accepted
time: 60ms
memory: 8876kb
input:
19 8713 87080448 -1532820 75259515 -1532820 66038726 -1532820 83654472 -1532820 52682642 -1532820 41453202 -1532820 54073355 -1532820 45569416 -1532820 93729097 -1532820 33251552 -1532820 81605062 -1532820 62148368 -1532820 72403593 -1532820 34089505 -1532820 27347968 -1532820 92303233 -1532820 7379...
output:
Yes -11418346 -1532820 Yes -36940720 -87939175 Yes -52883368 -46220219 Yes 29154267 54803731 Yes 92026074 76619775 Yes 78101947 44406282 Yes 27346147 54610689 Yes -42425532 -46777579 Yes -28807408 29877167 Yes 75248451 22539155 Yes 2042407 -66763719 Yes 69847958 69763913 Yes -94425759 -85236227 No Y...
result:
ok OK (19 test cases)
Test #29:
score: 0
Accepted
time: 23ms
memory: 7032kb
input:
1 100000 -77962930 32280567 53651975 53396419 80860031 8056191 -31484112 -17711416 -66176294 -61670181 -22008279 3193578 -31027911 85282928 12782852 94514926 45641472 50556902 8519370 -4435753 -71903432 72277968 -92407184 79943834 63804399 30413582 -21289803 70710183 -89379033 61089957 -39509865 306...
output:
No
result:
ok OK (1 test case)
Test #30:
score: 0
Accepted
time: 17ms
memory: 5876kb
input:
1 100000 97511607 82234548 -84696122 96671522 67974826 82843946 54376292 48567387 -50362196 18944277 2025154 98335316 75568135 35675079 -73764753 35937088 -12154799 27031146 84609173 43782448 -99609967 -91988376 -41542579 9021562 -9319269 -88900836 13849388 -28214715 -72215427 98315090 94285949 -165...
output:
No
result:
ok OK (1 test case)
Test #31:
score: 0
Accepted
time: 9ms
memory: 5128kb
input:
1 93968 27914748 -98136647 27914748 -71675408 27914748 -36170094 27914748 -30968251 27914748 -44797550 27914748 -33801366 27914748 -21568681 27914748 -26528801 27914748 -91705176 27914748 -18135217 27914748 -46131609 27914748 -31086671 27914748 -44018387 27914748 -38109687 27914748 -39199467 2791474...
output:
No
result:
ok OK (1 test case)
Test #32:
score: 0
Accepted
time: 57ms
memory: 9512kb
input:
1 75799 -104709 76386643 356647 75925287 27396507 48885427 49750047 26531887 -8901262 85183196 -2395956 78677890 41916282 34365652 44678607 31603327 -23599529 99881463 -1554908 77836842 -15145936 91427870 25451809 50830125 31431822 44850112 -219040 76500974 26398550 49883384 44787459 31494475 262457...
output:
No
result:
ok OK (1 test case)
Test #33:
score: 0
Accepted
time: 56ms
memory: 11400kb
input:
1 99943 -23467350 66819005 -13391895 66819005 -15028789 66819005 2623154 66819005 -61839177 66819005 -2917542 66819005 -70307212 66819005 4345840 66819005 -56294426 66819005 -49218496 66819005 16982174 66819005 -64330079 66819005 15548411 66819005 -33081331 66819005 -61508796 66819005 24612396 66819...
output:
No
result:
ok OK (1 test case)
Test #34:
score: 0
Accepted
time: 9ms
memory: 5156kb
input:
1 99951 -50228628 -68459564 -50228628 -45997646 -50228628 -32781802 -50228628 -42246008 -50228628 -85576863 -50228628 -4288688 -50228628 -84015329 -50228628 1347982 -50228628 -53240502 -50228628 -12095966 -50228628 -16809348 -50228628 -53566506 -50228628 -65533987 -50228628 -6260633 -50228628 -32335...
output:
No
result:
ok OK (1 test case)
Test #35:
score: 0
Accepted
time: 73ms
memory: 11200kb
input:
1 96536 4839393 -29488753 -13094779 -11554581 -2634509 -22014851 11106581 -35755941 11733900 -36383260 61072090 -85721450 36177474 -60826834 8532500 -33181860 55824625 -80473985 21416264 -46065624 43027387 -67676747 25446021 -50095381 71788871 -96438231 10696691 -35346051 -4657015 -19992345 41848751...
output:
Yes -64716364 40067004
result:
ok OK (1 test case)
Test #36:
score: 0
Accepted
time: 45ms
memory: 6860kb
input:
1 41271 77118141 -81559287 93211369 -65466059 89899696 -68777732 86434039 -72243389 86589162 -72088266 96650212 -62027216 97762262 -60915166 93812918 -64864510 93321574 -65355854 61511803 -97165625 79871094 -78806334 67745025 -90932403 82386822 -76290606 88697166 -69980262 73754178 -84923250 9467384...
output:
No
result:
ok OK (1 test case)
Test #37:
score: 0
Accepted
time: 49ms
memory: 11472kb
input:
1 99937 -20372996 69318243 -43778571 69318243 1345960 69318243 -30406980 69318243 -20988380 69318243 -65248243 69318243 -63219511 69318243 -14740343 69318243 -73028260 69318243 25728733 69318243 -45801907 69318243 3715388 69318243 -46600298 69318243 15326364 69318243 -31715852 69318243 -41231618 693...
output:
Yes -51916387 69318243
result:
ok OK (1 test case)
Test #38:
score: 0
Accepted
time: 47ms
memory: 8168kb
input:
1 57068 -30801353 43813214 -86702270 99714131 -64063108 77074969 -54702596 67714457 -41819520 54831381 -64866930 77878791 -37609590 50621451 -69440388 82452249 -78223566 91235427 -46304344 59316205 -62156679 75168540 -85160270 98172131 -37252913 50264774 -43607472 56619333 -40714731 53726592 -307536...
output:
Yes -79882375 92894236
result:
ok OK (1 test case)
Test #39:
score: 0
Accepted
time: 13ms
memory: 5180kb
input:
1 99946 -77362156 29852115 -77362156 26530481 -77362156 23169364 -77362156 49090276 -77362156 -31579958 -77362156 7051424 -77362156 29421861 -77362156 63139868 -77362156 -25489413 -77362156 38174896 -77362156 -33501186 -77362156 7154997 -77362156 -24981772 -77362156 26122644 -77362156 -1549781 -7736...
output:
No
result:
ok OK (1 test case)
Test #40:
score: 0
Accepted
time: 13ms
memory: 5272kb
input:
1 99956 -74841937 -13040257 -74841937 -19057833 -74841937 -11686629 -74841937 27879065 -74841937 3080980 -74841937 65203572 -74841937 -11037556 -74841937 -16037441 -74841937 27767795 -74841937 2403607 -74841937 73575427 -74841937 -1424980 -74841937 54572997 -74841937 69563716 -74841937 73743334 -748...
output:
Yes -74841937 -65652078
result:
ok OK (1 test case)
Test #41:
score: 0
Accepted
time: 8ms
memory: 4472kb
input:
1 56523 65594136 -63034957 65594136 -61906146 65594136 -99405461 65594136 -47376644 65594136 -66879791 65594136 -49288718 65594136 -79419950 65594136 -71808514 65594136 -99851564 65594136 -45673481 65594136 -61408789 65594136 -49330864 65594136 -87016991 65594136 -80755839 65594136 -63315154 6559413...
output:
Yes 65594136 -93492369
result:
ok OK (1 test case)
Test #42:
score: 0
Accepted
time: 13ms
memory: 5224kb
input:
1 100000 -86023241 27460069 -86825348 20984542 -80349821 4144251 -87147790 20662100 -88998968 18810922 -72844369 19954617 -80349821 5448290 -80349821 9363598 -80349821 11040852 -63000471 44809419 -80349821 8115997 -75781788 27460069 -93637185 27460069 -80349821 13571302 -74831469 27460069 -64428799 ...
output:
Yes -80349821 27460069
result:
ok OK (1 test case)
Test #43:
score: 0
Accepted
time: 13ms
memory: 5224kb
input:
1 100000 -4378042 16850942 2344085 16155125 18179155 320055 11214502 19864097 14242998 19864097 -1364887 37660182 5470725 13028485 -18187540 3041444 -1364887 29059216 22567530 -4068320 -1364887 28622922 20227818 41456802 -1364887 36906370 7248263 11250947 3768751 24997735 -1364887 25998428 -26260587...
output:
No
result:
ok OK (1 test case)
Test #44:
score: 0
Accepted
time: 13ms
memory: 5280kb
input:
1 100000 78307293 -82011905 86061303 -91140407 77620047 -69190396 77620047 -97974165 96417447 -82699151 77620047 -89716161 89002063 -94081167 88388984 -93468088 89900664 -82699151 84143322 -76175876 77620047 -71598549 56077348 -82699151 93531714 -98610818 85473274 -90552378 97823568 -62495630 755726...
output:
No
result:
ok OK (1 test case)
Test #45:
score: 0
Accepted
time: 10ms
memory: 5152kb
input:
1 100000 51572255 9374835 49219858 4672151 51572255 20758838 56258178 -13772 51572255 10657855 51572255 28898726 60937094 -4692688 27661333 4672151 50515617 4672151 51572255 14707426 59453532 -3209126 48480959 4672151 51572255 21529679 51572255 14295475 51572255 12840571 71329773 -15085367 51572255 ...
output:
No
result:
ok OK (1 test case)
Test #46:
score: 0
Accepted
time: 13ms
memory: 5220kb
input:
1 100000 43444161 -82927665 25524463 -61082967 25524463 -61726353 26888123 -66371627 26060372 -64472058 25524463 -55659730 25524463 -60280346 25524463 -61316273 48166785 -87650289 29479400 -68962904 41309458 -49222972 25524463 -47570168 43917149 -46615281 25524463 -61183427 25524463 -79330678 373304...
output:
No
result:
ok OK (1 test case)
Test #47:
score: 0
Accepted
time: 14ms
memory: 5212kb
input:
1 100000 -21087551 -72603940 11009734 -84137003 17532278 -90659547 -21192212 -72603940 -12323320 -72603940 2503835 -75631104 8738275 -72603940 7938971 -72603940 20485542 -72603940 7128060 -72603940 -7567396 -65559873 -23890351 -49236918 -3009003 -70118266 9829151 -82956420 5518686 -72603940 -2309228...
output:
Yes -523329 -72603940
result:
ok OK (1 test case)
Test #48:
score: 0
Accepted
time: 14ms
memory: 5220kb
input:
1 100000 -13960856 -98438984 1640725 -98438984 -11066056 -84576182 -11066056 -95930647 -11066056 -93447815 -11049347 -98455693 9050289 -78322639 2065906 -98438984 -29339376 -80165664 -12739414 -96765626 -11066056 -77361246 -9560553 -96933481 -11066056 -82455420 2096030 -85276898 -7862430 -95235358 -...
output:
Yes -11066056 -98438984
result:
ok OK (1 test case)
Test #49:
score: 0
Accepted
time: 14ms
memory: 5208kb
input:
1 100000 37235031 -11293593 29991429 -4049991 43566613 16776009 26366021 18085303 26366021 -12453540 27073252 -1131814 19913564 -424583 26366021 11449564 47948736 -22007298 7643082 -19147522 26366021 -13056047 18515405 7426033 26366021 22232827 49482460 -23541022 29909761 -424583 43301832 -17360394 ...
output:
No
result:
ok OK (1 test case)
Test #50:
score: 0
Accepted
time: 3ms
memory: 5280kb
input:
1 100000 85149432 53750817 75275029 83786266 94894496 44005753 75275029 43070390 65331150 53681341 93815618 45084631 86290632 52609617 55246280 83653969 75275029 45659593 75275029 78491772 75275029 61522406 75275029 41452205 75275029 45586370 75275029 70463354 75275029 59124496 75275029 71104430 781...
output:
Yes 75275029 63625220
result:
ok OK (1 test case)
Test #51:
score: 0
Accepted
time: 13ms
memory: 5228kb
input:
1 100000 -36803359 64350994 -24512633 52060268 -32118390 59666025 -30215562 63932117 -17992358 82324241 -33656683 63932117 -17031300 44578935 -14232034 63932117 -27369807 54917442 -55447949 63932117 -21471288 49018923 -49094435 76642070 -36384482 48057336 -14950894 63932117 -36384482 61012241 -49406...
output:
Yes -36384482 63932117
result:
ok OK (1 test case)
Test #52:
score: 0
Accepted
time: 13ms
memory: 5216kb
input:
1 100000 -79025155 56336144 -58614376 56336144 -66285113 56336144 -65754892 53013526 -84924035 33844383 -80379485 38388933 -68844244 62748114 -50431757 56336144 -62432274 74700617 -42006207 76762211 -43109786 75658632 -54926603 48830473 -56760914 62007504 -46891175 40795045 -70284467 64188337 -62432...
output:
Yes -62432274 56336144
result:
ok OK (1 test case)
Test #53:
score: 0
Accepted
time: 10ms
memory: 5280kb
input:
1 100000 5065321 -44805215 16552660 -53733360 1706682 -56292554 16862387 -56602281 32895824 -56292554 3654583 -56292554 3220358 -69624856 -243880 -56292554 35845162 -75585056 -321200 -56292554 15046559 -56292554 16552660 -38251493 40898416 -31946798 913111 -71932103 18296515 -56292554 13415139 -5943...
output:
Yes 16552660 -56292554
result:
ok OK (1 test case)
Test #54:
score: 0
Accepted
time: 10ms
memory: 5212kb
input:
1 100000 85472143 -86770627 74150867 -75209803 65351905 -84008765 80663460 -68697210 85472143 -81662746 85551658 -63809012 92741062 -56619608 85472143 -86607034 88172192 -66588576 81909277 -67451393 68385251 -80975419 88889521 -67305905 85379899 -63980771 84600277 -64760393 85472143 -43450710 992165...
output:
Yes 85472143 -63888527
result:
ok OK (1 test case)
Test #55:
score: 0
Accepted
time: 9ms
memory: 5152kb
input:
1 100000 -51717281 -44710277 -44990939 -37983935 -35542924 -11737740 -47457417 -28535920 -19104414 -44974430 -10639584 -28535920 -30289771 -28535920 -29268191 -28535920 -35542924 -44537719 -15511350 -28535920 -42333414 -28535920 -37259749 -30252745 -42129841 -28535920 -57280774 -50273770 -19517808 -...
output:
No
result:
ok OK (1 test case)
Test #56:
score: 0
Accepted
time: 12ms
memory: 5132kb
input:
1 100000 67606994 83000367 30865313 71412080 66887762 35389631 24958847 77318546 43442010 77923115 46812962 55464431 43442010 71243711 52799492 49477901 45553853 56723540 43442010 43429435 43442010 35548641 43442010 57837264 38078665 58835383 24775837 58835383 43442010 40812014 19222734 83054659 582...
output:
No
result:
ok OK (1 test case)
Test #57:
score: 0
Accepted
time: 12ms
memory: 5228kb
input:
1 100000 26406221 42227407 38138203 30495425 -7112138 26733054 23407008 45226620 10161047 44006239 17394218 69216446 22279907 46353721 14560042 54073586 22016958 46616670 2629436 66004192 21095880 47537748 31475496 37158132 27485950 41147678 17561022 51072606 17394218 51757849 10059978 51239410 1739...
output:
No
result:
ok OK (1 test case)
Extra Test:
score: 0
Extra Test Passed