QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#189859 | #6412. Classical Geometry Problem | KKT89 | AC ✓ | 20ms | 4120kb | C++17 | 6.0kb | 2023-09-28 00:50:35 | 2023-09-28 00:50:35 |
Judging History
answer
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
return (ull)rng() % B;
}
inline double time() {
return static_cast<long double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9;
}
// 3D points
// AOJ 1331
struct _3Dpoint{
double x,y,z;
_3Dpoint(){}
_3Dpoint(double x,double y,double z): x(x), y(y), z(z) {}
_3Dpoint& operator-=(const _3Dpoint &p){
x -= p.x; y -= p.y; z -= p.z;
return *this;
}
_3Dpoint& operator+=(const _3Dpoint &p){
x += p.x; y += p.y; z += p.z;
return *this;
}
_3Dpoint& operator*=(double d){
x *= d; y *= d; z *= d;
return *this;
}
_3Dpoint& operator/=(double d){
x /= d; y /= d; z /= d;
return *this;
}
const _3Dpoint operator+ (const _3Dpoint& p) const;
const _3Dpoint operator- (const _3Dpoint& p) const;
const _3Dpoint operator* (double d) const;
const _3Dpoint operator/ (double d) const;
};
const _3Dpoint _3Dpoint::operator+ (const _3Dpoint& p) const{
_3Dpoint res(*this); return res += p;
}
const _3Dpoint _3Dpoint::operator- (const _3Dpoint& p) const{
_3Dpoint res(*this); return res -= p;
}
const _3Dpoint _3Dpoint::operator* (double d) const{
_3Dpoint res(*this); return res *= d;
}
const _3Dpoint _3Dpoint::operator/ (double d) const{
_3Dpoint res(*this); return res /= d;
}
struct _3Dline{
_3Dpoint A,B;
_3Dline(_3Dpoint A,_3Dpoint B):A(A),B(B){}
};
// A to B
_3Dpoint vec(_3Dline L){
return L.B-L.A;
}
double abs(_3Dpoint P){
return sqrt(P.x*P.x+P.y*P.y+P.z*P.z);
}
double dist(_3Dpoint A,_3Dpoint B){
return abs(A-B);
}
_3Dpoint go(_3Dpoint s, _3Dpoint g, double d) {
_3Dpoint v = vec(_3Dline(s, g));
double sz = abs(v);
assert(abs(sz) > 1e-8);
_3Dpoint res = s + v * min(d, sz) / sz;
return res;
}
// (s,g)を結ぶ直線と(?,?,z)の交点
_3Dpoint cross_point(_3Dpoint s, _3Dpoint g, double z) {
auto t = g-s;
assert(abs(t.z) > 1e-8);
double u = (z-s.z)/(t.z);
s += t*u;
s.z = z;
return s;
}
void slv(int x, int y, int z) {
_3Dpoint goal = _3Dpoint(x,y,z);
_3Dpoint xy, ve;
auto chk = [&](_3Dpoint p)->bool{
if (0 <= p.x and p.x <= 255 and 0 <= p.y and p.y <= 255) return true;
return false;
};
auto find = [&]() -> void {
// xy平面上から(?,?,255)を使う場合
if (goal.z != 255) {
for (int i = 0; i < 4; ++i) {
double xx = 0;
double yy = 0;
if (1LL<<0&i) xx = 255;
if (1LL<<1&i) yy = 255;
_3Dpoint uu = _3Dpoint(xx,yy,255);
auto p = cross_point(goal, uu, 0);
if (chk(p)) {
xy = p; ve = uu;
return;
}
}
}
// z=255から(?,?,0)を使う場合
if (goal.z != 0) {
for (int i = 0; i < 4; ++i) {
double xx = 0;
double yy = 0;
if (1LL<<0&i) xx = 255;
if (1LL<<1&i) yy = 255;
_3Dpoint uu = _3Dpoint(xx,yy,0);
auto p = cross_point(goal, uu, 255);
if (chk(p)) {
xy = p; ve = uu;
return;
}
}
}
};
find();
vector<pair<_3Dpoint,double>> res;
_3Dpoint cur = _3Dpoint(0,0,0);
auto psh = [&](_3Dpoint p, double d) -> void {
res.push_back({p, d});
cur = go(cur, p, d);
assert(0 <= cur.x and cur.x <= 255);
assert(0 <= cur.y and cur.y <= 255);
assert(0 <= cur.z and cur.z <= 255);
};
if (xy.z == 255) {
psh(_3Dpoint(0,0,255), 5000);
}
{
if (xy.x == 255) {
psh(_3Dpoint(255, 0, xy.z), 5000);
psh(_3Dpoint(255, 255, xy.z), xy.y);
}
else if (xy.y + xy.x <= 255) {
double d = 255.0 / (255 - xy.x) * xy.y;
psh(_3Dpoint(0, 255, xy.z), d);
// 今(0,d,?)にいるハズ
auto p1 = (_3Dpoint(0, d, xy.z) - xy);
d = abs(p1);
psh(_3Dpoint(255, 0, xy.z), d);
}
else {
psh(_3Dpoint(255, 255, xy.z), 5000);
double d = 255.0 / xy.y * (255 - xy.x);
psh(_3Dpoint(0, 255, xy.z), d);
// 今(0,d,?)にいるハズ
auto p1 = (_3Dpoint(255 - d, 255, xy.z) - xy);
d = abs(p1);
psh(_3Dpoint(255, 0, xy.z), d);
}
}
{
double dd = abs(cur - goal);
psh(ve, dd);
}
assert(res.size() <= 10);
printf("%d\n", (int)res.size());
for (auto &p:res) {
assert(0 <= p.second and p.second <= 10000);
int rx = (int)p.first.x;
int ry = (int)p.first.y;
int rz = (int)p.first.z;
assert(rx == 0 or rx == 255);
assert(ry == 0 or ry == 255);
assert(rz == 0 or rz == 255);
printf("%d %d %d %.9f\n", (int)p.first.x, (int)p.first.y, (int)p.first.z, max(0.0, p.second));
}
const double eps = 1e-8;
assert(abs((double )x-cur.x) <= eps);
assert(abs((double )y-cur.y) <= eps);
assert(abs((double )z-cur.z) <= eps);
}
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int q; cin >> q;
while (q--) {
int x,y,z;
cin >> x >> y >> z;
// x = myRand(256), y = myRand(256), z = myRand(256);
slv(x, y, z);
}
// return 0;
// for (int i = 0; i < 256; ++i) {
// for (int j = 0; j < 256; ++j) {
// for (int k = 0; k < 256; ++k) {
// slv(i, j, k);
// }
// }
// }
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3840kb
input:
3 105 255 175 174 174 174 0 0 0
output:
5 0 0 255 5000.000000000 255 255 255 5000.000000000 0 255 255 102.000000000 255 0 255 0.000000000 0 255 0 93.295230318 4 0 0 255 5000.000000000 255 0 255 5000.000000000 255 255 255 255.000000000 0 0 0 140.296115413 3 0 255 0 0.000000000 255 0 0 0.000000000 0 0 255 0.000000000
result:
ok ok (3 test cases)
Test #2:
score: 0
Accepted
time: 20ms
memory: 3892kb
input:
10000 250 128 13 1 245 2 88 183 138 179 69 194 153 246 33 255 119 192 233 30 108 26 208 33 53 162 189 225 130 10 202 137 121 152 198 25 49 165 180 228 56 30 74 18 14 6 115 31 168 242 206 90 238 139 44 103 60 16 21 190 229 209 68 41 171 181 39 74 73 181 96 18 234 95 70 75 174 84 101 16 44 202 249 80 ...
output:
4 255 255 0 5000.000000000 0 255 0 9.960937500 255 0 0 120.215579322 255 0 255 14.708907978 3 0 255 0 247.916666667 255 0 0 1.405735399 0 0 255 2.784079292 4 255 255 0 5000.000000000 0 255 0 164.333333333 255 0 0 186.686276795 0 255 255 192.429998714 5 0 0 255 5000.000000000 255 255 255 5000.0000000...
result:
ok ok (10000 test cases)
Test #3:
score: 0
Accepted
time: 20ms
memory: 4120kb
input:
10000 90 173 87 39 251 59 39 43 150 106 29 130 52 55 180 236 225 70 171 15 48 92 133 240 182 226 10 126 139 105 196 7 204 32 131 193 27 96 218 67 29 33 159 9 251 130 111 243 226 69 39 198 131 80 108 169 147 45 36 170 76 138 251 55 235 186 224 165 48 51 133 173 225 14 226 234 70 139 178 92 174 138 24...
output:
4 255 255 0 5000.000000000 0 255 0 231.279069767 255 0 0 168.031709564 0 255 255 107.445061899 4 255 255 0 5000.000000000 0 255 0 208.515625000 255 0 0 6.722430575 0 255 255 60.168701339 3 0 255 0 166.136363636 255 0 0 113.042680159 0 0 255 171.398806940 4 255 255 0 5000.000000000 0 255 0 167.068965...
result:
ok ok (10000 test cases)
Test #4:
score: 0
Accepted
time: 18ms
memory: 4116kb
input:
10000 186 217 161 76 0 116 246 159 161 32 245 65 206 120 71 217 76 204 109 255 245 157 59 192 55 35 87 27 147 199 190 134 31 169 64 105 5 27 255 161 2 35 244 255 232 253 106 199 28 151 129 50 24 20 172 236 234 74 51 150 179 68 178 69 42 192 152 1 23 177 169 71 216 190 125 136 223 193 255 168 49 74 2...
output:
3 0 255 0 206.956521739 255 0 0 87.344248745 255 255 255 210.056622440 3 0 255 0 0.000000000 255 0 0 139.424460432 0 0 255 132.206891579 5 0 0 255 5000.000000000 255 255 255 5000.000000000 0 255 255 14.433962264 255 0 255 3.172772443 255 0 0 132.217423255 4 255 255 0 5000.000000000 0 255 0 223.83333...
result:
ok ok (10000 test cases)
Test #5:
score: 0
Accepted
time: 20ms
memory: 4020kb
input:
10000 26 6 234 114 6 172 198 19 173 214 204 1 104 186 218 199 182 82 47 240 186 223 240 143 184 99 164 184 155 37 185 4 114 49 253 17 239 214 37 0 231 38 73 245 212 121 102 155 86 234 219 157 173 216 236 46 65 103 67 130 27 253 105 83 105 197 81 93 254 47 206 225 207 110 24 38 119 248 76 243 180 10 ...
output:
4 0 0 255 5000.000000000 0 255 255 7.355769231 255 0 255 28.345118974 0 0 0 21.136092006 4 0 0 255 5000.000000000 0 255 255 26.379310345 255 0 255 169.913564137 0 0 0 99.617580024 3 0 255 0 85.000000000 255 0 0 81.949268632 255 0 255 214.469964229 4 255 255 0 5000.000000000 0 255 0 50.000000000 255 ...
result:
ok ok (10000 test cases)
Test #6:
score: 0
Accepted
time: 20ms
memory: 3896kb
input:
10000 122 50 52 152 12 229 149 135 184 140 164 193 2 251 109 180 33 217 241 225 126 33 165 94 57 163 242 85 164 132 179 131 197 185 186 185 216 145 74 95 203 40 158 236 193 245 97 111 144 61 52 9 67 157 44 113 152 132 82 110 130 182 33 96 168 202 10 184 228 173 243 124 198 29 180 196 15 47 153 63 54...
output:
3 0 255 0 157.407407407 255 0 0 180.097224339 0 0 255 62.005494172 4 0 0 255 5000.000000000 0 255 255 39.740259740 255 0 255 171.300725151 0 0 0 31.235916221 5 0 0 255 5000.000000000 255 255 255 5000.000000000 0 255 255 66.111111111 255 0 255 70.152713117 0 0 0 105.167686393 5 0 0 255 5000.000000000...
result:
ok ok (10000 test cases)
Test #7:
score: 0
Accepted
time: 12ms
memory: 4120kb
input:
10000 218 94 126 189 17 30 100 251 196 67 123 128 157 60 0 161 139 95 179 210 67 98 91 45 186 227 63 242 172 226 173 1 24 66 118 98 194 75 112 189 176 43 243 226 174 112 93 67 202 143 142 117 216 97 108 179 239 161 97 91 233 111 216 110 231 208 195 20 203 43 24 22 189 205 79 98 167 102 230 139 185 1...
output:
4 255 255 0 5000.000000000 0 255 0 100.372340426 255 0 0 74.352772172 255 0 255 160.037083318 3 0 255 0 120.416666667 255 0 0 236.881747925 0 0 255 39.245098774 5 0 0 255 5000.000000000 255 255 255 5000.000000000 0 255 255 127.500000000 255 0 255 5.818340146 0 255 0 66.246378572 4 255 255 0 5000.000...
result:
ok ok (10000 test cases)
Test #8:
score: 0
Accepted
time: 20ms
memory: 3952kb
input:
10000 58 139 199 227 23 87 52 111 207 249 83 64 55 125 147 142 246 229 118 194 7 164 16 252 59 36 140 143 180 64 167 127 108 202 51 10 172 6 150 28 149 45 72 217 154 236 88 23 4 226 232 225 109 37 172 245 69 190 112 71 81 40 143 124 38 213 124 112 178 169 61 176 180 125 234 1 63 157 51 215 59 75 216...
output:
4 0 0 255 5000.000000000 0 255 255 251.382978723 255 0 255 104.363851245 0 0 0 70.231213307 3 0 255 0 209.464285714 255 0 0 275.000362361 255 0 255 89.000646710 4 0 0 255 5000.000000000 0 255 255 182.612903226 255 0 255 78.789762537 0 0 0 55.784384020 4 255 255 0 5000.000000000 0 255 0 18.433734940 ...
result:
ok ok (10000 test cases)
Test #9:
score: 0
Accepted
time: 20ms
memory: 3888kb
input:
10000 154 183 17 8 28 144 3 227 218 175 43 0 209 191 38 123 96 107 56 179 204 230 197 204 188 100 217 43 189 158 161 254 191 83 240 178 150 193 187 123 122 48 157 207 135 103 84 235 62 53 66 77 2 234 237 56 156 219 127 51 184 225 70 138 102 218 53 203 153 39 98 75 171 45 134 159 215 212 128 35 190 1...
output:
4 255 255 0 5000.000000000 0 255 0 117.049180328 255 0 0 64.840070073 0 0 255 24.101083895 3 0 255 0 69.320388350 255 0 0 19.045352387 0 0 255 148.872990416 3 0 255 0 67.500000000 255 0 0 21.387776832 0 255 255 273.957134096 3 0 255 0 137.062500000 255 0 0 198.677512332 0 0 255 0.000000000 4 255 255...
result:
ok ok (10000 test cases)
Test #10:
score: 0
Accepted
time: 16ms
memory: 3892kb
input:
10000 250 227 91 46 34 201 210 87 230 102 2 191 107 0 185 104 203 241 250 164 144 40 123 155 61 164 38 200 197 253 155 124 18 219 173 90 127 124 225 217 94 50 242 198 116 227 79 191 120 136 155 184 151 174 45 122 243 248 142 31 31 154 253 152 165 224 238 39 128 165 134 229 162 220 33 61 111 11 205 1...
output:
4 255 255 0 5000.000000000 0 255 0 9.375000000 255 0 0 43.565998404 255 255 255 92.358446966 4 255 255 0 5000.000000000 0 255 0 60.000000000 255 0 0 97.023606648 0 0 255 292.804299874 5 0 0 255 5000.000000000 255 255 255 5000.000000000 0 255 255 58.620689655 255 0 255 162.678830904 0 0 0 35.14905474...
result:
ok ok (10000 test cases)
Test #11:
score: 0
Accepted
time: 20ms
memory: 3932kb
input:
10000 208 135 142 248 171 248 162 65 32 9 162 63 91 20 90 188 236 117 62 200 71 14 228 53 68 196 133 27 159 255 129 86 121 46 216 3 213 65 177 7 28 45 215 136 153 108 54 113 254 122 99 243 222 89 18 255 48 14 157 204 210 33 132 87 4 33 231 222 233 30 14 100 10 45 226 49 210 232 113 79 18 235 109 14 ...
output:
5 0 0 255 5000.000000000 255 255 255 5000.000000000 0 255 255 88.777777778 255 0 255 13.310451953 255 0 0 160.340199165 5 0 0 255 5000.000000000 255 255 255 5000.000000000 0 255 255 10.438596491 255 0 255 79.239695911 255 0 0 8.505012065 4 255 255 0 5000.000000000 0 255 0 239.307692308 255 0 0 247.7...
result:
ok ok (10000 test cases)
Test #12:
score: 0
Accepted
time: 20ms
memory: 3824kb
input:
10000 119 133 74 50 106 117 59 203 94 72 223 194 202 156 197 61 81 108 77 80 107 240 230 250 53 54 66 133 197 44 33 113 2 83 54 163 206 241 33 41 83 202 182 57 124 37 155 241 186 245 218 153 80 29 47 83 212 41 32 94 107 89 186 58 161 214 114 106 34 17 89 16 19 117 170 169 115 74 55 143 33 6 182 196 ...
output:
4 255 255 0 5000.000000000 0 255 0 118.872180451 255 0 0 74.611105031 0 0 255 103.921732000 4 255 255 0 5000.000000000 0 255 0 211.698113208 255 0 0 76.851670336 0 0 255 153.501014448 4 255 255 0 5000.000000000 0 255 0 238.623853211 255 0 0 112.796979274 0 255 255 104.615269516 5 0 0 255 5000.000000...
result:
ok ok (10000 test cases)
Test #13:
score: 0
Accepted
time: 20ms
memory: 3776kb
input:
10000 170 100 234 20 253 12 243 196 46 206 129 235 149 5 166 232 179 7 149 75 45 98 197 156 206 22 133 230 176 54 159 228 135 170 92 118 90 61 180 9 26 18 21 65 122 40 143 87 125 192 199 176 35 144 44 85 243 153 238 203 227 9 212 200 74 226 253 135 20 139 117 222 230 43 212 42 201 224 22 222 152 191...
output:
5 0 0 255 5000.000000000 255 255 255 5000.000000000 0 255 255 163.200000000 255 0 255 173.371244602 0 0 0 27.464471102 4 255 255 0 5000.000000000 0 255 0 235.954356846 255 0 0 2.859409679 0 255 255 12.040980677 4 255 255 0 5000.000000000 0 255 0 15.612244898 255 0 0 15.890943659 255 0 255 63.1183644...
result:
ok ok (10000 test cases)
Test #14:
score: 0
Accepted
time: 20ms
memory: 3964kb
input:
10000 67 216 241 14 40 250 28 215 219 200 241 181 3 167 13 227 218 113 85 72 151 116 20 162 202 252 17 54 184 231 49 90 219 117 173 19 37 53 223 10 195 119 118 128 187 46 208 215 54 85 104 71 99 34 234 95 0 44 223 10 14 248 47 123 70 75 245 118 231 131 187 137 34 62 21 4 118 233 40 183 96 242 97 190...
output:
5 0 0 255 5000.000000000 255 255 255 5000.000000000 0 255 255 205.416666667 255 0 255 33.967447032 0 0 0 19.198796614 4 0 0 255 5000.000000000 0 255 255 43.220338983 255 0 255 14.483661167 0 0 0 5.071331186 5 0 0 255 5000.000000000 255 255 255 5000.000000000 0 255 255 226.534883721 255 0 255 6.22997...
result:
ok ok (10000 test cases)
Test #15:
score: 0
Accepted
time: 12ms
memory: 3824kb
input:
10000 252 245 224 4 171 9 240 190 208 69 15 254 4 230 90 0 255 17 6 26 58 150 187 237 239 242 146 255 227 231 232 117 26 44 255 111 183 1 9 121 85 207 15 245 120 247 181 40 1 255 164 244 139 255 131 248 27 161 24 241 63 44 16 207 36 251 15 227 163 49 7 180 27 7 23 61 254 235 14 8 11 200 7 3 26 254 3...
output:
4 255 255 0 5000.000000000 0 255 0 36.428571429 255 0 0 83.093193181 255 255 255 236.362303250 3 0 255 0 180.185950413 255 0 0 5.077025238 0 0 255 10.961759554 5 0 0 255 5000.000000000 255 255 255 5000.000000000 0 255 255 20.131578947 255 0 255 22.135970181 255 0 0 63.747190194 4 0 0 255 5000.000000...
result:
ok ok (10000 test cases)
Test #16:
score: 0
Accepted
time: 18ms
memory: 3768kb
input:
10000 10 7 240 232 252 180 5 169 10 1 40 6 252 2 242 245 8 5 249 17 249 255 2 233 12 3 1 2 6 253 252 254 2 251 245 6 254 4 252 10 244 245 254 218 52 255 8 4 20 112 248 253 0 254 250 234 1 226 245 216 11 6 2 245 139 0 8 28 233 1 11 24 246 250 253 9 124 17 255 26 1 14 251 46 2 14 248 233 1 44 12 255 1...
output:
4 255 255 0 5000.000000000 0 255 0 182.142857143 255 0 0 167.130890903 0 0 255 309.425273693 4 255 255 0 5000.000000000 0 255 0 81.458333333 255 0 0 10.707788572 255 255 255 188.411464619 3 0 255 0 179.562500000 255 0 0 6.364850747 0 0 255 12.150040749 3 0 255 0 41.129032258 255 0 0 1.037331574 0 0 ...
result:
ok ok (10000 test cases)
Test #17:
score: 0
Accepted
time: 13ms
memory: 3824kb
input:
10000 0 3 254 9 1 2 250 254 0 4 1 65 212 3 253 253 255 254 252 1 255 255 230 11 253 215 255 113 12 16 252 253 0 255 254 254 254 255 252 0 32 254 255 36 252 10 1 243 3 46 11 99 3 255 250 0 248 11 5 3 253 254 255 23 2 1 0 253 4 255 255 248 255 237 250 7 13 1 251 251 246 0 0 4 0 2 1 254 254 0 189 3 0 2...
output:
4 0 0 255 5000.000000000 0 255 255 3.011811024 255 0 255 0.000000000 0 0 0 1.000069748 3 0 255 0 1.045081967 255 0 0 9.071222427 0 0 255 2.001280660 4 255 255 0 5000.000000000 0 255 0 5.019685039 255 0 0 1.000193732 0 0 255 0.000000000 3 0 255 0 1.370967742 255 0 0 5.368498639 0 0 255 65.015302908 4...
result:
ok ok (10000 test cases)
Test #18:
score: 0
Accepted
time: 16ms
memory: 3836kb
input:
10000 0 253 255 255 252 2 255 0 255 250 253 255 253 0 255 252 251 236 8 255 0 247 254 254 2 255 255 255 255 252 0 0 4 6 250 0 7 32 0 0 2 255 255 9 255 3 255 1 255 255 242 254 0 0 0 0 254 0 255 255 1 0 9 255 255 2 0 255 0 0 0 255 254 9 1 253 255 254 252 0 255 0 0 255 254 0 252 255 247 0 2 250 255 255...
output:
4 0 0 255 5000.000000000 0 255 255 253.000000000 255 0 255 0.000000000 0 0 0 0.000000000 3 255 0 0 5000.000000000 255 255 0 253.992094862 255 0 255 2.822842882 4 0 0 255 5000.000000000 255 0 255 5000.000000000 255 255 255 0.000000000 0 0 0 0.000000000 5 0 0 255 5000.000000000 255 255 255 5000.000000...
result:
ok ok (10000 test cases)
Test #19:
score: 0
Accepted
time: 15ms
memory: 4016kb
input:
10000 0 0 0 255 0 255 0 255 255 255 255 1 0 0 0 0 255 1 255 0 254 0 255 0 0 203 255 0 2 0 255 0 255 255 254 0 255 0 255 255 255 228 0 255 255 0 255 255 0 254 0 253 0 0 242 0 0 255 0 0 255 252 0 0 0 0 0 0 0 255 255 255 0 0 255 255 255 0 4 255 0 0 1 0 0 0 255 0 253 253 0 255 255 0 0 255 255 0 0 1 255 ...
output:
3 0 255 0 0.000000000 255 0 0 0.000000000 0 0 255 0.000000000 4 0 0 255 5000.000000000 255 0 255 5000.000000000 255 255 255 0.000000000 0 0 0 0.000000000 4 0 0 255 5000.000000000 0 255 255 255.000000000 255 0 255 0.000000000 0 0 0 0.000000000 3 255 0 0 5000.000000000 255 255 0 255.000000000 255 255 ...
result:
ok ok (10000 test cases)
Test #20:
score: 0
Accepted
time: 14ms
memory: 3956kb
input:
10000 0 0 0 0 255 255 255 0 255 255 255 0 255 255 255 255 0 0 255 255 255 0 0 255 0 0 0 0 0 255 255 255 0 0 0 255 255 0 0 0 0 0 255 255 0 0 0 255 0 0 0 255 255 0 0 0 255 0 255 0 255 0 255 0 255 255 0 255 0 0 255 0 1 0 255 255 0 254 255 0 255 255 255 255 0 255 255 255 0 255 255 0 255 0 255 255 255 25...
output:
3 0 255 0 0.000000000 255 0 0 0.000000000 0 0 255 0.000000000 4 0 0 255 5000.000000000 0 255 255 255.000000000 255 0 255 0.000000000 0 0 0 0.000000000 4 0 0 255 5000.000000000 255 0 255 5000.000000000 255 255 255 0.000000000 0 0 0 0.000000000 3 255 0 0 5000.000000000 255 255 0 255.000000000 0 0 255 ...
result:
ok ok (10000 test cases)