#include <bits/stdc++.h>
using namespace std;
int k,n,t[100005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> k;
while (k != 0)
{
n++;
if (n == 1)
t[n - 1] = -1;
else
{
k -= (n - 1);
if (k >= 0)
t[n - 1] = n - 2;
else
{
k += (n - 1);
t[n] = k;
k = 0;
}
}
}
if (n > 0)
{
cout << n << '\n';
for (int i = 0; i < n; i++)
cout << i << ' ' << t[i] << '\n';
}
else
{
cout << 1 << '\n' << 0 << ' ' << -1;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Incorrect |
1 ms |
212 KB |
wrong number of pairs |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Incorrect |
1 ms |
212 KB |
wrong number of pairs |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Incorrect |
1 ms |
212 KB |
wrong number of pairs |
4 |
Halted |
0 ms |
0 KB |
- |