-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaoc1901_fuel.cpp
35 lines (31 loc) · 1.4 KB
/
aoc1901_fuel.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* ************************************************************************** */
/* */
/* \\ /`/`` */
/* ~\o o_ 0 0\ */
/* / \__) (u ); _ _ */
/* / \/ \/ / \ \/ \/ \ */
/* /( . . ) ( )\ */
/* / \_____/ \_______/ \ */
/* [] [] [[] [[] *. */
/* []] []] [[] [[] */
/* */
/* ****************************************************************** nuo *** */
#include "iostream"
int main()
{
int mass, gro, net, n;
net = 0;
gro = 0;
while (std::cin >> n)
{
mass = n / 3 - 2;
net += mass;
while (mass > 0)
{
if (mass > 0) gro += mass;
mass = mass / 3 - 2;
}
}
std::cout << "Star 1 : " << net << std::endl;
std::cout << "Star 2 : " << gro << std::endl;
}