QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#600712#9347. Competition in Swiss-systemWrongAnswer_90AC ✓356ms10412kbC++237.0kb2024-09-29 18:30:432024-09-29 18:30:44

Judging History

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

  • [2024-09-29 18:30:44]
  • 评测
  • 测评结果:AC
  • 用时:356ms
  • 内存:10412kb
  • [2024-09-29 18:30:43]
  • 提交

answer

#include<bits/stdc++.h>
#define ull unsigned long long
#define ui unsigned int
#define ld long double
#define ll long long
#define lll __int128
#define fi first
#define se second
#define e emplace
#define eb emplace_back
#define db double
#define ef emplace_front
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vp vector<pii>
#define vt vector<tup>
#define all(x) x.begin(),x.end()
#define mp make_pair

#define FastI
#define FastO
#define int lll
bool ST;
static const ll MOD=1e8+7,Phi=998244352,inv2=499122177,Root=3,iRoot=332748118;
static const ll inf=1073741823,Inf=4294967296,INF=4557430888798830399;
static const ld eps=1e-9,pi=3.1415926535;
char in[1<<20],*p1=in,*p2=in;
char out[1<<20],*p3=out;
using namespace std;
struct tup
{
	int x,y,z;
	tup(int X=0,int Y=0,int Z=0)
	{x=X,y=Y,z=Z;}
};
#ifdef FastI
#define getchar() (p1==p2&&(p2=(p1=in)+fread(in,1,1<<20,stdin),p1==p2)?EOF:*p1++)
#endif
#ifdef FastO
#define putchar(x) (p3-out==1<<20?fwrite(out,1,1<<20,stdout),p3=out,0:0,*p3++=x)
#define puts(x) write(x,'\n')
#endif
namespace FastIO
{
	template<typename T> inline void write(T x,char ch=' ')
	{
		if(is_same<char,T>::value)putchar(x);
		else
		{
			if(x<0)x=-x,putchar('-');
			static char st[25];
			int top=0;
			do st[top++]=x%10+'0',x/=10;while(x);
			while(top)putchar(st[--top]);
		}
		ch!='~'?putchar(ch):0;
	}
	inline void write(const char*x,char ch=' ')
	{
		for(int i=0;x[i]!='\0';++i)putchar(x[i]);
		ch!='~'?putchar(ch):0;
	}
	inline void read(char&s){do s=getchar();while(s=='\n'||s==' ');}
	inline void read(char s[])
	{
		int len=0;char st;
		do st=getchar();while(st=='\n'||st==' ');
		s[++len]=st,st=getchar();
		while(st!='\n'&&st!=' ')s[++len]=st,st=getchar();
		s[++len]='\0';
	}
	template<typename T> inline void read(T &s)
	{
		char ch=getchar();s=0;
		while((ch>'9'||ch<'0')&&ch!='-')ch=getchar();
		bool tf=(ch=='-'&&(ch=getchar()));
		while(ch>='0'&&ch<='9')s=(s<<1)+(s<<3)+ch-'0',ch=getchar();
		s=tf?-s:s;
	}
	inline void edl(){putchar('\n');}
	template<typename T1,typename T2> inline void read(pair<T1,T2> &s){read(s.fi),read(s.se);}
	template<typename T,typename...Args> inline void write(T x,Args...args){write(x,'~'),write(args...);}
	template<typename T,typename...Args> inline void read(T&x,Args&...args){read(x),read(args...);}
	#ifdef FastO
	struct Writer{~Writer(){fwrite(out,1,p3-out,stdout);}}Writ;
	#endif
}
using namespace FastIO;
namespace MTool
{
	inline int Cadd(int a,int b){return (ll)a+b>=MOD?(ll)a+b-MOD:a+b;}
	inline int Cdel(int a,int b){return a-b<0?a-b+MOD:a-b;}
	inline int Cmul(int a,int b){return 1ll*a*b%MOD;}
	inline int sqr(int a){return 1ll*a*a%MOD;}
	inline void Madd(int&a,int b){a=((ll)a+b>=MOD?(ll)a+b-MOD:a+b);}
	inline void Mdel(int&a,int b){a=(a-b<0?a-b+MOD:a-b);}
	inline void Mmul(int&a,int b){a=1ll*a*b%MOD;}
	inline int Cmod(int x){return (x%MOD+MOD)%MOD;}
	inline void Mmod(int&x){x=(x%MOD+MOD)%MOD;}
	template<typename T> inline bool Mmax(T&a,T b){return a<b?a=b,1:0;}
	template<typename T> inline bool Mmin(T&a,T b){return a>b?a=b,1:0;}
	template<typename...Args> inline void Madd(int&a,int b,Args...args){Madd(a,b),Madd(a,args...);}
	template<typename...Args> inline void Mmul(int&a,int b,Args...args){Mmul(a,b),Mmul(a,args...);}
	template<typename...Args> inline void Mdel(int&a,int b,Args...args){Mdel(a,b),Mdel(a,args...);}
	template<typename...Args> inline int Cadd(int a,int b,Args...args){return Cadd(Cadd(a,b),args...);}
	template<typename...Args> inline int Cmul(int a,int b,Args...args){return Cmul(Cmul(a,b),args...);}
	template<typename...Args> inline int Cdel(int a,int b,Args...args){return Cdel(Cdel(a,b),args...);}
	template<typename...Args,typename T> inline bool Mmax(T&a,T b,Args...args){return Mmax(a,b)|Mmax(a,args...);}
	template<typename...Args,typename T> inline bool Mmin(T&a,T b,Args...args){return Mmin(a,b)|Mmin(a,args...);}
	inline int power(int x,int y){int s=1;for(;y;y>>=1,Mmul(x,x))if(y&1)Mmul(s,x);return s;}
}
using namespace MTool;
namespace WrongAnswer_90
{
	int n,m;
	int contestwin[10010],contestall[10010];
	int gamewin[10010],gameall[10010];
	pii game[10010],contest[10010];
	vi G[10010];
	bool vis[10010],lst[10010];
	int X[20];
	pii get(int x,int y)
	{
		int d=__gcd(x,y);
		return mp(x/d,y/d);
	}
	pii add(pii x,pii y)
	{
		pii z;
		z.fi=x.fi*y.se+x.se*y.fi;
		z.se=x.se*y.se;
		return get(z.fi,z.se);
	}
	pii get(pii x,pii y)
	{
		if(x.fi*y.se>y.fi*x.se)return x;
		return y;
	}
	inline void mian()
	{
		memset(contestwin,0,sizeof(contestwin));
		memset(contestall,0,sizeof(contestall));
		memset(gamewin,0,sizeof(gamewin));
		memset(gameall,0,sizeof(gameall));
//		cerr<<get(mp(0,1),mp(1,2)).fi<<" ";
//		cerr<<get(mp(0,1),mp(1,2)).se<<" ";
//		exit(0);
		read(n,m);int a,b,c,d,e;
		for(int i=1;i<=n;++i)
		{
			G[i].clear(),lst[i]=1;
			contestwin[i]=contestall[i]=0;
			gamewin[i]=gameall[i]=0;
		}
		for(int i=1;i<=m;++i)read(X[i]);
		for(int i=1;i<=m;++i)
		{
			for(int j=1;j<=n;++j)vis[j]=0;
			while(X[i]--)
			{
				read(a,b,c,d,e);
				vis[a]=vis[b]=1;
				gamewin[a]+=c*3+e;
				gamewin[b]+=d*3+e;
				gameall[a]+=(c+d+e)*3;
				gameall[b]+=(c+d+e)*3;
				
				contestall[a]+=3;
				contestall[b]+=3;
				if(c==d)
				contestwin[a]++,contestwin[b]++;
				else if(c>d)contestwin[a]+=3;
				else contestwin[b]+=3;
				
				G[a].eb(b),G[b].eb(a);
			}
			for(int j=1;j<=n;++j)
			{
				if(!vis[j])
				{
					contestall[j]+=3;
					contestwin[j]+=3;
					gamewin[j]+=6;
					gameall[j]+=6;
				}
				else lst[j]=0;
			}
			write("Round ",i,'\n');
//			for(int i=1;i<=n;++i)write(lst[i]);puts("");
//			for(int i=1;i<=n;++i)write(vis[i]);puts("");
//			for(int i=1;i<=n;++i)write(gamewin[i]);puts("");
//			for(int i=1;i<=n;++i)write(gameall[i]);puts("");
			for(int j=1;j<=n;++j)
			{
				game[j]=get(mp(1,3),get(gamewin[j],gameall[j]));
				contest[j]=get(mp(1,3),get(contestwin[j],i*3));
			}
//			for(int j=1;j<=n;++j)write(contest[j].fi,' ',contest[j].se,'\n');
//			puts("");
			for(int j=1;j<=n;++j)
			{
				write(contestwin[j]);
				if(lst[j])write(1,'/',3,' ');
				else
				{
					pii p=mp(0,1);
//					cerr<<j<<" with ";
					for(auto to:G[j])p=add(p,contest[to]);
					p=get(p.fi,p.se*G[j].size());
					write(p.fi,'/',p.se,' ');
				}
				{
					pii p=get(mp(1,3),get(gamewin[j],gameall[j]));
					write(p.fi,'/',p.se,' ');
				}
				if(lst[j])write(1,'/',3,' ');
				else
				{
					pii p=mp(0,1);
					for(auto to:G[j])p=add(p,game[to]);
					p=get(p.fi,p.se*G[j].size());
					write(p.fi,'/',p.se,' ');
				}
				if(lst[j])putchar(' '),putchar(' ');
				puts("");
			}
		}
	}
	inline void Mian()
	{
		int T=1;
		read(T);
		while(T--)mian();
	}
}
bool ED;
signed main()
{
//	freopen("1.in","r",stdin);
//	freopen("1.out","w",stdout);
	double st=clock();
	WrongAnswer_90::Mian();
	double ed=clock();
 	cerr<<endl;
 	cerr<<"Time: "<<ed-st<<" ms\n";
 	cerr<<"Memory: "<<abs(&ST-&ED)/1024.0/1024.0<<" MB\n";
	return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3
0 1 1
1 2 2 0 1
1 2 1 1 1
3 2
1 1
1 2 0 2 0
2 3 2 0 0

output:

Round 1
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
Round 2
6 1/2 13/15 7/15 
3 1/1 7/15 13/15 
Round 3
7 4/9 17/24 11/24 
4 7/9 11/24 17/24 
Round 1
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3   
Round 2
3 1/1 1/2 1/1 
6 1/2 1/1 1/2 
3 1/1 1/2 1/1 

result:

ok 17 lines

Test #2:

score: 0
Accepted
time: 158ms
memory: 6836kb

input:

3215
26 4
13 13 11 13
19 9 2 1 0
17 1 0 2 0
25 15 2 0 0
14 5 1 2 0
20 2 0 2 0
10 21 2 1 0
3 16 0 2 0
8 6 2 1 0
26 24 1 2 0
22 18 0 1 2
7 11 2 0 0
13 4 1 2 0
23 12 0 2 0
18 20 1 2 0
3 5 2 1 0
25 24 1 2 0
7 9 1 2 0
11 14 2 0 0
8 17 1 1 1
23 12 2 0 0
19 26 1 2 0
2 15 0 2 0
4 13 2 1 0
16 10 0 2 0
6 21 0...

output:

Round 1
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
3 1/3 2/3 1/3 
0 1/1 1/3 2/3 
3 1/3 1/1 1/3 
3 1/3 2/3 1/3 
0 1/1 1/3 2/3 
3 1/3 2/3 1/3 
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
0 1/1 1/3 2/3 
0 1/1 1/3 2/3 
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
3 1/3 5/9 1/3 
3 1/3 2/3 1/3 
0 1/1 1...

result:

ok 312175 lines

Test #3:

score: 0
Accepted
time: 109ms
memory: 6484kb

input:

602
67 7
7 9 4 9 10 6 10
18 36 2 0 0
14 63 1 2 0
20 2 2 1 0
45 17 1 1 1
16 24 0 2 0
15 12 1 1 1
59 38 1 2 0
25 3 1 2 0
19 6 0 2 0
26 51 0 2 0
50 66 1 1 1
4 27 1 2 0
12 5 0 1 2
41 2 1 1 1
54 1 1 1 1
28 29 0 2 0
38 64 1 1 1
46 63 1 1 1
25 44 2 1 0
30 11 0 2 0
60 38 2 0 0
11 39 1 1 1
23 8 1 1 1
2 29 0 ...

output:

Round 1
3 1/3 1/1 1/3   
0 1/1 1/3 2/3 
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
1 1/3 4/9 4/9 
3 1/3 1/1 1/3   
0 1/1 1/3 2/3 
1 1/3 4/9 4/9 
0 1/1 1/3 1/1 
1 1/3 4/9 4/9 
3 1/3 1/1 1/3 
...

result:

ok 303032 lines

Test #4:

score: 0
Accepted
time: 323ms
memory: 7276kb

input:

36
818 12
399 400 403 401 400 400 399 402 402 403 399 402
484 426 2 1 0
304 580 0 2 0
261 281 2 0 0
739 204 2 0 0
53 297 1 2 0
430 258 2 1 0
521 763 1 2 0
718 526 2 0 0
611 247 1 2 0
644 453 0 2 0
283 91 2 1 0
695 223 1 2 0
583 679 2 1 0
538 396 1 1 1
582 766 1 2 0
146 136 1 2 0
799 77 1 2 0
530 787...

output:

Round 1
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
3 1/3 2/3 1/3 
3 1/3 2/3 1/3 
0 1/1 1/3 7/9 
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
0 1/1 1/3 2/3 
0 1/1 1/3 2/3 
3 1/3 2/3 1/3 
0 1/1 1/3 2/3 
0 1/1 1...

result:

ok 300314 lines

Test #5:

score: 0
Accepted
time: 320ms
memory: 7048kb

input:

37
986 7
493 493 493 493 493 493 493
753 944 2 1 0
590 186 1 2 0
142 847 2 0 0
11 725 1 2 0
41 445 0 2 0
509 418 1 2 0
500 663 2 0 0
895 401 1 2 0
932 24 0 2 0
14 446 2 0 0
984 170 1 2 0
803 316 0 2 0
36 690 0 2 0
228 719 1 2 0
378 979 2 0 0
650 477 2 0 0
821 496 0 2 0
828 181 1 2 0
303 978 2 0 0
34...

output:

Round 1
3 1/3 7/9 1/3 
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
3 1/3 7/9 1/3 
1 1/3 4/9 4/9 
3 1/3 2/3 1/3 
3 1/3 1/1 1/3 
3 1/3 2/3 1/3 
0 1/1 1/3 2/3 
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
0 1/1 1/3 2/3 
3 1/3 2/3 1/3 
3 1/3 1/1 1/3 
0 1/1 1/3 2/3 
0 1/1 1/3 1/1 
3 1/3 2...

result:

ok 300065 lines

Test #6:

score: 0
Accepted
time: 304ms
memory: 7600kb

input:

39
455 12
194 198 198 192 188 196 194 193 185 192 193 185
274 152 2 0 0
172 313 2 1 0
324 382 2 0 0
423 41 1 2 0
108 273 2 0 0
88 436 0 2 0
1 386 2 0 0
162 384 2 0 0
176 195 1 1 1
371 303 0 2 0
292 198 0 2 1
98 403 0 2 0
57 225 1 2 0
142 256 1 1 1
362 211 1 1 1
318 265 0 2 0
235 322 2 1 0
126 165 2 ...

output:

Round 1
3 1/3 1/1 1/3 
3 1/3 1/1 1/3   
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
0 1/1 1/3 1/1 
3 1/3 1/1 1/3   
0 1/1 1/3 2/3 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3   
3 1/3 7/9 1/3 
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
3 1/3 2/3 1/3 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
0 1/1 1/3 2/3 
3 1/3 1/1 ...

result:

ok 300060 lines

Test #7:

score: 0
Accepted
time: 188ms
memory: 6496kb

input:

1053
46 7
23 23 23 23 23 23 23
46 26 2 1 0
9 14 0 2 0
2 15 2 0 0
12 16 2 0 0
22 29 0 2 0
7 17 2 0 0
20 3 0 2 0
41 31 1 1 1
44 6 0 2 0
32 8 1 1 1
23 36 2 0 0
30 5 1 2 0
4 21 0 2 0
42 34 0 2 0
37 27 1 2 0
19 13 2 1 0
18 38 1 2 0
43 28 2 0 0
24 11 2 1 0
39 10 2 1 0
25 33 0 2 0
35 45 0 2 1
40 1 2 0 0
16...

output:

Round 1
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
1 1/3 4/9 4/9 
0 1/1 1/3 1/1 
0 1/1 1/3 2/3 
0 1/1 1/3 2/3 
3 1/3 1/1 1/3 
0 1/1 1/3 2/3 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
0 1/1 1/3 1/1 
0 1/1 1/3 1/1 
0 1/1 1/3 2/3 
3 1/3 2/3 1/3 
0 1/1 1...

result:

ok 306093 lines

Test #8:

score: 0
Accepted
time: 296ms
memory: 6968kb

input:

38
408 9
202 201 202 202 201 199 203 201 202
145 197 0 2 0
303 110 2 1 0
168 83 1 2 0
312 254 2 1 0
120 27 0 2 0
162 194 0 2 0
133 128 1 2 0
146 268 2 1 0
238 52 2 0 0
147 72 0 2 0
280 95 2 1 0
211 322 1 2 0
118 400 2 1 0
138 123 2 0 0
101 328 0 2 0
172 267 2 0 0
293 313 1 2 0
360 189 2 1 0
193 202 ...

output:

Round 1
3 1/3 2/3 1/3 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
3 1/3 2/3 1/3 
3 1/3 1/1 1/3 
0 1/1 1/3 2/3 
3 1/3 1/1 1/3 
0 1/1 1/3 2/3 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
0 1/1 1/3 2/3 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
3 1/3 2/3 1/3 
0 1/1 1/3 2/3 
3 1/3 1/1 1/3   
3 1/3 2/3 1/3 
0 1/1...

result:

ok 299664 lines

Test #9:

score: 0
Accepted
time: 333ms
memory: 6984kb

input:

34
682 11
336 339 338 337 338 339 338 335 338 336 334
75 474 2 0 0
368 334 2 0 0
501 600 0 2 0
133 291 0 2 0
630 498 0 2 0
125 681 1 2 0
393 198 1 2 0
17 574 0 2 0
558 217 2 1 0
121 71 2 1 0
355 188 2 0 0
598 351 2 0 0
80 593 0 2 1
540 508 0 2 0
647 63 2 1 0
287 447 0 2 0
409 141 0 2 0
543 459 1 2 0...

output:

Round 1
3 1/3 2/3 1/3 
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
3 1/3 2/3 1/3 
3 1/3 1/1 1/3 
1 1/3 4/9 4/9 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
0 1/1 1/3 1/1 
0 1/1 1/3 2/3 
0 1/1 1/3 1/1 
0 1/1 1/3 2/3 
3 1/3 7/9 1/3 
3 1/3 2/3 1/3 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
0 1/1 1/3 2/3 
3 1/3 2/3 1/3 
3 1/3 2...

result:

ok 299852 lines

Test #10:

score: 0
Accepted
time: 356ms
memory: 6980kb

input:

18
1000 16
500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500
906 272 2 0 1
150 792 2 1 0
499 344 0 0 3
809 137 2 1 0
321 309 2 0 1
606 363 2 1 0
62 813 2 0 1
63 354 1 1 1
530 921 1 0 2
325 532 1 1 1
830 439 2 0 1
558 735 1 1 1
157 106 2 0 0
915 166 2 1 0
990 528 0 2 1
503 833 2 0 0
221...

output:

Round 1
0 1/1 1/3 7/9 
0 1/1 1/3 5/9 
0 1/1 1/3 1/1 
0 1/1 1/3 7/9 
1 1/3 4/9 4/9 
1 1/3 1/3 1/3 
1 1/3 1/3 1/3 
3 1/3 1/1 1/3 
1 1/3 4/9 4/9 
3 1/3 5/9 1/3 
3 1/3 1/1 1/3 
3 1/3 7/9 1/3 
3 1/3 5/9 1/3 
3 1/3 2/3 1/3 
0 1/1 1/3 2/3 
0 1/1 1/3 5/9 
1 1/3 4/9 4/9 
3 1/3 2/3 1/3 
3 1/3 1/1 1/3 
3 1/3 7...

result:

ok 288288 lines

Test #11:

score: 0
Accepted
time: 318ms
memory: 6916kb

input:

18
1000 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1000 16
500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500
916 131 0 0 3
77 600 0 0 3
83 120 0 0 3
291 132 0 0 3
943 450 0 0 3
373 15 0 0 3
597 954 0 0 3
955 841 0 0 3
350 310 0 0 3
422 947 0 0 3
508 868 0 0 3
155 571 0 0 3
415 295 0 0 3
138 82...

output:

Round 1
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1/3 1/1 1/3   
3 1...

result:

ok 288288 lines

Test #12:

score: 0
Accepted
time: 354ms
memory: 10364kb

input:

3
4299 14
2149 2149 2149 2149 2149 2149 2149 2149 2149 2149 2149 2149 2149 2149
2946 716 2 1 0
2553 1869 1 2 0
755 406 1 1 1
1203 2823 0 2 0
4077 3512 1 2 0
725 603 0 2 0
2852 1096 2 0 0
476 288 2 0 0
1840 2298 0 2 0
501 2736 0 2 0
3981 1285 2 0 0
1421 3234 1 2 0
4167 3812 2 0 0
3570 3250 0 2 0
1999...

output:

Round 1
3 1/3 1/1 1/3 
0 1/1 1/3 2/3 
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
0 1/1 1/3 1/1 
0 1/1 1/3 2/3 
0 1/1 1/3 1/1 
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
3 1/3 2/3 1/3 
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
3 1/3 2/3 1/3 
1 1/3 4/9 4/9 
0 1/1 1/3 1/1 
0 1/1 1/3 1/1 
0 1/1 1...

result:

ok 292315 lines

Test #13:

score: 0
Accepted
time: 328ms
memory: 10412kb

input:

3
6536 8
3237 3232 3238 3239 3234 3239 3236 3228
4819 4365 2 1 0
1844 4941 1 2 0
6225 3950 2 1 0
1707 4719 2 0 0
63 895 2 1 0
5270 3536 2 0 0
2097 2650 0 2 0
568 4192 0 2 0
4853 4221 0 2 0
5788 1504 0 2 0
5534 3632 2 0 0
6212 192 2 1 0
3914 92 2 0 0
3117 1919 0 2 0
4943 6070 2 0 0
2132 5123 2 0 0
29...

output:

Round 1
0 1/1 1/3 2/3 
3 1/3 2/3 1/3 
0 1/1 1/3 2/3 
0 1/1 1/3 2/3 
0 1/1 1/3 2/3 
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
0 1/1 1/3 2/3 
3 1/3 2/3 1/3 
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
3 1/3 2/3 1/3 
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
0 1/1 1/3 1/1 
3 1/3 2...

result:

ok 293052 lines

Test #14:

score: 0
Accepted
time: 205ms
memory: 10140kb

input:

1
10000 16
5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000
6547 6961 2 1 0
3374 1491 0 2 0
2327 947 0 2 1
568 6497 2 0 0
9049 6556 0 1 2
8327 7516 2 0 0
4639 4156 0 2 0
2949 6724 0 2 0
1500 1082 0 2 0
7374 2824 2 1 0
3415 1330 1 2 0
5144 2864 0 2 0
8357 4832 0 2 0
605...

output:

Round 1
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
1 1/3 4/9 4/9 
0 1/1 1/3 1/1 
0 1/1 1/3 1/1 
1 1/3 4/9 4/9 
3 1/3 1/1 1/3 
3 1/3 1/1 1/3 
0 1/1 1/3 7/9 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
0 1/1 1/3 1/1 
3 1/3 1/1 1/3 
3 1/3 7/9 1/3 
3 1/3 1/1 1/3 
0 1/1 1/3 1/1 
0 1/1 1...

result:

ok 160016 lines

Extra Test:

score: 0
Extra Test Passed