diff options
author | Jack Sangdahl <[email protected]> | 2025-02-13 12:58:24 -0700 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2025-02-13 12:58:24 -0700 |
commit | 3331ee948ededea78a774eb53facec06035af4c8 (patch) | |
tree | c293c9206f917b04241b5ec243848b59297bc36f /introductory_problems/two_knights.cpp | |
parent | 3950be91f9589567d8258c788e10a0dec758e659 (diff) | |
download | cses-3331ee948ededea78a774eb53facec06035af4c8.tar.gz cses-3331ee948ededea78a774eb53facec06035af4c8.zip |
1072. two knights
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); + } +} |