QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#137612 | #2350. Integer Cow | ckz | TL | 1786ms | 3740kb | C++23 | 4.5kb | 2023-08-10 14:38:51 | 2023-08-10 14:38:52 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define all(a) (a).begin(),(a).end()
using namespace std;
const long double eps = 1e-10;
const long double PI = acos(-1);
struct Point{
long double x, y;
bool operator==(const Point &a) const{
return (abs(x-a.x) <= eps && abs(y-a.y)<=eps);
}
Point operator - (const Point &a) const{
return {x-a.x,y-a.y};
}
Point operator + (const Point &a) const{
return {x+a.x,y+a.y};
}
Point operator * (const double k) const{
return {k * x, k * y};
}
Point operator / (const double k) const{
return {x / k, y / k};
}
long double operator * (const Point &a) const{
return {x*a.x + y*a.y};
}
long double operator ^ (const Point &a) const{
return {x*a.y - y*a.x};
}
double len2() const{
return (*this) * (*this);
}
long double len() const{
return sqrt(len2());
}
long double dis2(const Point &a)const{
return (a-(*this)).len2();
}
long double dis(const Point &a) const{
return sqrtl(dis2(a));
}
}cow, cao;
struct Line{
Point p, v;
long double dis(const Point &a) const{
return abs((v^(a-p)) / v.len());
}
Point proj(const Point &a) const{
return p + v * ((v * (a-p)) / (v * v));
}
}l;
struct Circle{
Point c;
long double r;
bool operator==(const Circle &a) const {return c==a.c && abs(r-a.r)<=eps;}
// 点与圆的关系
// -1 圆上 | 0 圆外 | 1 圆内
int is_in(const Point &p) const {const long double d=p.dis(c); return abs(d-r)<=eps?-1:d<r-eps;}
// 直线与圆关系
// 0 相离 | 1 相切 | 2 相交
int relation(const Line &l) const{
const long double d=l.dis(c);
if (d>r+eps) return 0;
if (abs(d-r)<=eps) return 1;
return 2;
}
// 圆与圆关系
// -1 相同 | 0 相离 | 1 外切 | 2 相交 | 3 内切 | 4 内含
int relation(const Circle &a) const{
if (*this==a) return -1;
const long double d=c.dis(a.c);
if (d>r+a.r+eps) return 0;
if (abs(d-r-a.r)<=eps) return 1;
if (abs(d-abs(r-a.r))<=eps) return 3;
if (d<abs(r-a.r)-eps) return 4;
return 2;
}
// 直线与圆的交点
vector<Point> inter(const Line &l) const{
const long double d=l.dis(c);
const Point p=l.proj(c);
const int t=relation(l);
if (t==0) return vector<Point>();
if (t==1) return vector<Point>{p};
const long double k=sqrtl(r*r-d*d);
return vector<Point>{p-(l.v/l.v.len())*k,p+(l.v/l.v.len())*k};
}
}cy;
int ti;
void solve(){
cin >> cao.x >> cao.y >> cy.r;
cy.c = cao;
cin >> cow.x >> cow.y;
l.p = cow;
l.v = (cao - cow);
Point tmp = cao - cow;
long long x2 = tmp.len2();
long long r2 = cy.r * cy.r;
if(x2 <= r2){
cout << 0 << "\n";
cout << (ll)cow.x << " " << (ll)cow.y << "\n";
return;
}
long long midis = LLONG_MAX;
Point ansp;
vector<Point> it = cy.inter(l);
Point inter = it[0];
long long mix = min(cow.x, cao.x);
long long mxx = max(cow.x, cao.x);
long long miy = min(cow.y, cao.y);
long long mxy = max(cow.y, cao.y);
if(!(inter.x >= mix && inter.x <= mxx && inter.y >= miy && inter.y <= mxy)){
inter = it[1];
}
// cout << it[0].x << " " << it[0].y << " " << it[1].x << " " << it[1].y << "qwq\n";
long long Lx = min(ceil(inter.x - ti), ceil(inter.x + ti));
long long Rx = max(ceil(inter.x - ti), ceil(inter.x + ti));
long long Ly = min(ceil(inter.y - ti), ceil(inter.y + ti));
long long Ry = max(ceil(inter.y - ti), ceil(inter.y + ti));
for(long long x = Lx; x <= Rx ; x ++){
for(long long y = Ly ; y <= Ry ; y ++){
long long dis2 = (x - cao.x) * (x - cao.x) + (y - cao.y) * (y - cao.y);
if(dis2 <= r2){
long long dds = (x - cow.x) * (x - cow.x) + (y - cow.y) * (y - cow.y);
if(dds < midis){
midis = dds;
ansp.x = x;
ansp.y = y;
}
}
}
}
cout << "1\n";
cout << (ll)cow.x << " " << (ll)cow.y << " " << (ll)ansp.x << " " << (ll)ansp.y << "\n";
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);cout.tie(nullptr);
int t = 1;
cin >> t;
ti=min(140000/t,4500);
while(t--) solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 207ms
memory: 3624kb
input:
3 1 2 1 1 2 3 2 5 -10 3 0 0 1 10 0
output:
0 1 2 1 -10 3 -2 2 1 10 0 1 0
result:
ok correct (3 test cases)
Test #2:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
1 0 0 1 0 0
output:
0 0 0
result:
ok correct (1 test case)
Test #3:
score: 0
Accepted
time: 759ms
memory: 3636kb
input:
100 -1 0 2 -3 -2 0 -2 2 -2 0 2 -1 1 0 1 -1 -3 1 -1 0 -1 2 2 -1 -1 2 -2 2 0 -3 -2 -3 2 -3 -2 0 1 2 2 1 -1 0 1 -2 -2 2 -2 2 -1 -2 1 2 2 -2 2 -1 2 1 -1 2 -2 1 2 -3 -2 -1 1 1 -1 1 2 2 1 1 -3 2 0 1 -2 -1 -1 2 1 -2 0 2 -2 2 -2 -1 -2 -2 1 1 -2 -1 1 2 2 1 2 -3 1 0 -1 -3 -3 2 2 -1 2 1 1 -1 1 -3 -2 1 -2 -3 0 ...
output:
1 -3 -2 -2 -1 1 -2 0 -1 -1 1 0 1 1 -1 1 -1 0 -1 -2 1 -1 -1 -1 0 1 0 -3 0 -2 0 -3 -2 0 2 1 1 -2 -2 -1 -1 1 -1 -2 0 -2 1 -2 2 -1 2 0 -1 2 1 -3 -2 -2 -1 0 -1 1 1 1 -3 2 1 1 -2 -1 1 0 1 -2 0 -1 1 1 -2 -1 0 -2 1 1 -2 -1 -2 1 2 1 1 1 1 0 -1 1 -3 1 2 -1 -1 -3 1 -1 1 1 1 1 -2 -3 -3 -3 0 -2 -2 0 -2 -2 0 1 -1...
result:
ok correct (100 test cases)
Test #4:
score: 0
Accepted
time: 889ms
memory: 3600kb
input:
100 -5 9 1 -2 -7 3 1 6 9 2 -2 -1 2 -7 3 -10 -8 7 -8 6 0 3 9 -6 -7 6 4 9 -1 4 8 6 7 -7 7 3 -7 7 2 0 -5 -1 6 -7 -7 -5 8 7 -9 -6 -6 -5 5 -10 -9 -7 1 9 7 -2 -4 9 4 8 3 3 -9 6 2 -2 -1 -7 3 -8 2 -2 -5 4 -1 0 1 2 9 -5 5 0 9 5 -4 -1 -10 8 2 -3 -7 -8 -3 3 2 -3 3 3 7 -4 6 6 0 6 -3 5 -7 5 9 9 9 2 0 2 8 -10 2 1...
output:
1 -2 -7 -5 8 1 9 2 8 2 1 -7 3 -4 -1 1 -8 6 -10 -1 1 -6 -7 -4 -5 0 -1 4 1 -7 7 1 6 1 2 0 2 -1 1 -7 -7 -7 -6 1 -9 -6 -8 2 1 -10 -9 -10 -8 1 7 -2 2 1 1 8 3 -1 7 1 2 -2 3 -3 1 -8 2 -3 -5 1 -1 0 -2 -1 0 -5 5 1 -4 -1 -3 5 1 -3 -7 -10 6 1 2 -3 -5 -3 1 -4 6 -3 6 1 -3 5 1 3 1 9 9 1 9 1 8 -10 2 -2 1 7 -1 5 1 ...
result:
ok correct (100 test cases)
Test #5:
score: 0
Accepted
time: 787ms
memory: 3688kb
input:
100 -52 -13 72 44 58 79 -58 32 60 11 -50 21 75 95 65 -37 -61 21 -74 -40 0 -88 14 11 -49 10 -80 46 79 -17 75 -94 90 61 -34 -80 19 85 -7 -20 -72 42 56 67 -89 21 51 39 20 88 82 32 56 88 -82 3 51 31 -45 -53 50 12 91 9 46 -45 29 25 76 27 -19 -14 81 22 97 5 93 35 98 64 54 90 88 -100 63 -60 -18 81 -20 8 34...
output:
1 44 58 7 28 1 60 11 68 -28 1 95 65 22 42 1 -74 -40 -54 -49 1 11 -49 5 -75 1 79 -17 43 -48 0 61 -34 0 -7 -20 1 67 -89 -30 5 0 20 88 1 88 -82 82 -24 1 -45 -53 -10 23 0 9 46 1 76 27 -20 29 1 22 97 9 62 1 98 64 39 85 1 -100 63 -33 77 0 -20 8 1 62 16 46 51 1 -46 66 -79 -27 1 62 -91 -11 -54 1 -55 -54 73 ...
result:
ok correct (100 test cases)
Test #6:
score: 0
Accepted
time: 850ms
memory: 3740kb
input:
100 -14 48 115 -133 160 80 40 30 181 139 114 -109 102 -111 -14 -51 175 113 40 -116 -44 -171 69 6 -128 18 -23 159 94 170 -150 71 199 -167 -181 82 173 50 -138 41 -27 -126 119 195 134 -129 16 169 -103 51 183 136 117 -196 54 25 61 27 166 12 -156 63 199 -8 -56 -143 138 31 -137 125 48 16 44 -83 37 150 -16...
output:
1 -133 160 -99 125 1 181 139 102 60 1 -111 -14 19 -72 1 40 -116 -18 67 0 6 -128 1 94 170 76 125 1 -167 -181 -167 -127 1 -138 41 40 146 1 195 134 53 -38 0 -103 51 1 -196 54 69 110 1 166 12 50 51 0 -8 -56 0 -137 125 1 -83 37 5 25 1 -71 -195 9 -183 1 -77 -188 -51 120 1 -88 135 -100 -179 0 170 90 1 -25 ...
result:
ok correct (100 test cases)
Test #7:
score: 0
Accepted
time: 892ms
memory: 3624kb
input:
100 30 194 241 273 -11 476 -181 37 -18 -139 -162 496 295 113 250 -413 467 26 -100 312 -322 -120 423 -86 222 464 231 266 -421 497 249 -467 327 -183 -486 -316 486 468 -295 -286 92 141 487 -146 -13 108 -300 14 318 17 229 -180 49 -247 -464 -385 326 56 -493 62 -365 349 114 -258 293 44 -443 26 -139 -313 6...
output:
1 273 -11 217 42 1 -18 -139 439 -181 1 113 250 60 302 1 -100 312 -389 457 0 -86 222 1 -421 497 208 303 1 -183 -486 -77 -486 1 -295 -286 -316 18 0 -146 -13 1 318 17 115 -288 1 -247 -464 187 -205 1 -493 62 -408 275 1 -258 293 -264 297 1 -139 -313 23 -428 1 -458 -334 55 71 1 210 -353 304 215 0 -118 -26...
result:
ok correct (100 test cases)
Test #8:
score: 0
Accepted
time: 836ms
memory: 3632kb
input:
100 411 -186 278 885 -994 -930 792 129 -912 -596 879 -250 54 312 -682 -712 -577 304 -473 409 109 -353 664 -141 -316 117 691 571 -217 166 -596 974 792 -326 630 -15 497 654 -575 -991 -714 -567 262 847 -440 182 29 60 -584 -920 -68 -858 810 -351 -901 -429 -633 975 -244 814 881 -213 818 -870 425 173 639 ...
output:
1 885 -994 546 -429 1 -912 -596 -930 663 1 312 -682 838 -285 1 -473 409 -643 -281 0 -141 -316 1 -217 166 -189 209 0 -326 630 1 -575 -991 -248 -114 1 847 -440 -453 -545 1 -584 -920 146 -19 0 -351 -901 1 -244 814 -305 334 1 -870 425 111 63 0 -124 917 1 -109 987 80 -268 1 -421 899 421 376 1 153 -591 68...
result:
ok correct (100 test cases)
Test #9:
score: 0
Accepted
time: 1022ms
memory: 3592kb
input:
100 190 562 152 560 564 -732 968 55 -887 965 -370 982 376 324 982 -263 -163 232 381 -165 -95 -654 238 258 -652 379 -43 668 -521 -36 884 782 580 267 786 -7 907 494 -802 908 970 -214 135 356 -209 410 40 139 173 42 -908 -832 24 -539 -835 806 -288 25 680 -296 -906 166 22 -873 165 -628 459 200 -122 454 -...
output:
1 560 564 342 562 1 -887 965 -787 968 1 324 982 6 982 1 381 -165 -31 -163 1 258 -652 143 -654 1 -521 -36 -289 -43 1 267 786 304 782 1 -802 908 -501 907 1 356 -209 835 -214 1 173 42 271 40 1 -539 -835 -884 -832 1 680 -296 781 -288 1 -873 165 -884 166 1 -122 454 -428 459 1 -717 -627 -764 -634 1 373 28...
result:
ok correct (100 test cases)
Test #10:
score: 0
Accepted
time: 1037ms
memory: 3660kb
input:
100 885 -747 696 892 13 536 -416 299 532 74 639 295 250 636 20 532 406 91 524 208 -148 -392 337 -141 41 371 411 327 366 800 761 -461 50 758 -532 -712 -644 527 -720 -94 -724 -693 385 -731 -201 967 153 254 958 -328 -615 -291 390 -612 -950 -260 915 41 -258 136 -971 779 24 -974 -172 118 -106 509 109 -80...
output:
1 892 13 885 -51 1 532 74 536 -117 1 636 20 639 45 1 524 208 532 315 1 -141 41 -148 -55 1 366 800 371 738 1 758 -532 761 -511 1 -720 -94 -720 -118 1 -731 -201 -724 -308 1 958 -328 967 -101 1 -612 -950 -615 -681 1 -258 136 -260 874 1 -974 -172 -971 755 1 109 -805 118 -615 1 844 819 851 859 1 -230 629...
result:
ok correct (100 test cases)
Test #11:
score: 0
Accepted
time: 999ms
memory: 3660kb
input:
100 -870 761 1681 -508 -1766 1437 -353 988 -96 558 -823 1649 579 285 -1783 1482 -257 84 -1412 894 1076 -1999 662 -1646 -548 -1596 779 108 1010 -1803 -1139 1322 1656 1833 -1498 -1950 -1093 1605 1813 1793 212 -107 1488 -1888 -1678 -1489 434 1415 -317 -1851 108 -1460 1947 457 1813 1762 -1366 1524 135 6...
output:
1 -508 -1766 -632 -903 1 -96 558 585 147 1 285 -1783 -655 1095 1 -1412 894 1404 -226 1 -1646 -548 489 -1693 1 1010 -1803 -1513 710 1 1833 -1498 64 184 1 1813 1793 -679 -113 1 -1888 -1678 -981 -996 1 -317 -1851 -851 -829 1 457 1813 305 477 1 135 600 794 -189 1 906 15 -1171 -210 1 795 1521 481 -196 1 ...
result:
ok correct (100 test cases)
Test #12:
score: 0
Accepted
time: 1092ms
memory: 3668kb
input:
100 519 -610 764 1776 -610 -161 1052 223 -1545 1052 -423 1331 808 -1876 1326 167 1457 91 -31 1449 -1442 -1344 720 355 -1341 1703 1535 583 498 1544 245 519 1257 -1498 518 -242 147 1251 -1860 147 1702 1916 1069 35 1918 -849 1473 346 -1818 1472 1189 -647 170 1472 -656 -42 -87 182 240 -96 991 -1971 378 ...
output:
1 1776 -610 1283 -610 1 -1545 1052 -384 1052 1 -1876 1326 -1231 1331 1 -31 1449 76 1457 1 355 -1341 -722 -1344 1 498 1544 1120 1535 1 -1498 518 -1012 519 1 -1860 147 -1493 147 1 35 1918 633 1916 1 -1818 1472 -1195 1473 1 1472 -656 1359 -647 1 240 -96 140 -87 1 168 -1972 613 -1971 1 -711 -1275 -50 -1...
result:
ok correct (100 test cases)
Test #13:
score: 0
Accepted
time: 1080ms
memory: 3588kb
input:
100 1478 -111 204 1471 1077 -1137 303 132 -1135 145 1170 653 557 1174 -800 1508 -1843 129 1508 -597 1100 -19 804 1103 -864 -899 123 535 -906 738 -1027 -65 278 -1026 872 222 359 990 219 1424 -1996 -239 79 -1992 1034 1892 -887 978 1894 855 -599 -682 45 -601 -1452 -1198 969 128 -1198 1478 -1620 -955 14...
output:
1 1471 1077 1478 93 1 -1135 145 -1137 171 1 1174 -800 1170 96 1 1508 -597 1508 -1714 1 1103 -864 1100 -823 1 -906 738 -899 658 1 -1026 872 -1027 213 1 219 1424 222 1349 1 -1992 1034 -1996 -160 1 1894 855 1892 91 1 -601 -1452 -599 -727 1 -1198 1478 -1198 1097 1 -1619 -1718 -1620 -1102 1 965 268 960 -...
result:
ok correct (100 test cases)
Test #14:
score: 0
Accepted
time: 1038ms
memory: 3616kb
input:
100 -3385 -1108 801 286 -1717 347 4287 3702 -2012 -239 -2842 1631 1554 -4783 2262 4930 1666 3142 3983 -2482 -4404 -1160 3440 -1249 4708 -632 -557 1489 930 -4322 -549 -2060 1450 -2537 2605 -1824 4416 4330 -3635 -3640 2979 -3339 1423 -2598 -1648 -4079 1254 2795 1612 2342 3409 -2881 4605 2283 800 -533 ...
output:
1 286 -1717 -2594 -1234 1 -2012 -239 -1356 1000 1 -4783 2262 -4320 2111 1 3983 -2482 4230 -1397 1 -1249 4708 -2781 1873 1 930 -4322 -68 -1935 1 -2537 2605 -1110 -723 1 -3635 -3640 -2785 194 1 -2598 -1648 1617 -2927 1 1612 2342 -1333 1775 0 2283 800 1 -1768 -2568 -1527 -3049 1 1332 -4940 -4795 4640 1...
result:
ok correct (100 test cases)
Test #15:
score: 0
Accepted
time: 1191ms
memory: 3632kb
input:
100 4838 -3288 1574 2001 -3280 4302 -3171 20 4434 -3179 1645 -2971 11 1689 -2974 231 -2343 2645 3771 -2337 -3038 3521 1147 -935 3516 -1139 2837 852 -3546 2842 173 2057 166 354 2064 -2660 -645 1843 -4543 -640 -3695 -4513 629 -2291 -4510 -2258 -4067 1240 -856 -4065 316 884 355 -2716 884 -3417 2961 518...
output:
1 2001 -3280 3264 -3288 1 4434 -3179 4322 -3171 1 1689 -2974 1656 -2971 1 3771 -2337 2876 -2343 1 -935 3516 -1891 3521 1 -3546 2842 -1991 2837 1 354 2064 338 2064 1 -4543 -640 -4503 -645 1 -2291 -4510 -3066 -4513 1 -856 -4065 -1018 -4067 1 -2716 884 -39 884 1 -657 2970 -2899 2961 1 681 4364 343 4367...
result:
ok correct (100 test cases)
Test #16:
score: 0
Accepted
time: 1202ms
memory: 3648kb
input:
100 -4633 -2041 1986 -4631 2439 -4880 4624 28 -4872 4697 -1457 -2643 1737 -1456 -4917 1015 -1805 2204 1011 -4481 -3984 4419 352 -3978 4015 4254 -1414 2569 4263 -4810 -1031 1275 464 -1030 2952 4119 -1206 4596 4125 3748 -4511 -3516 1360 -4520 -435 -927 -276 2080 -933 -4996 1842 3457 31 1834 2536 -804 ...
output:
1 -4631 2439 -4633 -55 1 -4872 4697 -4880 4652 1 -1456 -4917 -1457 -4380 1 1011 -4481 1015 -4009 1 -3978 4015 -3984 4067 1 4263 -4810 4254 -3983 1 -1030 2952 -1031 1739 1 4125 3748 4119 3390 1 -4520 -435 -4511 -2156 1 -933 -4996 -927 -2356 1 1834 2536 1842 3426 1 -807 -580 -804 -97 1 -2204 3891 -220...
result:
ok correct (100 test cases)
Test #17:
score: 0
Accepted
time: 1124ms
memory: 3600kb
input:
100 723 6148 6508 -4871 -7883 -6934 -2184 5218 -9448 -7089 7488 -6851 4397 5228 -4063 5219 602 6560 7100 -7395 7897 8717 8573 9453 -8398 -3861 -4510 7092 4342 -7411 232 5977 1965 -2860 6405 -4347 -1385 8693 -6598 1817 -5110 -7662 9020 1753 6101 -5427 -8770 1024 7195 -3393 9548 -6485 8149 9903 3494 4...
output:
1 -4871 -7883 -1680 100 1 -9448 -7089 -9317 -6826 0 5228 -4063 1 7100 -7395 6724 -5783 1 9453 -8398 8670 179 1 4342 -7411 2825 -6875 1 -2860 6405 -1715 6242 0 -6598 1817 1 1753 6101 -1091 413 1 7195 -3393 -4484 -8371 1 9903 3494 9833 1659 1 -3355 184 -805 -1086 1 4063 -4038 -1676 -1645 1 2098 -2410 ...
result:
ok correct (100 test cases)
Test #18:
score: 0
Accepted
time: 1277ms
memory: 3720kb
input:
100 -1464 6628 3138 7408 6628 -6975 -5584 1302 -2437 -5581 -5897 2476 7284 3064 2472 1418 -975 3900 -5406 -981 -8549 7283 4300 -713 7279 -3070 9286 340 -2641 9280 -7201 4879 7052 1670 4886 -2856 3073 1146 -1710 3077 -4047 -3956 1391 -7516 -3955 -3902 -8899 72 -9218 -8899 -5006 2417 730 -6214 2416 71...
output:
1 7408 6628 1674 6628 1 -2437 -5581 -5673 -5584 1 3064 2472 1387 2476 1 -5406 -981 -2482 -975 1 -713 7279 -4249 7283 1 -2641 9280 -2730 9286 1 1670 4886 -149 4879 1 -1710 3077 -1711 3077 1 -7516 -3955 -5438 -3956 1 -9218 -8899 -3974 -8899 1 -6214 2416 -5736 2417 1 4101 8236 4558 8239 1 -2570 -7877 -...
result:
ok correct (100 test cases)
Test #19:
score: 0
Accepted
time: 1254ms
memory: 3656kb
input:
100 6753 7040 4532 6747 406 -5593 2983 6738 -5593 9927 -2963 -7689 1613 -2964 -5733 3073 5939 835 3072 7930 2791 -7545 394 2786 -6790 -8166 -4175 228 -8162 -2159 1503 5075 4028 1503 -2322 1778 6302 1746 1777 9559 -5140 2221 6576 -5143 -5415 9776 5564 5507 9776 -3820 7901 2938 94 7894 3488 134 -5331 ...
output:
1 6747 406 6753 2508 1 -5593 9927 -5593 9721 1 -2964 -5733 -2963 -6076 1 3072 7930 3073 6774 1 2786 -6790 2791 -7151 1 -8162 -2159 -8166 -3947 1 1503 -2322 1503 1047 1 1777 9559 1778 8048 1 -5143 -5415 -5140 -4355 1 9776 -3820 9776 57 1 7894 3488 7901 3032 1 129 -7372 134 -6979 1 -8814 -838 -8806 -5...
result:
ok correct (100 test cases)
Test #20:
score: 0
Accepted
time: 1118ms
memory: 3588kb
input:
100 56670 48188 56530 48597 30102 97368 93467 86660 62493 -82399 2358 -63596 96946 -26808 86426 39505 -66536 33793 5371 24961 -1027 59260 20263 8092 59406 32283 -77000 57934 -56616 27645 84702 -53430 49798 45528 9260 -14350 45366 79842 2785 -27688 6787 1067 21224 -3085 91654 24663 -69143 61834 21592...
output:
0 48597 30102 1 62493 -82399 80553 8454 1 -26808 86426 -16134 31570 1 5371 24961 27692 -34875 0 8092 59406 1 -56616 27645 -5211 -32835 1 45528 9260 58313 -11199 0 2785 -27688 1 -3085 91654 4487 22166 1 21592 11857 22331 -7353 1 -56485 82202 -61368 11288 1 66380 41626 -10083 -29890 1 -95534 51848 -13...
result:
ok correct (100 test cases)
Test #21:
score: 0
Accepted
time: 1396ms
memory: 3696kb
input:
100 -44377 -55029 13586 -67223 -55033 -33997 -24950 30794 9713 -24946 8197 73356 21732 -30744 73362 9073 -25351 48586 -85428 -25350 -28077 79453 3909 -42162 79458 -28760 19465 39812 54224 19471 -85361 -7469 368 -85771 -7476 58908 -68690 3991 5077 -68683 90754 -16394 60407 -1699 -16400 -58871 -72036 ...
output:
1 -67223 -55033 -57963 -55029 1 9713 -24946 -3203 -24950 1 -30744 73362 -13535 73356 1 -85428 -25350 -39513 -25351 1 -42162 79458 -31986 79453 1 54224 19471 11052 19465 1 -85771 -7476 -85729 -7469 1 5077 -68683 54917 -68690 1 -1699 -16400 30347 -16394 1 -20641 -72040 -45440 -72036 1 -81970 -54557 -5...
result:
ok correct (100 test cases)
Test #22:
score: 0
Accepted
time: 1354ms
memory: 3596kb
input:
100 33810 8236 28198 33817 -28145 -92904 12677 20040 -92909 60406 -81055 -37793 34336 -81046 45370 74667 68808 72092 74668 -17542 65171 -32063 3808 65170 -56120 65947 72167 36799 65947 29139 -84756 -41098 2200 -84761 -23992 -4338 -54756 1007 -4339 -26129 9235 33437 15756 9243 -22720 62068 11930 1010...
output:
1 33817 -28145 33810 -19962 1 -92909 60406 -92904 32717 1 -81046 45370 -81055 -3457 1 74668 -17542 74667 -3284 1 65170 -56120 65171 -35871 1 65947 29139 65947 35368 1 -84761 -23992 -84756 -38898 1 -4339 -26129 -4338 -53749 1 9243 -22720 9235 17681 1 62077 -61658 62068 1830 1 -28388 7782 -28379 -3203...
result:
ok correct (100 test cases)
Test #23:
score: 0
Accepted
time: 1025ms
memory: 3532kb
input:
100 -203063 169405 129022 -752433 498432 -265295 -911813 35666 71321 347805 494256 -888227 674372 -974790 -545464 -402167 -674496 166743 416616 868022 597988 -22221 797327 278180 -42321 416459 849014 31691 -819541 -73286 -220546 497505 918564 327460 598158 -688271 809843 68234 79629 -391547 -789683 ...
output:
1 -752433 498432 -313728 235737 1 71321 347805 -256080 -877358 1 -974790 -545464 -162476 -734993 1 416616 868022 -324002 -527209 0 278180 -42321 1 -819541 -73286 391040 830088 0 327460 598158 1 79629 -391547 -651504 752362 1 -385218 486349 -511209 237675 1 659038 996249 726743 762989 1 952569 911972...
result:
ok correct (100 test cases)
Test #24:
score: 0
Accepted
time: 1547ms
memory: 3632kb
input:
100 -644072 -24384 4752 -637435 -24385 607000 345261 95533 260595 345270 -897943 561967 714003 -4334 561970 -466253 -408727 908099 494808 -408727 -27079 -662867 587002 -616830 -662874 195027 733868 446971 -566813 733860 80082 -709708 335322 -618253 -709702 -829078 -840348 15094 -849099 -840341 -5585...
output:
1 -637435 -24385 -639320 -24384 1 260595 345270 511467 345261 1 -4334 561970 -183940 561967 1 494808 -408727 441846 -408727 1 -616830 -662874 -614081 -662867 1 -566813 733860 -251944 733868 1 -618253 -709702 -255240 -709708 1 -849099 -840341 -844172 -840348 1 -353021 -69370 -440252 -69363 1 -596877 ...
result:
ok correct (100 test cases)
Test #25:
score: 0
Accepted
time: 1369ms
memory: 3708kb
input:
100 438033 295950 318337 438033 640672 792924 379013 57967 792917 145409 909123 -137408 758089 909130 784346 897692 738117 150546 897689 914580 908292 818997 654472 908298 -77878 184092 -134568 307831 184101 524904 239583 117791 693235 239583 -696239 486233 -84668 533956 486242 798452 -842645 838224...
output:
1 438033 640672 438033 614287 1 792917 145409 792924 321046 1 909130 784346 909123 620681 1 897689 914580 897692 888663 1 908298 -77878 908292 164525 1 184101 524904 184092 173263 1 239583 -696239 239583 -575444 1 486242 798452 486233 449288 1 -842636 928349 -842645 838239 1 449278 -742578 449283 -7...
result:
ok correct (100 test cases)
Test #26:
score: 0
Accepted
time: 1088ms
memory: 3708kb
input:
100 4252441 3375679 3645529 4952027 -491567 3720247 3567501 8355418 -5239263 1723847 -5106478 -571240 4893171 -245796 3245104 -1578115 -4971232 8626645 4137068 -8732419 5173508 -4415838 7017915 -5642751 9289162 3218853 -8550539 4005860 -958380 -5312559 5853915 -1590504 7976449 -3576815 -8617277 -408...
output:
1 4952027 -491567 4901371 -211628 1 -5239263 1723847 -4463692 1883413 1 -245796 3245104 -1257795 2450475 0 4137068 -8732419 1 -5642751 9289162 825806 1093120 1 -958380 -5312559 52794 -6096362 1 -3576815 -8617277 -542291 -6356245 1 8228210 -1984704 -2633735 7517847 1 -5145193 -9849061 6816065 3532154...
result:
ok correct (100 test cases)
Test #27:
score: 0
Accepted
time: 1684ms
memory: 3652kb
input:
100 -2014841 -5360006 2673539 1026489 -5360004 9665024 -4579642 4232473 3626267 -4579646 -776815 8712146 5446148 7991382 8712150 -3987202 -8252937 840249 -6592975 -8252934 -3597938 386915 3468815 1828448 386910 -7602782 -9622222 1314079 -2811003 -9622220 2174662 -9093244 377225 8154492 -9093244 6833...
output:
1 1026489 -5360004 658698 -5360006 1 3626267 -4579646 5432551 -4579642 1 7991382 8712150 4669333 8712146 1 -6592975 -8252934 -4827451 -8252937 1 1828448 386910 -129123 386915 1 -2811003 -9622220 -6288703 -9622222 1 8154492 -9093244 2551887 -9093244 1 7423376 -1840224 6861176 -1840224 1 -3027446 -446...
result:
ok correct (100 test cases)
Test #28:
score: 0
Accepted
time: 1373ms
memory: 3628kb
input:
100 -673100 -2313177 7988158 -673091 6590661 -4387247 7366789 470125 -4387246 1761549 -59075 8935980 2320478 -59083 2022766 -8474540 7209125 1974565 -8474543 1631905 9671655 6031542 865587 9671653 4994690 2267008 442320 702625 2266999 -1054159 -4280601 2270841 191502 -4280598 984766 1256674 3119811 ...
output:
1 -673091 6590661 -673100 5674981 1 -4387246 1761549 -4387247 6896664 1 -59083 2022766 -59075 6615502 1 -8474543 1631905 -8474540 5234560 1 9671653 4994690 9671655 5165955 1 2266999 -1054159 2267008 -260305 1 -4280598 984766 -4280601 2079339 1 1256674 5958067 1256674 3709180 1 -7217091 -1242538 -721...
result:
ok correct (100 test cases)
Test #29:
score: 0
Accepted
time: 1160ms
memory: 3740kb
input:
100 -37875637 16507803 78489254 51169277 30929393 71232386 -7606781 7846115 -37401012 5292720 45988374 45874993 68540891 -31108475 43543949 54439641 10066082 17949419 89309558 -98688182 -80966528 3387509 3107459 -44583923 -31843502 -37528743 19324451 9703359 -84487324 -61351261 -64457055 70983582 96...
output:
1 51169277 30929393 39604046 29056178 1 -37401012 5292720 63440993 -6681732 1 -31108475 43543949 -22521207 43803508 1 89309558 -98688182 59919826 -7026291 1 -44583923 -31843502 -78734129 1225867 1 -84487324 -61351261 -42409918 10938194 0 -15319873 39153760 0 58723792 -16237868 1 80723273 -49082963 -...
result:
ok correct (100 test cases)
Test #30:
score: 0
Accepted
time: 1734ms
memory: 3668kb
input:
100 -11273876 -18137803 38179312 77438623 -18137795 -54387247 6201488 4751952 -45068876 6201488 -96517128 -70777926 6383591 -88272039 -70777927 -69269581 48705942 39946692 -292990 48705945 -79898514 46847173 66819895 -11363857 46847182 -32089356 39085007 1988079 -38575935 39085010 -8664978 72581325 ...
output:
1 77438623 -18137795 26905436 -18137803 1 -45068876 6201488 -49635295 6201488 1 -88272039 -70777927 -90133537 -70777926 1 -292990 48705945 -29322889 48705942 1 -11363857 46847182 -13078619 46847173 1 -38575935 39085010 -34077435 39085007 1 -96143804 72581318 -74553694 72581325 1 76654465 18635712 55...
result:
ok correct (100 test cases)
Test #31:
score: 0
Accepted
time: 1374ms
memory: 3668kb
input:
100 -25463200 73825390 32366470 -25463194 7482750 89700586 -3773844 29178450 89700585 -34421040 8067573 -50206168 3517075 8067573 -20230686 62787884 59562853 15923736 62787884 19530801 -94315694 19014533 8348593 -94315701 87488247 89049136 71101547 803758 89049141 83501636 95143582 26843993 6024284 ...
output:
1 -25463194 7482750 -25463200 41458920 1 89700585 -34421040 89700586 -32952294 1 8067573 -20230686 8067573 -46689093 1 62787884 19530801 62787884 43639117 1 -94315701 87488247 -94315694 27363126 1 89049141 83501636 89049136 71905305 1 95143582 13177113 95143582 20819709 1 70069069 -67551551 70069069...
result:
ok correct (100 test cases)
Test #32:
score: 0
Accepted
time: 1170ms
memory: 3596kb
input:
100 340206418 -391488848 20231756 691240976 540249318 835331426 -230541671 258093502 947549667 228361626 -384182540 -391480194 330860998 410295726 -244291658 666631909 101044685 461780044 -849519287 -157108917 281830708 889298178 251309217 92507539 681048725 -974526573 601395851 134621657 -80075275 ...
output:
1 691240976 540249318 347339501 -372556255 1 947549667 228361626 896638197 20164802 1 410295726 -244291658 -58857418 -331209430 1 -849519287 -157108917 211403481 23534122 1 92507539 681048725 112778827 703347152 1 -80075275 916698699 -847562429 646151819 1 -959572469 -360939736 -365935239 -562641255...
result:
ok correct (100 test cases)
Test #33:
score: 0
Accepted
time: 1786ms
memory: 3692kb
input:
100 -34666576 943299211 245585334 283694240 943299211 189717342 -330960134 234931766 906729835 -330960139 656638680 115645217 80014499 786614162 115645217 195236590 505877212 138825673 -144795462 505877205 318550308 897022395 51959723 387024022 897022387 -962003324 -308168041 196701019 -49603235 -30...
output:
1 283694240 943299211 210918758 943299211 1 906729835 -330960139 424649108 -330960134 1 786614162 115645217 736653179 115645217 1 -144795462 505877205 56410917 505877212 1 387024022 897022387 370510031 897022395 1 -49603235 -308168040 -765302305 -308168041 1 -246791 903190220 41243614 903190223 1 -5...
result:
ok correct (100 test cases)
Test #34:
score: 0
Accepted
time: 1372ms
memory: 3636kb
input:
100 454182963 -813247132 11831082 454182962 -799717792 328430403 247617849 17566241 328430408 -436593779 -935354622 458252350 206882998 -935354622 192330718 -626384557 -227394794 590635974 -626384561 -853115270 419760710 -933479007 483871175 419760712 62206657 -168360387 407696264 47125564 -16836038...
output:
1 454182962 -799717792 454182963 -801416050 1 328430408 -436593779 328430403 230051608 1 -935354622 192330718 -935354622 251369352 1 -626384561 -853115270 -626384557 -818030768 1 419760712 62206657 419760710 -449607832 1 -168360385 301400567 -168360387 360570700 1 871212488 18421182 871212487 179027...
result:
ok correct (100 test cases)
Test #35:
score: -100
Time Limit Exceeded
input:
20 -704709746 -120363982 925437000 792310487 963679703 120363982 -704709746 925437000 -963679703 792310487 704709746 120363982 925437000 -792310487 -963679703 -120363982 704709746 925437000 963679703 -792310487 -183548566 -92421705 314705253 468299161 -907194595 92421705 -183548566 314705253 9071945...