22 lines
487 B
C++
22 lines
487 B
C++
|
|
#include <bits/stdc++.h>
|
||
|
|
|
||
|
|
using namespace std;
|
||
|
|
int cnt;
|
||
|
|
const int N = 1010;
|
||
|
|
int f[N];
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
int n = 1000, m = 1000;
|
||
|
|
for (int x = 1; x <= n; x++)
|
||
|
|
for (int y = 1; y <= m; y++)
|
||
|
|
for (int len = 1;; len++) {
|
||
|
|
int tx = x + len - 1, ty = y + len - 1;
|
||
|
|
if (tx > n || ty > m) break;
|
||
|
|
f[len]++;
|
||
|
|
}
|
||
|
|
|
||
|
|
for (int i = 1; i <= min(n, m); i++)
|
||
|
|
cout << f[i] << " ";
|
||
|
|
|
||
|
|
return 0;
|
||
|
|
}
|