diff options
Diffstat (limited to 'introductory_problems/two_knights.cpp')
-rw-r--r-- | introductory_problems/two_knights.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/introductory_problems/two_knights.cpp b/introductory_problems/two_knights.cpp new file mode 100644 index 0000000..60933bc --- /dev/null +++ b/introductory_problems/two_knights.cpp @@ -0,0 +1,13 @@ +// 1072. Two Knights +#include <bits/stdc++.h> +using namespace std; + +int main() { + static int n; + scanf("%d", &n); + for (int i = 1; i <= n; i++) { + long long cnt = 1LL + (i - 1) * (i - 2) / 2; + cnt = cnt * (i - 1) * (i + 4); + printf("%lld\n", cnt); + } +} |