Language: C++

#include <bits/stdc++.h>

#define Need_For_Speed ios_base::sync_with_stdio;cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define mp make_pair

#define sz size
#define bg begin
#define en end

#define fe first
#define se second

using namespace std;

typedef long long ll;
typedef long double ld;

const int N = 1e6 + 17, maxN = 4 * N, darr = 1e3 + 17, mod = 1e9 + 7;

ll q, h, s, d, n;

int main () {
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	Need_For_Speed;
	cin >> q >> h >> s >> d >> n;
	cout << (n / 2) * 1ll * min(min(q * 1ll * 8, h * 1ll * 4), min(s + s, d)) + (n % 2) * 1ll * min(min(q * 1ll * 4, h + h), s);
	return 0;
}#include <bits/stdc++.h>

#define Need_For_Speed ios_base::sync_with_stdio;cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define mp make_pair

#define sz size
#define bg begin
#define en end

#define fe first
#define se second

using namespace std;

typedef long long ll;
typedef long double ld;

const int N = 1e6 + 17, maxN = 4 * N, darr = 1e3 + 17, mod = 1e9 + 7;

ll q, h, s, d, n;

int main () {
	Need_For_Speed;
	cin >> q >> h >> s >> d >> n;
	cout << (n / 2) * 1ll * min(min(q * 1ll * 8, h * 1ll * 4), min(s + s, d)) + (n % 2) * 1ll * min(min(q * 1ll * 4, h + h), s);
	return 0;
}

Compiler output:
a.cc:32:2: error: stray '#' in program
   32 | }#include <bits/stdc++.h>
      |  ^
a.cc:32:3: error: 'include' does not name a type
   32 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:50:11: error: redefinition of 'const int N'
   50 | const int N = 1e6 + 17, maxN = 4 * N, darr = 1e3 + 17, mod = 1e9 + 7;
      |           ^
a.cc:19:11: note: 'const int N' previously defined here
   19 | const int N = 1e6 + 17, maxN = 4 * N, darr = 1e3 + 17, mod = 1e9 + 7;
      |           ^
a.cc:50:25: error: redefinition of 'const int maxN'
   50 | const int N = 1e6 + 17, maxN = 4 * N, darr = 1e3 + 17, mod = 1e9 + 7;
      |                         ^~~~
a.cc:19:25: note: 'const int maxN' previously defined here
   19 | const int N = 1e6 + 17, maxN = 4 * N, darr = 1e3 + 17, mod = 1e9 + 7;
      |                         ^~~~
a.cc:50:39: error: redefinition of 'const int darr'
   50 | const int N = 1e6 + 17, maxN = 4 * N, darr = 1e3 + 17, mod = 1e9 + 7;
      |                                       ^~~~
a.cc:19:39: note: 'const int darr' previously defined here
   19 | const int N = 1e6 + 17, maxN = 4 * N, darr = 1e3 + 17, mod = 1e9 + 7;
      |                                       ^~~~
a.cc:50:56: error: redefinition of 'const int mod'
   50 | const int N = 1e6 + 17, maxN = 4 * N, darr = 1e3 + 17, mod = 1e9 + 7;
      |                                                        ^~~
a.cc:19:56: note: 'const int mod' previously defined here
   19 | const int N = 1e6 + 17, maxN = 4 * N, darr = 1e3 + 17, mod = 1e9 + 7;
      |                                                        ^~~
a.cc:52:4: error: redefinition of 'll q'
   52 | ll q, h, s, d, n;
      |    ^
a.cc:21:4: note: 'll q' previously declared here
   21 | ll q, h, s, d, n;
      |    ^
a.cc:52:7: error: redefinition of 'll h'
   52 | ll q, h, s, d, n;
      |       ^
a.cc:21:7: note: 'll h' previously declared here
   21 | ll q, h, s, d, n;
      |       ^
a.cc:52:10: error: redefinition of 'll s'
   52 | ll q, h, s, d, n;
      |          ^
a.cc:21:10: note: 'll s' previously declared here
   21 | ll q, h, s, d, n;
      |          ^
a.cc:52:13: error: redefinition of 'll d'
   52 | ll q, h, s, d, n;
      |             ^
a.cc:21:13: note: 'll d' previously declared here
   21 | ll q, h, s, d, n;
      |             ^
a.cc:52:16: error: redefinition of 'll n'
   52 | ll q, h, s, d, n;
      |                ^
a.cc:21:16: note: 'll n' previously declared here
   21 | ll q, h, s, d, n;
      |                ^
a.cc:54:5: error: redefinition of 'int main()'
   54 | int main () {
      |     ^~~~
a.cc:23:5: note: 'int main()' previously defined here
   23 | int main () {
      |     ^~~~