QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#859911#9969. Kindergarten Squaresherman2022#WA 1ms3840kbC++14767b2025-01-18 08:23:182025-01-18 08:23:39

Judging History

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

  • [2025-01-18 08:23:39]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3840kb
  • [2025-01-18 08:23:18]
  • 提交

answer

#include <bits/stdc++.h>

#define i64 long long int

#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second

#define eb emplace_back

using namespace std;

inline int Read() {int res; return scanf("%d", &res), res; }
inline i64 Read64() {i64 res; return scanf("%lld", &res), res; }

const int INF_32 = 1e9;
const i64 INF_64 = 1e18;

int T, a, b, c, d;

int main() {
	T = Read();
	while(T --) {
		a = Read(), b = Read();
		c = Read(), d = Read();
		if(a != b - 1 || c != d - 1) puts("-1");
		else {
			if(a == d || a == c || b == c || c < b || d < b) puts("-1");
			int m = c - b + 1;
			int n = (d + m - 1) / m;
			if((a - 1) % m > m - 2) puts("-1");
			else printf("%d %d\n", n, m);
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

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: -100
Wrong Answer
time: 1ms
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
2 3
2 4
-1
-1
-1
-1
-1
-1
-1

result:

wrong output format Extra information in the output file