B 同学由于 OJ 数据出的太水了,导致所有人都水过了,于是被同学们狠批了一顿。
这次他决定痛定思痛,从「非暴力不合作(特别弱化版)」这题开始加强数据。
他首先让 S 同学验了这道题,S 同学写了一份这样的代码:
#include <cstdio>
int s0, D, n;
int a[5005], b[5005];
int main() {
scanf("%d %d %d", &s0, &D, &n);
if (s0 < D) {
printf("-1");
return 0;
}
for (int i = 1; i <= n; i++)
scanf("%d", &a[i]);
for (int i = 1; i <= n; i++)
scanf("%d", &b[i]);
int nowStat = s0;
int ans = 0;
for (int i = 1; i <= n; i++) {
s0 -= b[i];
if (s0 < D) {
s0 += a[i] + b[i];
ans++;
}
}
printf("%d\n", n - ans);
return 0;
}
B 同学一眼就发现了该代码是错误的,但在 B 同学的内网 OJ 中,S 同学通过了这道题!
于是他希望你写一个数据生成器,给出能让此代码输出错误答案的数据。