QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#808761#77. Dazzling StarsLaVuna47AC ✓88ms4044kbC++173.8kb2024-12-11 01:39:562024-12-11 01:39:57

Judging History

你现在查看的是最新测评结果

  • [2024-12-11 01:39:57]
  • 评测
  • 测评结果:AC
  • 用时:88ms
  • 内存:4044kb
  • [2024-12-11 01:39:56]
  • 提交

answer

/** gnu specific **/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
/** contains everything I need in std **/
#include <bits/stdc++.h>

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(S) ((int)S.size())
#define FOR(i, st_, n) for(int i = st_; i < n; ++i)
#define RFOR(i, n, end_) for(int i = (n)-1; i >= end_; --i)
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef unsigned long long ull;
typedef long double LD;
typedef pair<ull, ull> pull;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
using namespace std;
#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif

struct Point
{
	LD x,y;
	int b;
	int ind;
};

double distPointToLine(const Point& P, const Point& A, const Point& B) {
    // Calculate the direction vector of the line
    double dx = B.x - A.x;
    double dy = B.y - A.y;

    // Calculate the numerator using the determinant method
    double numerator = std::abs(dy * P.x - dx * P.y + B.x * A.y - B.y * A.x);

    // Calculate the denominator (length of the direction vector)
    double denominator = std::sqrt(dx * dx + dy * dy);

    // Handle cases where the denominator is effectively zero (degenerate line)
    if (denominator == 0.0) {
        return std::sqrt((P.x - A.x) * (P.x - A.x) + (P.y - A.y) * (P.y - A.y));
    }

    // Return the perpendicular distance
    return numerator / denominator;
}

void moveLine(Point& A, Point& B, double D) {
    // Calculate the direction vector
    LD vx = B.x - A.x;
    LD vy = B.y - A.y;

    // Calculate the magnitude of the direction vector
    LD magnitude = std::sqrt(vx * vx + vy * vy);

    // Calculate the normalized perpendicular vector
    LD tx = -vy / magnitude;
    LD ty = vx / magnitude;

    // Scale the perpendicular vector by distance D
    tx *= D;
    ty *= D;

    // Move the points
    A.x += tx;
    A.y += ty;
    B.x += tx;
    B.y += ty;
}

const LD EPS=1e-9;
int solve()
{
	int n;
	if(!(cin>>n))
		return 1;
	int ctr=0;
	vector<Point> po(n);
	for(auto&[x,y,b, ind]:po)cin>>x>>y>>b, ind=ctr++;
	if(n<=3)
	{
		cout<<"Y\n";
		return 0;
	}
	sort(all(po),[](const Point&p1, const Point& p2) -> bool{
		return p1.b < p2.b;
	});
	
	FOR(i,0,n-1)
	{
		auto l1=po[i];
		auto l2=po[i+1];
		moveLine(l1,l2,1e6);
		vector<LD> D(ctr,0);
		auto cur_po=po;

		for(auto&[x,y,b,ind]:cur_po)
		{
			D[ind]=distPointToLine(Point{x,y,b,ind},l1,l2);
			assert(D[ind]!=0);
		}
		sort(all(cur_po),[&](const Point& p1, const Point& p2){
			return D[p1.ind] < D[p2.ind];
		});
		
		FOR(rev,0,2)
		{
			if(rev) reverse(all(cur_po));
			bool ok=true;
			int br=1e8;
			for(int l=0, r=0; l < n;)
			{
				int max_val=-1;
				int min_val=1e8;
				while(r<n && abs(D[cur_po[r].ind]-D[cur_po[l].ind]) < EPS)
					min_val=min(min_val, cur_po[r].b), max_val=max(max_val, cur_po[r].b), ++r;
				
				if(max_val > br)
					{ok=false;break;}
				l=r;
				br=min_val;
			}
			if(ok)
			{
				cout<<"Y\n";
				return 0;
			}
		}
	}
	
	cout << "N\n";
    return 0;
}

int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int TET = 1e9;
    //cin >> TET;
    for (int i = 1; i <= TET; i++)
    {
        if (solve())
        {
            break;
        }
#ifdef ONPC
        cout << "__________________________" << endl;
#endif
    }
#ifdef ONPC
    cerr << endl << "finished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec" << endl;
#endif
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3724kb

input:

4
2 2 1
2 5 2
5 5 3
5 2 4

output:

Y

result:

ok single line: 'Y'

Test #2:

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

input:

1000
948 1040 5
8222 9897 5
227 -2641 5
7927 -779 5
8288 865 5
1626 -3327 5
3849 -6795 5
3468 7081 5
8003 -6418 5
4603 3061 5
7459 690 5
3780 -6692 5
1982 4037 5
9069 2764 5
248 -5372 5
7575 -3451 5
7273 2061 5
8378 2182 5
6238 406 5
1847 226 5
1704 1876 5
9124 7138 5
977 7813 5
1036 -5564 5
6767 -2...

output:

N

result:

ok single line: 'N'

Test #3:

score: 0
Accepted
time: 87ms
memory: 3920kb

input:

1000
9036 -6349 5
6133 5703 5
8367 1427 5
1537 9208 5
3228 -4348 5
8333 -8494 5
4478 -5274 5
6303 -4728 5
7738 5528 5
2640 4490 5
5299 -5419 5
1133 6527 5
372 -9371 5
6580 9569 5
7418 -2883 5
7573 4554 5
393 376 5
9460 9699 5
892 786 5
6536 -6410 5
1462 3072 5
5423 8491 5
9100 -6072 5
5269 9822 5
67...

output:

N

result:

ok single line: 'N'

Test #4:

score: 0
Accepted
time: 87ms
memory: 3928kb

input:

1000
9263 -7525 1
-5466 150 1
-8518 -4390 1
5702 -1323 1
8981 -1622 1
903 -7326 1
-844 -3052 1
4148 -5766 1
7979 -7727 1
5 -4715 1
2239 -884 1
-1344 -5032 1
-932 -1722 1
-6695 -5274 1
-278 -1415 1
-9078 -8502 1
-7945 -1334 1
5504 -1435 1
-9357 -8067 1
4386 -8413 1
1577 -9107 1
-6159 317 1
-5868 -514...

output:

N

result:

ok single line: 'N'

Test #5:

score: 0
Accepted
time: 87ms
memory: 3932kb

input:

1000
-971 -9339 1
-1956 -7584 1
7043 -2269 1
6492 -3865 1
-1480 -8110 1
-364 -8582 1
3586 -7905 1
-3961 -3949 1
-3568 -6167 1
-6335 -8104 1
-158 -3928 1
7886 -8912 1
-2571 -3072 1
8982 -3802 1
-7862 -7163 1
9088 -1655 1
2170 -1927 1
6843 -8537 1
-6884 -4769 1
-4606 -4289 1
-4458 -5559 1
-3028 -6900 ...

output:

N

result:

ok single line: 'N'

Test #6:

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

input:

1000
-2334 -538 1
-2211 -310 1
-4272 -2431 1
-1993 -2574 1
-620 -335 1
-6709 -5317 1
-9033 -8951 1
-8340 -6504 1
-2564 -4288 1
-2416 -9241 1
-5061 -4959 1
-3004 -1178 1
-2390 -2504 1
-852 -5459 1
-9465 -1856 1
-1640 -8885 1
-4302 -9766 1
-8651 -4712 1
87 -9246 1
-393 -477 1
-7778 -1788 1
-7017 -8538...

output:

N

result:

ok single line: 'N'

Test #7:

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

input:

1000
731 -9300 1
-3767 -6206 1
-6851 821 1
-2961 -5587 1
-7568 -8064 1
-1425 -3676 1
-4294 -9579 1
934 -7095 1
-7794 -8535 1
-6731 -923 1
-8911 -9323 1
-2960 -2239 1
-7014 -7463 1
-5756 -8529 1
-1797 -3816 1
-1951 -9757 1
-4968 -9757 1
-2442 -8465 1
-5161 -4958 1
-1030 -2386 1
-3469 256 1
-3336 -642...

output:

N

result:

ok single line: 'N'

Test #8:

score: 0
Accepted
time: 88ms
memory: 3812kb

input:

1000
1518 -4880 5
-373 2995 5
609 2542 5
531 -2584 5
-1438 2686 5
4447 -2167 5
-2036 3142 5
-347 -4356 5
640 4035 5
3644 -1407 5
2171 391 5
-3562 -2510 5
88 4088 5
2540 -4970 5
4778 -868 5
-3538 -2415 5
2780 -2634 5
2265 -177 5
-4458 1460 5
-689 2663 5
438 772 5
1125 -769 5
-2145 -2133 5
-3591 1827 ...

output:

N

result:

ok single line: 'N'

Test #9:

score: 0
Accepted
time: 87ms
memory: 4000kb

input:

1000
2136 9955 141
7046 -7009 417
7919 -4006 682
-8469 7209 468
-9927 -7095 462
5713 1169 975
-8181 -1752 83
6743 4766 992
-9882 7704 145
-5506 -8143 343
5766 -3022 563
4411 6761 559
775 -2033 752
-580 9394 926
-4240 9699 924
1171 8031 313
268 2198 239
6072 5218 358
-4695 6064 304
-5158 938 46
-7325...

output:

N

result:

ok single line: 'N'

Test #10:

score: 0
Accepted
time: 88ms
memory: 4008kb

input:

1000
1942 -3686 230
-6143 -6212 112
7753 -3753 891
-5482 -380 102
-4603 -8150 169
996 8522 144
-7001 4115 364
-3555 4073 480
-456 -235 281
-989 -6726 531
5694 1645 863
6120 6585 557
-5943 8253 111
-9189 2198 705
6341 -1170 700
6463 3995 701
-9648 496 548
-3740 -2495 604
6897 4819 611
-1282 -9648 803...

output:

N

result:

ok single line: 'N'

Test #11:

score: 0
Accepted
time: 87ms
memory: 3840kb

input:

1000
-7874 7742 265
-9073 5739 940
-9282 -7936 909
1294 -1058 462
-5293 3412 59
-6675 4016 651
-4277 -8585 498
8965 2616 390
-8023 -6847 78
8332 5827 560
8410 8187 242
7441 -6392 917
336 -8543 486
2821 -6930 90
-87 2442 432
7662 6777 455
4153 -8767 201
-780 5554 619
-6873 3747 877
-4851 3288 556
-46...

output:

N

result:

ok single line: 'N'

Test #12:

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

input:

4
1 -10000 1
-10000 0 100
0 10000 500
10000 0 1000

output:

N

result:

ok single line: 'N'

Test #13:

score: 0
Accepted
time: 18ms
memory: 3932kb

input:

468
-2534 -7230 867
-9872 56 899
-8384 1085 617
-9183 -2420 704
-960 4502 158
-5240 -7781 507
8477 1809 775
-2327 4922 102
-4177 3485 726
-1565 -8246 267
-5802 -4377 810
-6011 7728 880
-8905 -2424 492
-9531 -1506 907
-7759 1937 122
1574 7906 204
-9835 -8330 540
-9651 -8304 497
8419 -1598 399
2774 -8...

output:

N

result:

ok single line: 'N'

Test #14:

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

input:

86
-5352 2203 12
-5424 -2635 106
8870 379 364
-2712 -7797 603
3351 4933 863
7287 -2543 231
-8168 3881 644
-7783 4400 887
-9413 2552 779
4787 -4535 377
-8308 -5584 580
7892 -3176 665
8733 4274 215
-3360 8670 16
-147 -2703 177
1226 -3727 275
6520 4040 888
-9912 6115 473
62 8395 524
7983 5855 71
7363 -...

output:

N

result:

ok single line: 'N'

Test #15:

score: 0
Accepted
time: 59ms
memory: 3908kb

input:

825
-9765 -664 323
-8494 -8859 741
-9279 3189 59
-6668 -1064 723
4127 -1481 509
2637 -9025 416
-324 -9772 517
106 4094 127
6362 2895 343
-9397 6636 647
9898 9506 254
2437 -202 783
-1576 1169 54
8495 -8931 474
6243 -5646 284
3076 -8265 501
9732 -4610 728
207 -1647 495
9652 -7361 578
-2903 -7289 317
7...

output:

N

result:

ok single line: 'N'

Test #16:

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

input:

9
3 -6 1
2 2 3
-9 -3 1
7 -10 3
0 6 3
5 -6 2
-1 1 1
-3 -2 1
7 10 2

output:

N

result:

ok single line: 'N'

Test #17:

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

input:

9
-8 -6 2
0 8 2
5 -3 1
-8 -7 2
6 -6 1
-6 -2 3
-1 4 2
3 -2 2
4 4 1

output:

N

result:

ok single line: 'N'

Test #18:

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

input:

10
-6 -1 2
-4 -8 1
3 6 3
8 -8 2
7 0 2
-6 -5 1
4 4 3
10 -3 3
-2 -7 1
-6 -6 1

output:

Y

result:

ok single line: 'Y'

Test #19:

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

input:

10
10 -7 3
-5 -7 1
7 -1 1
0 -2 2
-4 -6 2
5 2 2
-1 -10 2
-1 -6 3
-4 4 3
3 6 1

output:

N

result:

ok single line: 'N'

Test #20:

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

input:

10
-9 8 3
7 7 3
1 -3 3
8 -10 1
7 -10 2
5 5 3
-3 -2 1
-1 8 3
-6 -3 1
-4 1 1

output:

N

result:

ok single line: 'N'

Test #21:

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

input:

5
-10 -8 1
-3 -9 3
-4 1 2
-3 6 3
3 -9 2

output:

N

result:

ok single line: 'N'

Test #22:

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

input:

9
-4 5 2
-1 7 3
-6 3 2
-10 10 1
9 -5 3
5 3 2
10 1 2
3 -9 2
-2 10 2

output:

N

result:

ok single line: 'N'

Test #23:

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

input:

4
-200 -100 5
-100 -100 9
-100 -200 5
-200 -200 9

output:

N

result:

ok single line: 'N'

Test #24:

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

input:

6
-9 9 3
9 -8 2
9 -9 2
3 -1 3
5 8 1
8 3 1

output:

Y

result:

ok single line: 'Y'

Test #25:

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

input:

8
-9 -1 3
-3 -10 1
8 -9 1
1 7 2
-8 -5 2
1 -4 2
2 -8 3
6 -4 3

output:

N

result:

ok single line: 'N'

Test #26:

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

input:

6
1 6 1
2 -10 1
-7 5 1
-7 2 1
1 -1 3
-2 -7 1

output:

N

result:

ok single line: 'N'

Test #27:

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

input:

3
8 4 1
9 2 2
6 9 2

output:

Y

result:

ok single line: 'Y'

Test #28:

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

input:

3
8 5 2
8 4 3
2 2 2

output:

Y

result:

ok single line: 'Y'

Test #29:

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

input:

1000
543 2 543
844 2 844
398 2 398
690 1 690
352 1 352
546 1 546
601 1 601
612 1 612
621 2 621
315 2 315
592 2 592
90 1 90
670 1 670
16 2 16
559 1 559
521 1 521
936 1 936
246 2 246
226 1 226
686 1 686
708 2 708
190 2 190
130 2 130
910 2 910
825 1 825
520 1 520
640 1 640
547 2 547
945 1 945
917 2 917...

output:

Y

result:

ok single line: 'Y'

Test #30:

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

input:

1000
1 -3432 1
1 -507 1
2 4764 2
2 -9816 2
2 9917 2
1 -2318 1
1 -1760 1
1 6403 1
2 -5668 2
2 -6088 2
2 -7947 2
1 -3789 1
2 -1705 2
1 -6196 1
1 846 1
1 3351 1
1 5797 1
1 3077 1
1 -3920 1
1 -8520 1
2 -4760 2
1 -3418 1
1 1290 1
2 263 2
2 7945 2
2 -8837 2
1 -5925 1
2 -8928 2
1 -2618 1
2 4189 2
2 -7121 2...

output:

Y

result:

ok single line: 'Y'

Test #31:

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

input:

1000
520 -7680 520
603 1311 603
973 3187 973
26 -8539 26
602 7906 602
235 -5272 235
843 7616 843
3 -3495 3
148 841 148
954 -7268 954
546 8378 546
502 2817 502
904 6844 904
278 6819 278
858 1042 858
118 4809 118
257 4840 257
423 -6444 423
576 7200 576
267 8306 267
173 9760 173
20 -9212 20
400 -8156 4...

output:

Y

result:

ok single line: 'Y'

Test #32:

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

input:

1000
619 -609 619
684 1039 684
515 3725 515
893 -7524 893
600 3917 600
587 8245 587
989 -1679 989
132 -526 132
739 -982 739
180 1746 180
241 -3260 241
543 7156 543
58 -9211 58
968 6309 968
142 -2831 142
104 -3860 104
975 -5783 975
256 7903 256
153 5608 153
108 -6822 108
977 -9930 977
651 148 651
631...

output:

Y

result:

ok single line: 'Y'

Test #33:

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

input:

1000
2762 -183 10
-3790 -3834 10
2129 4448 10
-3860 -2738 10
1078 -5622 10
-5816 288 10
3289 4425 10
1856 9026 10
-1006 -5795 10
8248 -6164 10
2127 -695 10
6738 3464 10
-511 7509 10
468 -4243 10
-8003 6051 10
-7270 -251 10
9784 -3674 10
2989 7245 10
-2141 3318 10
556 4211 10
-9119 492 10
1784 -1851 ...

output:

Y

result:

ok single line: 'Y'

Test #34:

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

input:

1000
-6210 -9733 100
8000 -9358 100
-1902 -9668 100
-2324 -9087 100
-9814 -9786 100
-1821 -9970 100
7242 -9699 100
-6675 -9482 100
3657 -9289 100
6126 -9573 100
5775 -9151 100
-6070 -9117 100
-117 -9211 100
7586 -9374 100
6490 -9351 100
7064 -9799 100
-117 -9453 100
-5680 -9475 100
-2806 -9526 100
-...

output:

Y

result:

ok single line: 'Y'

Test #35:

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

input:

1000
7908 -2631 918
2505 -830 438
-6915 2310 469
-5607 1874 10
9993 -3326 381
-7863 2626 43
4920 -1635 341
-5127 1714 645
5394 -1793 728
-6471 2162 360
-1710 575 613
4449 -1478 75
-2004 673 369
-6186 2067 950
-6441 2152 590
-7440 2485 443
-2634 883 248
-3318 1111 693
6546 -2177 343
891 -292 321
-699...

output:

Y

result:

ok single line: 'Y'

Test #36:

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

input:

1000
-3432 1149 350
6021 -2002 900
-9396 3137 892
-4047 1354 623
-9693 3236 172
5742 -1909 876
-6402 2139 386
-8964 2993 317
-4359 1458 88
-942 319 82
-3438 1151 928
-1422 479 669
7791 -2592 477
-8604 2873 416
5985 -1990 93
2934 -973 930
5079 -1688 789
-4689 1568 569
-1128 381 611
8388 -2791 239
285...

output:

Y

result:

ok single line: 'Y'

Test #37:

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

input:

1000
-10 10 1000
3324 3317 347
-2524 -2531 525
-7505 -7512 679
5734 5727 767
-7814 -7821 774
-3018 -3025 859
-8669 -8676 377
-9692 -9699 159
-7071 -7078 642
-7779 -7786 589
9926 9919 507
6354 6347 103
9129 9122 199
-8694 -8701 18
-904 -911 159
-5183 -5190 349
8347 8340 813
4541 4534 201
-3638 -3645 ...

output:

Y

result:

ok single line: 'Y'

Test #38:

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

input:

1000
-10 10 1000
-9334 -9341 897
-9493 -9500 692
7303 7296 171
3943 3936 513
3176 3169 870
4942 4935 72
4215 4208 386
515 508 848
7469 7462 822
3288 3281 325
-5559 -5566 768
8413 8406 276
-5981 -5988 486
390 383 301
-5145 -5152 220
9834 9827 533
5059 5052 555
718 711 193
1153 1146 805
1585 1578 493
...

output:

Y

result:

ok single line: 'Y'

Test #39:

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

input:

1000
0 0 1
-100 -3170 463
-100 -8898 673
-100 -9430 549
-100 792 997
-100 9354 921
-100 6606 730
-100 -6834 513
-100 6302 154
-100 -8582 755
-100 704 572
-100 -410 253
-100 -1250 851
-100 -3990 571
-100 -4914 557
-100 -530 202
-100 4518 304
-100 -9722 247
-100 3526 828
-100 -4842 120
-100 -5722 918
...

output:

Y

result:

ok single line: 'Y'

Test #40:

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

input:

1000
0 0 1
-100 134 402
-100 7728 275
-100 5136 431
-100 -4170 842
-100 -1942 111
-100 -8826 109
-100 6552 955
-100 -2744 168
-100 2814 837
-100 -9100 291
-100 2632 154
-100 -6494 803
-100 152 446
-100 -5604 359
-100 2178 796
-100 -3570 164
-100 -5026 156
-100 8244 697
-100 -3450 330
-100 6886 621
-...

output:

Y

result:

ok single line: 'Y'

Test #41:

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

input:

1000
1 1 1000
5 -10 1
-6516 -5 321
-4806 -5 700
9126 -5 163
-8607 -5 818
-4419 -5 211
6180 -5 384
-5235 -5 107
-9498 -5 480
-8499 -5 874
-1854 -5 670
414 -5 734
-1329 -5 592
2436 -5 608
3510 -5 830
-1302 -5 516
1584 -5 641
-8973 -5 321
8862 -5 788
3039 -5 394
-7413 -5 480
-2244 -5 79
-3450 -5 36
668...

output:

Y

result:

ok single line: 'Y'

Test #42:

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

input:

1000
1 1 1000
5 -10 1
5985 -5 623
-1950 -5 869
-63 -5 556
5574 -5 67
9888 -5 513
2664 -5 218
1620 -5 594
2142 -5 717
-3594 -5 65
3057 -5 786
3399 -5 281
6456 -5 289
6801 -5 476
9678 -5 310
-2826 -5 46
249 -5 511
8529 -5 110
-3552 -5 507
-8667 -5 90
-8928 -5 716
4440 -5 730
6477 -5 790
-6174 -5 325
-...

output:

Y

result:

ok single line: 'Y'

Test #43:

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

input:

1000
-49 -5 1
153 180 3
-37 33 1
221 244 3
219 245 3
238 167 3
-44 22 1
207 249 3
153 181 3
158 228 3
-19 46 1
47 -15 1
165 235 3
109 50 2
136 133 2
18 -46 1
213 248 3
186 248 3
84 147 2
149 95 2
210 151 3
206 249 3
182 153 3
53 117 2
235 234 3
60 69 2
145 78 2
151 212 3
37 -33 1
143 75 2
226 242 3
...

output:

Y

result:

ok single line: 'Y'

Test #44:

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

input:

1000
1099 -986 1
1064 -923 1
900 -990 1
1017 -901 1
-15 -34 2
-193 54 2
-173 88 2
-176 -44 2
1053 -915 1
1005 -900 1
900 -1010 1
932 -926 1
900 -987 1
-184 73 2
903 -972 1
-199 29 2
-26 -48 2
900 -1003 1
937 -1077 1
1003 -1099 1
0 9 2
-190 -22 2
-89 119 2
1099 -991 1
965 -1093 1
901 -1018 1
-169 91 ...

output:

Y

result:

ok single line: 'Y'

Test #45:

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

input:

1000
-479 -9314 100
7726 -9395 100
-1094 -9850 100
7653 -9141 100
-6410 -9186 100
-2609 -9351 100
-7810 -9884 100
-5579 -9918 100
7021 -9830 100
1022 -9468 100
5810 -9437 100
-2661 -9190 100
-1923 -9723 100
-7652 -9205 100
3992 -9481 100
-7848 -9840 100
242 -9306 100
7093 -9128 100
-9110 -9551 100
-...

output:

Y

result:

ok single line: 'Y'

Test #46:

score: 0
Accepted
time: 78ms
memory: 3924kb

input:

1000
-65 -173 3
-2 -49 1
-44 -23 1
19 -46 1
-84 -505 7
-98 -604 8
-74 -671 9
-35 -679 9
-58 -496 6
25 -126 2
-84 -858 10
3 -41 2
-94 -522 7
41 -27 1
-47 -226 4
-25 -310 5
-79 -375 5
-73 -279 4
24 -259 4
-72 -281 4
-54 -70 2
-6 -629 8
-34 -588 7
-8 -613 8
-5 -402 5
-1 -418 6
-104 -618 8
-89 -511 7
18...

output:

N

result:

ok single line: 'N'

Test #47:

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

input:

4
0 2 1
1 -1 2
3 3 5
4 0 2

output:

Y

result:

ok single line: 'Y'

Test #48:

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

input:

5
0 4 6
2 4 5
3 7 2
4 4 6
3 0 8

output:

Y

result:

ok single line: 'Y'

Test #49:

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

input:

4
-1 2 5
0 0 2
3 4 1
4 2 4

output:

N

result:

ok single line: 'N'

Test #50:

score: 0
Accepted
time: 2ms
memory: 3924kb

input:

1000
-1855 -8080 1
-2696 -4853 1
-9659 -7055 1
-2278 -6226 1
-6212 919 1
-7644 -6507 1
-222 -1867 1
-8253 5081 1
-6349 -5885 1
-8559 -4172 1
-1258 -4860 1
-8326 5 1
-982 8246 1
-9171 7309 1
-5415 -2703 1
-9142 -1822 1
-3301 -9874 1
-6861 794 1
-3281 81 1
-9434 -2056 1
-9775 -7844 1
-198 -8316 1
-307...

output:

Y

result:

ok single line: 'Y'

Test #51:

score: 0
Accepted
time: 12ms
memory: 4000kb

input:

1000
-687 6047 1
-7016 4060 1
-9161 8435 1
-7755 417 1
-5843 -4275 1
-414 -3940 1
-4765 3599 1
-3484 -2578 1
-9881 9498 1
-580 1875 1
-8533 -1124 1
-2379 -5848 1
-8600 4799 1
-5922 -9544 1
-6787 8610 1
-4159 4860 1
-313 9626 1
-7669 6728 1
-8331 -6726 1
-5009 864 1
-2246 3259 1
-3714 -8661 1
-5499 6...

output:

Y

result:

ok single line: 'Y'

Test #52:

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

input:

1000
-7733 -377 1
-2952 -9149 1
-8 -7906 1
-5409 -5469 1
-8078 -1694 1
-7658 -9801 1
-5923 -979 1
-8863 -7417 1
-9370 -3798 1
-3391 -6616 1
-5024 -3503 1
-4185 -8579 1
-539 -5113 1
-539 -4210 1
-1190 -7144 1
-1219 -8651 1
-9024 -3098 1
-500 -1565 1
-8024 -8499 1
-4902 -9286 1
-4926 -2987 1
-7561 -98...

output:

Y

result:

ok single line: 'Y'

Test #53:

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

input:

1000
-3019 -9819 1
-4406 -8012 1
-8113 -1275 1
-8642 -4856 1
-6386 -1933 1
-1929 -5513 1
-1975 -2695 1
-7825 -4373 1
-7848 -1057 1
-9915 -1813 1
-7028 -4739 1
-5432 -2155 1
-6544 -58 1
-9103 -8011 1
-6718 -85 1
-5045 -1127 1
-4876 -3595 1
-1659 -3628 1
-8700 -3154 1
-8168 -9401 1
-1908 -6297 1
-7428...

output:

Y

result:

ok single line: 'Y'