akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <map>
using namespace std;
vector<int> sosu;
void init (int n) {
  for (int i = 2; i <= n; i++) {
    for (int j = 2; j <= i; j++) {
      if (i % j == 0 && i != j) {
        break;  
      }    
      if (j == i) {
        sosu.push_back(i);    
      }
    }    
  }  
}

int main () {
  int N;
  cin >> N;
  vector<int> ans(N + 1, 0);
  init(N);
  for (int i = 2; i <= N; i++) {
    // iについて素因数分解をする
    for (int j = 0; j < sosu.size(); j++) {
      if (i < sosu[j]) {
        break;  
      }    
      int sub = sosu[j];
      int it = 1;
      while (i >= sub) {
        if (i % sub == 0) {
          ans[sosu[j]] ++;    
        }    
        it++;
        sub = sub * sosu[j];
      }
    }
  }
  long long as = 1;
  for (int i = 0; i <= N; i++) {
    if (ans[i] != 0) {
      as = as * (ans[i] + 1) % 1000000007;    
    }
  }
  cout << as << endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp6
{
	class Program
	{
		static void Main(string[] args)
		{
			string S = Console.ReadLine();
			int time = int.Parse(S);

			int h = time / 3600;
			int m = (time % 3600) / 60;
			int s = (time % 3600) % 60;


			Console.WriteLine("{0}:{1}:{2}", h, m, s);

		}
	}
}


Measured memory_bytes: 17960
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int[] a = new int[3];
		
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
		}
		int ans = Integer.MAX_VALUE;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			}
		}
		
		System.out.println(ans);
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;

#ifdef _DEBUG
#define dout cout
#define debug() if (true)
#define dvout(v) vout(v)
#else
#define dout if (false) cout
#define debug() if (false)
#define dvout(v) if(false) vout(v)
#endif

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define vout(v)           \
	for (auto &i : v)     \
	{                     \
		cout << i << " "; \
	}                     \
	cout << "\n"; //配列出力
#define vec(v, n) vector<int> v(n, 0);
#define vecll(v, n) vector<ll> v(n, 0);
#define vecvec(v,n,m) vector<vector<int>> v(n, vector<int>(m));
#define vin(v)        \
	for (auto &i : v) \
		cin >> i; //配列入力

#define mod (int)(1e9+7)
typedef long long ll;
typedef unsigned long long ull;
#define next asdnext
#define prev asdprev
#define _n "\n"
#define _n2 "\n\n"
#define _t "\t"

vector<int> a = {1, 14, 32, 51, 51, 51, 243, 419, 750, 910};


void Main()
{
	int D;
	cin>>D;
	vec(c,26);
	vin(c);

	vecvec(s,D,26);
	rep(i, D){
		rep(j,26){
			cin>>s[i][j];
		}
	}

	vec(t, D);
	rep(i,D){
		cin>>t[i];
		t[i]--;
	}


	vec(last,26);
	ll satisfi=0;

	dout<<_n2;
	rep(i,D){
		int d=i+1;
		rep(j,26){
			if(j==t[i]){
				satisfi += s[i][j];
				last[j] = d;
			}
			else{
				satisfi -= c[j]*(d-last[j]);
			}
		}
		cout<<satisfi<<_n;
	}

	dout<<last[12];
}



int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << std::fixed << std::setprecision(15);
	Main();
	return 0;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_back
#define pp() pop_back()
#define V vector
#define P pair
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
#define Q queue
#define pri priority_queue
#define Pri priority_queue<int,vector<int>,greater<int>>
#define PriP priority_queue<P<int,int>,vector<P<int,int>>,greater<P<int,int>>>
#define ff first.first
#define fs first.second
#define sf second.first
#define ss second.second
#define all(a)  (a).begin(),(a).end()
#define elif else if


int low(V<int> a,int b){
  decltype(a)::iterator c=lower_bound(a.begin(),a.end(),b);
  int d=c-a.bgn;
  return d;
}
int upp(V<int> a,int b){
  decltype(a)::iterator c=upper_bound(a.begin(),a.end(),b);
  int d=c-a.bgn;
  return d;
}
int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
}
int gcd(int a,int b){
  if(a%b==0)
    return b;
  return gcd(b,a%b);
}
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
int INF=1000000007;
int kaijou(int a){
  int b=1;
  fo(i,a)
    b*=i+1;
  return b;
}

V<P<int,int>> factorize(int n){
  V<P<int,int>> res;
  for(int i=2; i*i<=n; i++){
    if(n%i)
      continue;
    res.emplace_back(i,0);
    while(n%i==0){
      n/=i;
      res.back().second++;
    }
  }
  if(n!=1)
    res.emplace_back(n,1);
  return res;
}

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

string s;
int a[500010];
signed main(){
  cin>>s;
  queue<int> que;
  for(int i=1; i<=s.size()-1; i++){
    if (s[i - 1] == '>' && s[i] == '<') {
      a[i] = 0;
      que.push(i);
    }
  }
  if (s[0] == '<') {
    a[0] = 0;
    que.push(0);
  }
  if (s.back() == '>') {
    a[s.size()] = 0;
    que.push(s.size());
  }
  while (!que.empty()) {
    int n = que.front();
    que.pop();
    if (n) {
      if (s[n - 1] == '>') {
        a[n - 1] = max(a[n - 1], a[n] + 1);
        que.push(n - 1);
      }
    }
    if (n < s.size()) {
      if (s[n] == '<') {
        a[n + 1] = max(a[n + 1], a[n] + 1);
        que.push(n + 1);
      }
    }
  }
  int sum = 0;
  fo(i, s.size() + 1)sum += a[i];
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 6660
N = int(input())
A = list(map(int, input().split()))

def gcd(a, b):
  if b == 0: return a
  return gcd(b, a % b)

left = [0] * (N+1)
right = [0] * (N+1)

for i in range(N):
  left[i+1] = gcd(left[i], A[i])
for i in range(N):
  right[N-i-1] = gcd(right[N-i], A[N-i-1])

ans = max( gcd(left[i], right[i+1]) for i in range(N) )
print(ans)


Measured memory_bytes: 14052
# C - Sum of gcd of Tuples (Easy)
from math import gcd
K = int(input())
ans = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            ans += gcd(gcd(a,b),c)
print(ans)

Measured memory_bytes: 9044
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[10000],b[10000];
int main()
{
	scanf("%s",a+1);
	scanf("%s",b+1);
	int l=strlen(a+1);
	for(int i=1;i<=l;i++)
	{
		if(a[i]!=b[i])
		{
			printf("No");
			return 0;
		}
	}
	printf("Yes");
} 

Measured memory_bytes: 3836
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,a,b,x;
    while (cin>>n) {
        if (n==0) {
            break;
        } else {
            cin>>a>>b;
            std::deque<int> deq;
            for (int i=0;i<n;i++) {
                cin>>x;
                deq.emplace_back(x);
            }
            int gap=-1;
            int ans=0;
            while (a<=b) {
                if (deq[a-1]-deq[a]>=gap) {
                    gap=deq[a-1]-deq[a];
                    ans=a;
                }
                a++;
            }
            cout<<ans<<endl;
        }
    }
}


Measured memory_bytes: 3016
#include <bits/stdc++.h>
#define pb push_back
#define mkp make_pair
#define llu unsigned long long int
#define ll long long
#define ld long double
#define foi(a,n) for(int i = a; i < n; i++)
#define foj(a,n) for(int j = a; j < n; j++)
#define foin(a,n) for(int i = n; i >= a; i--)
#define fojn(a,n) for(int j = n; j >= a; j--)
#define isp2(x) x&&(!(x&(x-1)))
#define ee 1000000007
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define cases long long t;cin>>t;while(t--)

using namespace std;

int n;
int a[100002];
int dp[100002];
int mn(int i){
	if(i == n - 2){
		return abs(a[n-1] - a[n-2]);
	}
	if(i == n-1){
		return 0;
	}
	if(dp[i] != -1){
		return dp[i];
	}
	return dp[i] = min(mn(i+1) + abs(a[i] - a[i+1]), mn(i+2) + abs(a[i] - a[i+2]));
}

int main() {
    ll q, m, x, y, d;
    string s, h;
	cin >> n >> x; 
	foi(0, n) {
		cin >> a[i];
		dp[i] = ee;
		dp[i+1] = ee;
	}
	dp[0] = 0;
	foi(0, n){
		foj(1, x+1){
			if(i+j < n) dp[i+j] = min(dp[i+j], dp[i] + abs(a[i] - a[i+j]));
		}
	}
	
	cout << dp[n-1];

}




Measured memory_bytes: 4292
import math

a, b, c, d = map(int, input().split())
lcm_cd = c * d // math.gcd(c, d)

ans_lt_b = b - (b // c + b // d - b // lcm_cd)
ans_lt_a = (a - 1) - ((a - 1) // c + (a - 1) // d - (a - 1) // lcm_cd)
print(ans_lt_b - ans_lt_a)


Measured memory_bytes: 9172
#include <bits/stdc++.h>
using namespace std;

int main()
{
  ios::sync_with_stdio(0);
  cin.tie(0);

  int n, x, y;
  vector < pair<int, int> > jobs;
  cin >> n;
  for (int i = 0; i < n; i++)
  {
    cin >> x >> y;
    jobs.push_back({y, x});
  }

  sort(jobs.begin(), jobs.end());
  long long t = 0;
  int ans = 1;
  for (auto job : jobs)
  {
    t += job.second;
    ans &= t <= job.first;
  }

  cout << (ans ? "Yes" : "No") << endl;
}


Measured memory_bytes: 2420
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
using ll = long long;

int main(){
    ll n,k;
    cin>>n>>k;
    vector<pair<int,int>> p(n);
    for(int i=0;i<n;i++){
        int a,b;
        cin>>a>>b;
        p[i]=make_pair(a,b);
    }
    sort(p.begin(),p.end());
    vector<ll> v(n);
    for(int i=0;i<n;i++){
        if(i) v[i]=v[i-1]+p[i].second;
        else v[i]=p[i].second;
    }
    int i=lower_bound(v.begin(),v.end(),k)-v.begin();
    cout<<p[i].first<<endl;
}

Measured memory_bytes: 4820
N = int(input())
A = list(map(int, input().split()))

A = [0] + A
for i in range(N//2, 0, -1):
    A[i] = sum(A[i::i])%2
ans = [i for i in range(N+1) if A[i]]
print(len(ans))
print(*ans)

Measured memory_bytes: 12720
/*==============================================*\
Codeforces ID:    mdshihab
                                                  |
Name:     Md. Shihabul Minhaz                     |
Study:      CSE, JKKNIU                           |
Address:  Trishal, Mymensingh, Bangladesh         |
                                                  |
 mail:   mdshihabul20171@gmail.com                |
 FB  :   fb.com/mdshihabul.minhaz.7               |
 github: Shihabulminhaz                           |
stopstalk :  mdshihab                             |
                                                  |
@uthor   Md. Shihabul Minhaz (shihab)             |
\*===============================================*/


#include<bits/stdc++.h>
using namespace std;
#define fi(a) scanf("%d",&a);
#define fli(a) scanf("%ld",&a);
#define fll(a) scanf("%lld",&a);
#define pi(a) printf("%d\n",a);
#define ppi(i,a) printf("Case %d: %d\n",i,a);
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
void FI()
{
#ifndef ONLINE_JUDGE
    freopen("C:\\Users\\SHIHAB\\Desktop\\input.in","r",stdin);
#endif // ONLINE_JUDGE
}

int main()
{
    fast
    FI(); /// skip this line for compile
    string s;
    cin >> s;
    if(s=="ABC") cout << "ARC\n";
    else cout << "ABC\n";
    return 0;
}



Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define sb __builtin_popcount
#define MOD (ll)1000000007

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    double a, b, x;
    cin >> a >> b >> x;
    double c = (((double)2 * x) / (a * a)) - b;
    cout << fixed;
    if (c >= 0)
    {
        cout << setprecision(9) << (atan((b - c) / a) * (double)180) / 3.14159265358979 << endl;
    }
    else
    {
        c = ((double)2 * x / (a * b));
        cout << setprecision(9) << (atan(b / c) * (double)180) / 3.14159265358979;
    }
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef vector<ll> VLL;
typedef vector<vector<ll>> VVLL;
typedef pair<ll, ll> Pair;
template <class T> T input() {T t; cin>>t; return t;}
#define FOR(i,a,b) for (ll i = a; i < b; i++)
#define REP(i,b) FOR(i,0,b)
#define RFOR(i,a,b) for (ll i = a-1; i >= b; i--)
#define RREP(i,a) RFOR(i,a,0)
#define REPALL(i,x) for (ll i = 0; i < x.size(); i++)
#define RREPALL(i,x) for (ll i = x.size()-1; i >= 0; i--)
#define REPITR(itr,x) for (auto itr = (x).begin(); itr != (x).end(); itr++)
#define ALL(x) (x).begin(), (x).end()
#define SORT(x) sort(ALL(x))
#define MIN_ELEMENT(x) min_element(ALL(x))
#define MAX_ELEMENT(x) max_element(ALL(x))
#define COUNT(x,num) count(ALL(x), num)
#define MEMSET(x,val) memset(x, val, sizeof(x))
#define CHMAX(a,b) a = max(a,b)
#define CHMIN(a,b) a = min(a,b)
#define FIND(x,key) x.find(key) != x.end()
#define IN_RANGE_V2(v,k,x,y) (0<=x+dx[k]&&x+dx[k]<v[y].size()&&0<=y+dy[k]&&y+dy[k]<v.size())
#define debug(x) cerr<<__LINE__<<": "<<(#x)<<" = "<<(x)<<endl;
void YES(bool flag) {cout<<(flag ? "YES" : "NO")<<endl;}
void Yes(bool flag) {cout<<(flag ? "Yes" : "No")<<endl;}
void yes(bool flag) {cout<<(flag ? "yes" : "no")<<endl;}
#define PRINT_ARRAY_H(a) REPALL(__i,a) {cout<<a[__i]<<(__i != a.size()-1 ? " " : "");} newline;
#define PRINT_ARRAY_V(a) REPALL(__i,a) {cout<<a[__i]<<endl;}
#define e1 first
#define e2 second
#define newline putchar('\n')
#define cspace ' '
#define sspace " "
const int INF = 1e7;
const ll MOD = 1e9 + 7;
const double pi = 3.141592653589793;
const VI dx = {1, 0, -1, 0};
const VI dy = {0, 1, 0, -1};
//const VI dx = {1, 1, 0, -1, -1, -1, 0, 1};
//const VI dy = {0, 1, 1, 1, 0, -1, -1, -1};

void solve()
{
    ll a, b, c, d, n, m, l, r, k, x, y, z, ans = 0ll;
    string s, t;
    cin>>x>>k>>d;
    if (x < 0) x = -x;
    ll tmp = min(x/d,k);
    k = k - tmp;
    x -= tmp * d;
    if (k%2==0)
        cout<<abs(x)<<endl;
    else
        cout<<abs(x-d)<<endl;
}

int main()
{
    cout<<fixed<<setprecision(20);
    int __t = 1;
    //cin>>__t;
    REP(i,__t) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3628
/* Author: Rennan Rocha
 * Time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
**/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define F first
#define S second
#define PB push_back
#define MP make_pair

#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define pi pair<int,int>
#define pll pair<ll, ll>
#define vpi vector<pi>
#define vpll vector<pll>

#define INF 1e18
#define MOD 1000000007

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
//*find_by_order(); order_of_key();

int main() {
    ios_base::sync_with_stdio(false);

    int s, w;
    cin >> s >> w;

    if(w>=s) cout << "unsafe\n";
    else cout << "safe\n";
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
#include <inttypes.h>

#ifndef LOCAL_
#define fprintf if( false ) fprintf
#endif // LOCAL_
#define dump() fprintf(stderr, "#%s.%d\n", __func__, __LINE__);
#define dumpl(x1) fprintf(stderr, "#%s.%d (%s) = (%ld)\n", __func__, __LINE__, #x1, x1);
#define dumpll(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%ld, %ld)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define dumplll(x1, x2, x3) fprintf(stderr, "#%s.%d (%s, %s, %s) = (%ld, %ld, %ld)\n", __func__, __LINE__, #x1, #x2, #x3, x1, x2, x3);
#define dumpd(x1) fprintf(stderr, "#%s.%d (%s) = (%lf)\n", __func__, __LINE__, #x1, x1);
#define dumpdd(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%lf, %lf)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define loop for(;;)
typedef int64_t Int;
typedef std::vector<Int> LI;
const double pi = 3.14159265358979323846264338;
const Int mod = 1000000007;

template<typename T> void scan1(T& x) { fprintf(stderr, "unknown type\n"); }
template<> void scan1(Int& x) { if( scanf("%" PRId64, &x) < 0 ) exit(0); }
template<> void scan1(std::string& x) { if( not ( std::cin >> x ) ) exit(0); }
template<> void scan1(LI& xs) { for(Int &x : xs) scan1(x); }
void scan() {}
template<typename Head, typename... Tail>
void scan(Head& x, Tail&... xs) {
  scan1(x); scan(xs...);
}

struct Q001 {
   Int n;
   std::vector<Int> xs;
   std::vector<Int> ys;
   Q001(Int n_) : n(n_+1), xs(n, -1), ys(n, 1) {}
   Int find(Int i) {
      if( xs[i] == -1 ) return i;
      return xs[i] = find(xs[i]);
   }
   void unite(Int x, Int y) {
      Int i = find(x);
      Int k = find(y);
      if( i == k ) return;
      if( not ( ys[i] >= ys[k] ) ) std::swap(i, k);
      ys[i] += ys[k];
      xs[k] = i;
   }
   bool same(Int x, Int y) {
      return find(x) == find(y);
   }
};

struct Solver {
   Solver() { fprintf(stderr, "--------Solver begin--------\n"); }
   ~Solver() { fprintf(stderr, "--------Solver end--------\n"); }
   void solve() {
      Int n, q; scan(n, q);
      Q001 uf(n);
      for(Int i = 0; i < q; ++i) {
         Int c, x, y; scan(c, x, y);
         if( c == 0 ) {
            uf.unite(x, y);
         }
         else if( c == 1 ) {
            puts(uf.same(x, y) ? "1" : "0");
         }
      }
   }
};

int main() {
   loop std::unique_ptr<Solver>(new Solver())->solve();
}

Measured memory_bytes: 3280
#include <bits/stdc++.h>
using namespace std;

int main() {
  // ここにプログラムを追記
  int A,N;
  cin >> N >> A;
  if (N%500 == 0) cout << "Yes" <<endl;
  else if (N-A <= 0) cout << "Yes" <<endl;
  else if (N%500 - A <= 0) cout << "Yes" <<endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <list>
using namespace std;

using INT = long long;
using UINT = unsigned long long;

int main()
{
	INT a, b, c;
	cin >> a >> b >> c;

	cout << a * b / 2 << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i,n) for (int i = (int)(n)-1; i>=0; --i)
#define For(i,a,b) for(auto i=(a);i<=(b);++i)
#define rFor(i,a,b) for(auto i=(b);i>=(a);--i)
#define call(var) cerr<<#var<<"="<<var<<"\n";
#define dup(x,y) (((x)+(y)-1)/(y))
#define all(x) (x).begin(),(x).end()
using ll=long long;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using Graph = vector<vi>;
using P = pair<int,int>;
const int MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;
const double pi = acos(-1);
template<class t,class u> inline bool chmax(t&a,u b){if(a<b){a=b;return true;}return false;}
template<class t,class u> inline bool chmin(t&a,u b){if(b<a){a=b;return true;}return false;}
template<class T> istream& operator>>(istream& is, vector<T>& a){rep(i,a.size()) is >> a[i]; return is;}
template<class T> ostream& operator<<(ostream& os, vector<T>& a){rep(i,a.size()) os << a[i] << " "; return os;}
template<class T, class U> istream& operator>>(istream& is, pair<T,U>& p){is >> p.first >> p.second; return is;}
template<class T, class U> ostream& operator<<(ostream& os, const pair<T,U>& p){os << "("<< p.first << "," << p.second << ")"; return os;}
template<class T, class U> ostream& operator<<(ostream& os, const map<T,U>& mp){for(auto& t : mp) os << t.first << " " << t.second << "\n"; return os;}

int main(){
    vi a(5);
    cin >> a;
    rep(i,5) if(a[i] == 0){
        cout << i+1 << "\n";
        return 0;
    }
}

Measured memory_bytes: 3624
#include<iostream>
#include<fstream>
#include<math.h>
#include<algorithm>
#include<string>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<sstream>
#include<set>

using namespace std;

#define forn(i,n) for(int i=0;i<(int)(n); i++)
#define forsn(i,s,n) for(int i=(s);i<(int)(n); i++)
#define esta(x,v) (find((v).begin(),(v).end(),(x)) !=  (v).end())
#define index(x,v) (find((v).begin(),(v).end(),(x)) - (v).begin())
#define debug(x) cout << #x << " = "  << x << endl
#define pb push_back
#define mp make_pair

typedef long long tint;
typedef pair<int,int> pint;
typedef pair<tint,tint> ptint;
typedef unsigned long long utint;
typedef long double ldouble;

typedef vector<int> vint;

int toNumber (string s)
{
	int Number;
	if ( ! (istringstream(s) >> Number) ) Number = 0; // el string vacio lo manda al cero
	return Number;
}

string toString (int number)
{
    ostringstream ostr;
    ostr << number;
    return  ostr.str();
}

tint ele(tint a, tint b){
	if(b==0)return 1;
	if(b%2==0){
		return ele(a*a, b/2);
	}else{
		return a*ele(a*a, b/2);
	}
}

tint mcd(tint a, tint b){
	if(a==0)return b;
	return mcd(b%a, a);
}

double d_abs(long a, long b){
	if(a>b){
		return a-b;
	}
	return b-a;
}

void solve(){
	tint a, b, c, d;
	cin>>a>>b>>c>>d;
	tint n;
	cin>>n;
	if(2*a<b)b=2*a;
	if(2*b<c)c=2*b;
	if(2*c<d)d=2*c;
	tint gasto=(n/2)*d;
	if(n%2)gasto+=c;
	cout<<gasto<<endl;
}




int main (){
	int T;
	T=1;
	while(T--){
		solve();
	}
}


Measured memory_bytes: 764
#include<bits/stdc++.h>
using ll= long long;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define ALL(x) x.begin(),x.end()

#define INF (ll)1e9 //10^9:∞
#define LLINF (ll)1e12
#define MOD (ll)(1e9+7) //10^9+7:合同式の法
#define PI 3.141592653589
#define PB push_back
#define F first
#define S second
#define __MAGIC__ ios::sync_with_stdio(false);cin.tie(nullptr);

#define YESNO(T) if(T){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yesno(T) if(T){cout<<"yes"<<endl;}else{cout<<"no"<<endl;}
#define YesNo(T) if(T){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

#define Graph vector<vector<int>>
#define PII pair<int,int>
#define VI vector<int>
#define VVI vector<vector<int>>
#define VPII vector<pair<int,int>>

#define DDD fixed<<setprecision(10)
#define endl "\n"

using namespace std;
/*..................DEFINE GLOBAL VARIABLES...................*/


/*.....................DEFINE FUNCTIONS ......................*/



/*.........................kemkemG0...........................*/
signed main() {
	__MAGIC__


	string s;
	cin>>s;

	vector<int> ans(s.size(),0);

	REP(aa,2){
		int cnt=0;
		REP(i,s.size()){
			//solve R
			if(s[i]=='R')cnt++;
			else {
				ans[i]+=cnt/2;
				ans[i-1]+=(cnt+1)/2;
				cnt=0;

			}

		}
		reverse(ALL(s));
		reverse(ALL(ans));
		REP(ii,s.size()){
			if(s[ii]=='R')s[ii]='L';
			else s[ii]='R';
		}

	}

	for(auto a:ans)cout<<a<<endl;

	



	

		return 0;
}


Measured memory_bytes: 3864
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1145141919810364364LL;
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)

vector<int>E[101010];
int dfs(int now,int p){
	vector<int>li;
	int ma = 0;
	fore(x, E[now]) {
		if (x != p)li.pb(dfs(x,now));
	}
	sort(all(li));
	reverse(all(li));
	for (int i = 0; i < li.size(); i++)ma = max(ma,li[i]+(i+1));
	return ma;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int N;
	cin >> N;
	for (int i = 0; i < N-1; i++) {
		int a;
		cin >> a;
		a--;
		E[a].pb(i+1);
		E[i+1].pb(a);
	}
	puts(dfs(0,-1));

	return 0;
}

Measured memory_bytes: 15104
#include <stdio.h>

int main(int argc, char **argv) {
	/*
	 * Position of antennas
	 */
	int positions[5];
	int e, k;

	for (int i = 0; i < 5; i++) {
		int tmp;
		scanf("%d", &tmp);
		positions[i] = tmp;
	}

	scanf("%d", &k);

	int flag = 0;
	for (int i = 0; i < (5 - 1); i++) {
		for (int j = i + 1; j < 5; j++) {
			if (k < (positions[j] - positions[i]))
				flag = 1;
		}
	}

	if (flag == 0) {
		printf("Yay!");
	} else {
		printf(":(");
	}

	return 0;
}

Measured memory_bytes: 128
/*
    -ensure correct output format
    -ensure printing required output
    -reread the problem statement
  */

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll>pll;
typedef pair<ll,pair<ll,ll>>plll;
#define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
#define vll(v) v.begin(),v.end()
#define all(x) x.rbegin(),x.rend()
#define min3(a, b, c)   min(a, min(b, c))
#define max3(a, b, c)   max(a, max(b, c))
#define F first
#define S second
#define in  freopen("input.txt", "r", stdin)
#define out  freopen("output.txt", "w", stdout)
#define minheap int,vector<int>,greater<int>
#define pb push_back
#define eb emplace_back
#define ischar(x)  (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z'))
#define isvowel(ch) ((ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')||(ch=='A'|| ch=='E' || ch=='I'|| ch=='O'|| ch=='U'))
#define bug cout<<"BUG"<<endl;
const int Max = 2e6 + 10;
const int Mod = 1e9 + 7;
const double PI  =3.141592653589793238463;
bool compare(const pair<ll,ll> &a, const pair<ll,ll> &b)
{
       return (a.first > b.first);
}
ll lcm(ll a,ll b)
{
    if(a==0 || b==0)return 0;

    return a/__gcd(a,b)*b;
}

void input(ll ara[],ll n)
{
    for(ll i=0; i<n; i++)cin>>ara[i];
}
void print(ll ara[],ll n)
{
    for(ll i=0; i<n; i++)
        cout<<ara[i]<<" ";
    cout<<endl;
}


int main()
{

   fastread();

   ll i,j,n,m,p,a,sum=0,k,t,b,c,d,cnt=0,q,l,r,ans=0;

      bool flag=false;

      string str;



  cin>>a>>b>>c;

  a*=b;
  cout<<a/2<<endl;









}



Measured memory_bytes: 3628
/*
(1)for binary shift operator always use 'LL' 1LL<<63

*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
#define ordered_set_pair tree<pair<ll,ll>, null_type,less<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update> 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define ordered_multiset tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define Luv(...) [&] (auto &&u, auto &&v) { return __VA_ARGS__; }
  const double  pi=3.1415926535; 
  struct pair_hash
{
	template <class T1, class T2>
	std::size_t operator () (std::pair<T1, T2> const &pair) const
	{
		std::size_t h1 = std::hash<T1>()(pair.first);
		std::size_t h2 = std::hash<T2>()(pair.second);

		return h1 ^ h2;
	}
};
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n;cin>>n;
	if(n>=30)
		cout<<"Yes";
	else cout<<"No";

	return 0;
} 

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main() {
int A , B, C, D, E, F;
cin >> A >> B >> C >> D >> E >> F;
double water, sugar_water;
double sugar, max_sugar;
double density = 0;
for(int i = 0; i <= F/(A*100); i++){
for(int j = 0; 100*(A*i + B*j) <= F; j++){
if(i == 0 && j == 0){continue;}
else water = 100*(A*i + B*j);
for(int k = 0; k <= F/C; k++){
for(int l = 0; (k*C + l*D) <= (E*water)/100; l++){
if(k == 0 && l == 0){continue;}
else sugar = (C*k + D*l);
if(sugar + water <= F){
if(density < sugar/(water + sugar)){
max_sugar = sugar;
sugar_water = water;
density = sugar/(sugar + water);}}}}}}
if(max_sugar == 0)cout << 100*A << " " << max_sugar << endl;
else cout << max_sugar + sugar_water << " " << max_sugar << endl;}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<ll, ll>P;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void SAY(bool YES){cout<<(YES?"YES":"NO")<<endl;};
void Say(bool Yes){cout<<(Yes?"Yes":"No")<<endl;};

const ll MOD = 1000000007;

int main(){

    ll a, b, c;
    cin >> a >> b >> c;
    cout << a + b + c - max(a, max(b, c)) << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;

int main() {
  ll n;
  cin >> n;
  vector<ll> dp(n+1);
  dp[0]=dp[1]=1;
  for(ll i=0;i<n-1;i++) {
    dp[i+2]=dp[i+1]+dp[i];
  }
  cout << dp[n] << endl;
}


Measured memory_bytes: 3108
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(V) V.begin(),V.end()

int main(){
	int N;
	ll x = 0, ans = 0;
	cin >> N;
	string S;
	map<string, int> A;
	for (int i = 0;i < N;i++) {
		cin >> S;
		sort(all(S));
		if (A.count(S))A[S]++;
		else A.insert({ S,1 });
	}
	for (auto i : A) {
		x = i.second;
		ans += x * (x - 1) / 2;
	}
	cout << ans << endl;
}

Measured memory_bytes: 11136
n = int(input())
xy1 = []
xy2 = []
for _ in range(n):
    x, y = map(int, input().split())
    xy1.append(x+y)
    xy2.append(x-y)
ans = max(max(xy1)-min(xy1), max(xy2)-min(xy2))
print(ans)

Measured memory_bytes: 100548
#include <bits/stdc++.h>
using namespace std;

const int N = 200 * 1000 + 10;

int n, q, p, x, ans[N];
vector <int> gr[N];

void dfs(int v, int p) {
	for (auto u: gr[v]) 
		if(u != p) {
			ans[u] += ans[v];
			dfs(u, v);
		} 
}

void get() {
	cin >> n >> q;
	for (int i = 0; i < n - 1; i++) {
		int x, y;
		cin >> x >> y;
		gr[--x].push_back(--y);
		gr[y].push_back(x);
	}
	for (int i = 0; i < q; i++) {
		cin >> p >> x;
		ans[--p] += x;
	}
}

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	get();
	dfs(0, -1);	
	for (int i = 0; i < n; i++)
		cout << ans[i] << " ";
}

Measured memory_bytes: 23552
#include<iostream>
using namespace std;
int main(){
    int H, W;
    
    while(1){
        cin >> H >> W;
        
        if((H == 0) && (W == 0))break;
        
        for(int i = 0;i < H ;i++){
            
            for(int i = 0;i < W ;i++){
                cout << "#";
            }
            
            cout << endl;
        }
        cout << endl;
    }
}



Measured memory_bytes: 3088
//C
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>


//Hang in there!

using namespace std;


int main() {
	int N;
	cin >> N;
	vector<int>data(N);
	int two, four;
	two = four = 0;
	for (int i = 0; i < N; i++) {
		cin >> data[i];
		if (data[i] % 2 == 0) {
			two++;
		}
		if (data[i] % 4 == 0) {
			four++;
		}
	}
	two -= four;
	if (four >= N / 2) {
		cout << "Yes" << endl;
	}
	else if(two >= N - ( 2 * four)){
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 640
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"

int ans = 0;
int N;
vector<int>rests;

void getans(const int sum,const int now, const vector < pair<int, vector<int>>>&connects, vector<int>&oks) {
	if (now == N)ans =max(ans, sum);
	else {
		if (sum + rests[now] < ans)return;
		if (oks[now]) {
			vector<int>preoks(oks);
			preoks[now] = false;
			for (auto e : connects[now].second) {
				preoks[e] = false;
			}
			getans(sum + connects[now].first, now+1, connects, preoks);
			
		}
		if (now) {

			getans(sum, now + 1, connects, oks);
		}
	}
}
int main() {
	while (1) {
		cin >> N;
		if (!N)break;
		ans = 0;
		rests.clear();
		rests.resize(N);
		if (!N)break;
		map<string, int>mp;
		vector<tuple<int,int,vector<int>>>connects(N);
		int num = 0;
		for (int i = 0; i < N; ++i) {
			string name; int b, c; cin >> name >> b >> c;
			if (mp.find(name) == mp.end()) {
				mp[name] = num;
				num++;
			}
			int myid = mp[name];
			get<0>(connects[myid]) = b;
			get<1>(connects[myid]) = myid;
			vector<int>vs;
			for (int j = 0; j < c; ++j) {
				string st; cin >> st;
				if (mp.find(st) == mp.end()) {
					mp[st] = num;
					num++;
				}
				int opid = mp[st];
				vs.emplace_back(opid);
				get<2>(connects[myid]).emplace_back(opid);
			}
		}
		sort(connects.begin()+1, connects.end());
		reverse(connects.begin()+1, connects.end());
		map<int,int>convert;
		for (int i = 0; i < N; ++i) {
			convert[get<1>(connects[i])] = i;
		}
		for (int i = 0; i < N; ++i) {
			for (auto& j : get<2>(connects[i])) {
				j = convert[j];
			}
		}
		int a = get<0>(connects[N - 1]);
		rests[N - 1] =a;
		for (int i = N - 2; i >= 0; --i) {
			rests[i] = rests[i + 1] + get<0>(connects[i]);
		}
		vector<pair<int, vector<int>>>newconnects;
		for (int i = 0; i < N; ++i) {
			newconnects.emplace_back(get<0>(connects[i]), get<2>(connects[i]));
		}

		vector<int>oks(N, true);
		getans(0, 0, newconnects, oks);
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 3192
#include<iostream>
using namespace std;

int main(){
  int n;
  cin >> n;
  int fn[50];
  fn[0] = fn[1] = 1;
  for(int i = 2; i <= n; i++) fn[i] = fn[i - 1] + fn[i - 2];

  cout << fn[n] << endl;
  return 0;
}

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define MAX_N 200
int n,m;
double t[MAX_N];
int G[MAX_N][MAX_N];
bool visited[MAX_N];
int par[MAX_N];

void rdfs(int pos,int si){
  visited[pos]=true;
  par[pos]=si;
  for(int i=0;i<n;i++){
    if(G[i][pos]==0)continue;
    if(visited[i])continue;
    rdfs(i,si);
  }
}

void dfs(int pos,vector<int> &v){
  visited[pos]=true;
  for(int i=0;i<n;i++){
    if(G[pos][i]==0)continue;
    if(visited[i])continue;
    dfs(i,v);
  }
  v.push_back(pos);
}

int main(){
  while(1){
    cin>>n;
    if(n==0)break;
    memset(G,0,sizeof(G));
    for(int i=0;i<n;i++){
      cin>>t[i];
      int k;
      cin>>k;
      for(int j=0;j<k;j++){
        int a;
        cin>>a;
        a--;
        G[i][a]=1;
      }
    }


    vector<int> v;
    memset(visited,false,sizeof(visited));
    for(int i=0;i<n;i++){
      if(visited[i])continue;
      dfs(i,v);
    }
    
    memset(visited,false,sizeof(visited));
    reverse(v.begin(),v.end());
    for(int i=0;i<(int)v.size();i++){
      int si=v[i];
      if(visited[si])continue;
      rdfs(si,si);
    }

    vector<bool> flg(n,false);
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
        if(G[i][j]==0)continue;
        if(par[i]!=par[j]){
          flg[ par[j] ]=true;
        }
      }
    }

    double ans=1.0;
    for(int i=0;i<n;i++){
      if(par[i]!=i)continue;
      if(flg[i])continue;
      double p=1.0;
      for(int j=0;j<n;j++){
        if(par[j]!=i)continue;
        p*=t[j];
      }
      ans*=(1.0-p);
    }

    printf("%.10f\n",ans);
  }
  return 0;
}

Measured memory_bytes: 3424
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);


    int a, b, c, x, y;
    cin >> a >> b >> c >> x >> y;

    int ans = 1001001001;
    for(int i = 0; i <= 100000; ++i) {
        int A = max(0,x-i);
        int B = max(0, y-i);
        ans = min(ans, i*(2*c)+(A*a)+(B*b));
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3604
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

int main()
{
	string S;
	cin >> S;
	for (int i = 0; i < S.size() - 1; i++) {
		if (S[i] == S[i + 1]) {
			cout << "Bad" << endl;
			return 0;
		}
	}
	cout << "Good" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main() {
  char c;

  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> c;
      if (i == j) cout << c;
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;

int main()
{
    int m, f, r;
    char grade;

    while (true) {
        cin >> m >> f >> r;

        if (m == -1 && f == -1 && r == -1) {
            return 0;
        }

        if (m == -1 || f == -1) {
            grade = 'F';
        } else {
            if (m + f >= 80) {
                grade = 'A';
            } else if (m + f >= 65) {
                grade = 'B';
            } else if (m + f >= 50) {
                grade = 'C';
            } else if (m + f >= 30) {
                if (r >= 50) {
                    grade = 'C';
                } else {
                    grade = 'D';
                }
            } else {
                grade = 'F';
            }
        }

        cout << grade << endl;
    }
}

Measured memory_bytes: 1152
#include<bits/stdc++.h>
using namespace std;
//#define int         long long
#define ull 		unsigned long long
#define ll 			long long
#define M 			1000000007
#define pb 			push_back
#define p_q 		priority_queue
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define ios	    	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mp 			make_pair
#define lb 			lower_bound
#define ub			upper_bound
#define F           first
#define S           second
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define ini(a,n,b)	for(ll int i=0;i<n;i++) a[i]=0;
#define cset(a)		__builtin_popcountll(a)
#define hell 		(ull)1e9
#define PI          acos(-1)
#define re 			resize
#define un(a)		sort(a.begin(),a.end());a.resize(unique(a.begin(),a.end())-a.begin())

int n;
ull k;
int dp[(ll)2e5+1][61];
signed main(void)
{ios
	cin>>n>>k;
	rep(i,1,n+1)
	cin>>dp[i][0];
	for(int p=1;p<=60;p++)
		for(int i=1;i<=n;i++)
			dp[i][p]=dp[dp[i][p-1]][p-1];
	int cur=1;
	for(int i=60;i>=0;i--)
		if(((1ull)<<i)&k)
			cur=dp[cur][i];
	cout<<cur<<endl;
}

Measured memory_bytes: 51312
#include <bits/stdc++.h>
using namespace std;
template<class T> bool chmax(T& a,T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a,T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
	int a, b, c, d, k;
	cin >> a >> b >> c >> d >> k;
	int h = c - a;
	if (b > d) { d += 60; h--; }
	int m = d - b;
	m += 60 * h;
	
	int ans = m - k;
	cout << ans << '\n';
}

Measured memory_bytes: 3636
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func Scan() string {
	sc.Scan()
	return sc.Text()
}

func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}

func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	x := iSScan(3)
	k := iScan()
	ans := max(x)
	for i := 0; i < k; i++ {
		ans *= 2
	}
	fmt.Println(ans + sum(x) - max(x))
}


Measured memory_bytes: 1772
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(m);(i)<(n);++(i))
#define rrep(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr ll INF = (ll)1e9;
constexpr ll mod = (ll)1e9 + 7;
constexpr double PI = 3.1415926535897932;
template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

struct mint {
    ll x; // typedef long long ll;
    mint(ll x = 0) :x((x% mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

int main() {
	init();

    int N; cin >> N;
    vector<ll>vec(N);
    rep(i, 0, N)cin >> vec[i];
    int num[] = { 0,0,0 };
    mint ans = 1;
    rep(i, 0, N) {
        int a = -1, b=0;
        if (vec[i] == num[0]) {
            a = 0;
            b++;
        }
        if (vec[i] == num[1]) {
            a = 1;
            b++;
        }
        if (vec[i] == num[2]) {
            a = 2;
            b++;
        }
        num[a]++;
        ans *= b;
    }
    cout << ans.x << "\n";

	return 0;
}

Measured memory_bytes: 3992
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define mk make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll,ll>
#define vvll vector< vector<ll> >
#define pb push_back
#define inf 1e16
#define M 1000000007
#define all(v) (v).begin(),(v).end()
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
#define mx 1000010

int main(){
	IOS;
	ll n;cin>>n;
	ll v[n],c[n];
	rep(i,0,n)cin>>v[i];
	rep(i,0,n)cin>>c[i];
	ll ans=0;
	rep(i,0,n){
		if(v[i]>c[i])ans+=(v[i]-c[i]);
	}
	cout<<ans;
	return 0;
}



Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {
    static MyReader in = new MyReader();

    public static void main(String[] args) {
        int mod = 1_000_000_007;

        int N = in.i();
        long K = in.i();
        int[] A = in.ii(N);

        int[] l = new int[N];
        int[] r = new int[N];

        long ans = 0;
        for (int i = 0; i < N; i++) {
            int ai = A[i];
            for (int j = 0; j < i; j++) {
                if (A[j] < ai) {
                    l[i]++;
                }
            }
            for (int j = i + 1; j < N; j++) {
                if (A[j] < ai) {
                    r[i]++;
                }
            }
            ans = (ans + r[i] * K % mod + K * (K - 1) / 2 % mod * (l[i] + r[i]) % mod) % mod;
        }

        System.out.println(ans);
    }
}

class MyReader extends BufferedReader {
    char[] cbuf = new char[1024];
    int head = 0;
    int tail = 0;

    MyReader() {
        super(new InputStreamReader(System.in));
    }

    char next() {
        if (head == tail) {
            try {
                tail = super.read(cbuf, 0, cbuf.length);
            } catch (IOException e) {
                e.printStackTrace();
            }
            head = 0;
        }
        return cbuf[head++];
    }

    int i() {
        int k = next() - '0';
        boolean minus = k == -3;
        int n = minus ? 0 : k;
        while (0 <= (k = next() - '0') && k <= 9) n = 10 * n + k;
        return minus ? -n : n;
    }

    int[] ii(final int N) {
        int[] a = new int[N];
        for (int j = 0; j < a.length; j++) a[j] = i();
        return a;
    }

    long l() {
        int k = next() - '0';
        boolean minus = k == -3;
        long n = minus ? 0 : k;
        while (0 <= (k = next() - '0') && k <= 9) n = 10 * n + k;
        return minus ? -n : n;
    }

    char[] s(final int N) {
        char[] s = new char[N];
        for (int i = 0; i < N; i++) {
            s[i] = next();
        }
        next();
        return s;
    }

    public int read(char[] cbuf) {
        int i;
        char c;
        for (i = 0; (c = next()) != ' ' && c != '\n'; i++) cbuf[i] = c;
        return i;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }
}


Measured memory_bytes: 33492
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<'\n'

int main(){
    int r;
    cin >> r;
    COUT(2*r*M_PI);
    return 0;
}


Measured memory_bytes: 3788
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

N = I()
A = LI()

As = [[i + 1, a] for i, a in enumerate(A)]
As.sort(key=lambda x : x[1])

for a in As:
    print(a[0], end=" ")

print()

Measured memory_bytes: 73268