fork download
  1. def ile_pol(n):
  2. return n*n
  3. def ile_kolorowych(n, kolor):
  4. if kolor=="b":
  5. return n*n//2
  6. else:
  7. return (n*n-1)//2+1
  8. def testuj_szachownica(n):
  9. for i in range(2,33):
  10. print(i, ile_pol(i), ile_kolorowych(i, "b"), ile_kolorowych(i, "b"))
  11. print(testuj_szachownica(32))
Success #stdin #stdout 0.09s 14168KB
stdin
Standard input is empty
stdout
2 4 2 2
3 9 4 4
4 16 8 8
5 25 12 12
6 36 18 18
7 49 24 24
8 64 32 32
9 81 40 40
10 100 50 50
11 121 60 60
12 144 72 72
13 169 84 84
14 196 98 98
15 225 112 112
16 256 128 128
17 289 144 144
18 324 162 162
19 361 180 180
20 400 200 200
21 441 220 220
22 484 242 242
23 529 264 264
24 576 288 288
25 625 312 312
26 676 338 338
27 729 364 364
28 784 392 392
29 841 420 420
30 900 450 450
31 961 480 480
32 1024 512 512
None