fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. for (long long d = 2520;; d++) {
  6. long long x = d * d;
  7. int ile = 0;
  8.  
  9. // i <= d oznacza, że każdą parę liczymy tylko raz
  10. for (long long i = 1; i <= d; i++) {
  11. if (x % i == 0) {
  12. long long j = x / i;
  13.  
  14. if ((i + j) % 2 == 0){
  15. ile++;
  16. cout << i << "\n";
  17. }
  18. }
  19. }
  20.  
  21. if (ile >= 99) {
  22. cout << "d = " << d << '\n';
  23. cout << "liczba par = " << ile << '\n';
  24. break;
  25. }
  26. }
  27. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
2
4
6
8
10
12
14
16
18
20
24
28
30
32
36
40
42
48
50
54
56
60
70
72
80
84
90
96
98
100
108
112
120
126
140
144
150
160
162
168
180
196
200
210
216
224
240
252
270
280
288
294
300
324
336
350
360
378
392
400
420
432
450
480
490
504
540
560
588
600
630
648
672
700
720
756
784
800
810
840
864
882
900
980
1008
1050
1080
1120
1134
1176
1200
1260
1296
1350
1400
1440
1470
1512
1568
1620
1680
1764
1800
1890
1960
2016
2100
2160
2268
2352
2400
2450
2520
d = 2520
liczba par = 113