/ WOJ /

记录详情

System Error


  
Testdata configuration incorrect.
Memory limit larger than memory_max

代码

#include <bits/extc++.h>
#define endl '\n'
typedef long long ll;
#define int ll
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;

void Main()
{
	int n, m, d;
	cin >> n >> m >> d;
	const int cy = n * (d + 1);
	if (m < cy)
	{
		cout << -1 << endl;
		return;
	}
	int rem = m - cy;
	int res = 0;
	const int ub = min(n, rem);
	res += ub;
	rem -= ub;
	res += rem / (d + 1);
	cout << res << endl;
}

// #define CP_MULTI_TEST_CASES

signed main()
{
	ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
	int t = 1;
#ifdef CP_MULTI_TEST_CASES
	cin >> t;
#endif
	while (t--)
	{
		Main();
	}
	return cout << flush, fflush(stdout), 0;
}

信息

递交者
类型
递交
题目
P1000 云剪贴板
题目数据
下载
语言
C++
递交时间
2026-05-04 15:37:34
评测时间
2026-05-07 17:45:25
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes