From 3331ee948ededea78a774eb53facec06035af4c8 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Thu, 13 Feb 2025 12:58:24 -0700 Subject: 1072. two knights --- introductory_problems/two_knights.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 introductory_problems/two_knights.cpp (limited to 'introductory_problems/two_knights.cpp') 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 +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); + } +} -- cgit v1.2.3