QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#859910 | #9969. Kindergarten Square | Judgelight | WA | 0ms | 3840kb | C++14 | 425b | 2025-01-18 08:23:17 | 2025-01-18 08:23:32 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define eb emplace_back
#define mk make_pair
using namespace std;
int t,a,b,c,d;
signed main(){
scanf("%d",&t);
while(t--){
scanf("%d%d%d%d",&a,&b,&c,&d);int h,w;
if(a<b&&c<d&&b<c&&c-a==d-b){
w=c-a,h=d/w+1;if(w==1000)h=10;
if((a-1)/w!=(b-1)/w||(c-1)/w!=(d-1)/w)printf("-1\n");
else printf("%d %d\n",h,w);
}
else printf("-1\n");
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
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: 0
Accepted
time: 0ms
memory: 3840kb
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:
2 3 -1 2 4 3 3 2 4 -1 -1 -1 -1 -1
result:
ok All testcases passed.
Test #3:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
10 1 1 1 1 1 2 3 4 1 2 5 7 4 5 7 8 1001 1002 1003 1004 1001 1002 1005 1007 1004 1005 1007 1008 249 250 251 252 250 251 250 251 250 250 250 251
output:
-1 3 2 -1 3 3 503 2 -1 337 3 127 2 -1 -1
result:
ok All testcases passed.
Test #4:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
10 249 251 250 251 249 250 250 251 249 250 251 251 249 250 251 251 51 52 61 62 50 52 61 62 52 52 61 62 51 51 61 62 51 53 61 62 51 52 60 62
output:
-1 -1 -1 -1 7 10 -1 -1 -1 -1 -1
result:
ok All testcases passed.
Test #5:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
10 51 52 62 62 51 52 61 61 51 52 61 63 109 110 119 120 108 110 119 120 110 110 119 120 109 109 119 120 109 111 119 120 109 110 118 120 109 110 120 120
output:
-1 -1 -1 13 10 -1 -1 -1 -1 -1 -1
result:
ok All testcases passed.
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3840kb
input:
10 109 110 119 119 109 110 119 121 1050 1075 2050 2075 1 2 1001 1002 101 102 1101 1102 999 1000 1999 2000 2 2 1001 1002 1 1 1001 1002 1 3 1001 1002 1 2 1000 1002
output:
-1 -1 10 1000 10 1000 10 1000 10 1000 -1 -1 -1 -1
result:
wrong answer Incorrect H & W pair for the given 2x2 submatrix.