commit 7c314f720a6e1d9dd7a804b01aec1d57d37698b5 parent 5827773e44e07a594bf3c57c31309c2124219ddb Author: superpozycja <anna@superpozycja.net> Date: Wed, 23 Oct 2024 22:45:48 +0200 solve two knights (silly answer) Diffstat:
A | intro/two_knights.cpp | | | 16 | ++++++++++++++++ |
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/intro/two_knights.cpp b/intro/two_knights.cpp @@ -0,0 +1,16 @@ +#include <bits/stdc++.h> + +using namespace std; + +void solve() +{ + long n; + cin >> n; + for (long i = 1; i <= n; i++) + cout << (i*i * (i*i-1) / 2) - (4 * (i - 1) * (i - 2)) << "\n"; +} + +int main() +{ + solve(); +}