Skip to content

Commit 995d31e

Browse files
committed
Restructure repo - mathematics/fundamentals
1 parent 4fd0108 commit 995d31e

15 files changed

+26
-0
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//HalloweenParty.cpp
2+
//Algorithms - Warmup
3+
//Author: derekhh
4+
5+
#include<iostream>
6+
using namespace std;
7+
8+
int main()
9+
{
10+
int t;
11+
cin >> t;
12+
while (t--)
13+
{
14+
int k;
15+
cin >> k;
16+
if (k % 2 == 1)
17+
{
18+
long long tmp = k / 2;
19+
cout << tmp * (tmp + 1) << endl;
20+
}
21+
else
22+
{
23+
cout << (long long)k * k / 4 << endl;
24+
}
25+
}
26+
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)