QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#859918#9969. Kindergarten Squaremzmz001#RE 1ms3840kbC++14381b2025-01-18 08:27:362025-01-18 08:28:05

Judging History

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

  • [2025-01-18 08:28:05]
  • 评测
  • 测评结果:RE
  • 用时:1ms
  • 内存:3840kb
  • [2025-01-18 08:27:36]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
long long n,m,k,l,fl,T,a1,a2,a3,a4;
int main(){
	cin>>T;
	for(int u=1;u<=T;u++){
		scanf("%lld%lld%lld%lld",&a1,&a2,&a3,&a4);
		m=a3-a1;n=(a3+m-1)/m;
		if(a2-a1!=1||a4-a3!=1||(a3+m-1)/m-(a1+m-1)/m!=1||(a3+m-1)/m-(a2+m-1)/m!=1||(a4+m-1)/m-(a1+m-1)/m!=1||(a4+m-1)/m-(a2+m-1)/m!=1)puts("-1");
		else cout<<n<<' '<<m<<'\n';
	}
}	

详细

Test #1:

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

input:

4
6 7
10 11
2 3
4 5
8 5
5 13
1 2
5 6

output:

3 4
-1
-1
2 4

result:

ok All testcases passed.

Test #2:

score: -100
Runtime Error

input:

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

output:


result: