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, "c"))
  11. print(testuj_szachownica(32))
Success #stdin #stdout 0.11s 14192KB
stdin
Standard input is empty
stdout
2 4 2 2
3 9 4 5
4 16 8 8
5 25 12 13
6 36 18 18
7 49 24 25
8 64 32 32
9 81 40 41
10 100 50 50
11 121 60 61
12 144 72 72
13 169 84 85
14 196 98 98
15 225 112 113
16 256 128 128
17 289 144 145
18 324 162 162
19 361 180 181
20 400 200 200
21 441 220 221
22 484 242 242
23 529 264 265
24 576 288 288
25 625 312 313
26 676 338 338
27 729 364 365
28 784 392 392
29 841 420 421
30 900 450 450
31 961 480 481
32 1024 512 512
None