akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

#define eb emplace_back
#define ii pair<int, int>
#define OK (cerr << "OK" << endl)
#define debug(x) cerr << #x " = " << (x) << endl
#define ff first
#define ss second
#define int long long
#define tt tuple<int, int, int>
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vii vector<pair<int, int>>
#define vvi vector<vector<int>>
#define vvii vector<vector<pair<int, int>>>
#define Mat(n, m, v) vector<vector<int>>(n, vector<int>(m, v))
#define endl '\n'

constexpr int INF = 2e18;
constexpr int MOD = 1e9 + 7;
constexpr int MAXN = 2e5 + 3;

// #define MULTIPLE_TEST_CASES
void solve() {
  vector<int> va(2), vb(2);
  for (int &x : va)
    cin >> x;
  for (int &x : vb)
    cin >> x;

  int ans = -INF;
  for (int i = 0; i < 2; ++i)
    for (int j = 0; j < 2; ++j)
      ans = max(ans, va[i] * vb[j]);
  cout << ans << endl;
}

signed main() {
  // freopen(".in", "r", stdin);
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);

  int t = 1;
#ifdef MULTIPLE_TEST_CASES
  cin >> t;
#endif
  while (t--)
    solve();
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#include <string>
#include <algorithm>
#include <string.h>
#include <ctype.h>
#include <math.h>
using namespace std;
 
int main(){
    
    int N,M,C,B[20]={},tmp,A,ans=0;

    cin >>N>>M>>C;

    for(int i=0;i<M;i++){
        cin >> B[i];
    }

    for(int j=1;j<=N;j++){
        tmp=0;
        for(int k=0;k<M;k++){
            cin >> A;
            tmp += A * B[k];
        }
        if((tmp+C)>0){
            ans +=1;
        }
    }

    cout << ans;
    
    return 0;

}

Measured memory_bytes: 256
#define pb push_back
#define ll long long
#define maxn 30000000
#include <bits/stdc++.h>
using namespace std;

int arr[1000006], dp[1000006], n;

int rec(int pos){
    if(dp[pos] != -1) return dp[pos];
    if(pos == n) return 0;
    int res = INT_MAX;
    if(pos+2 <= n){
        res = min(res, abs(arr[pos] - arr[pos+2]) + rec(pos+2) );
    }
    if(pos+1 <= n){
        res = min(res, abs(arr[pos] - arr[pos+1]) + rec(pos+1) );
    }
    return dp[pos] = res;

}


int main() {
    memset(dp, -1, sizeof dp);
    cin >> n;
    for(int i=1;i<=n;i++){
        cin >> arr[i];
    }
    cout << rec(1) << endl;


    return 0;
}


Measured memory_bytes: 8704
#!/usr/bin/env python3


def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    ans = sum(A)
    for i in range(0,N-1,2):
        # print(i)
        tmp = ans - 2*(A[i]+A[i+1])
        if tmp > ans:
            ans = tmp
    print(ans)

if __name__ == "__main__":
    main()


Measured memory_bytes: 14284
#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define fore(i, b, e) for (int i = (int)(b); i <= (int)(e); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long i64;
typedef unsigned long long u64;
typedef long double ld;
typedef long long ll;

const int maxn = 20050;
int n;
int p[maxn];
int a[maxn], b[maxn];

int main() {
#ifdef LOCAL
    freopen("b.in", "r", stdin);
#endif

    cin >> n;
    forn(i, n) cin >> p[i], --p[i];
    forn(i, n) a[i] = (i+1)*maxn;
    forn(i, n) {
        b[p[i]] = a[p[i]] - i - 1;
    }
    forn(i, n) b[i] = 1e9-100-b[i];
    forn(i, n) cout << a[i] << " "; cout << endl;
    forn(i, n) cout << b[i] << " "; cout << endl;

#ifdef LOCAL
    cerr << "Time elapsed: " << clock() / 1000 << " ms" << endl;
#endif
    return 0;
}


Measured memory_bytes: 896
s = input()
sl = len(s)
N = int(s)
if sl == 1:
    print(N)
elif sl == 2:
    print(9)
elif sl == 3:
    g = 9
    g += (N-100)+1
    print(g)
elif sl == 4:
    print(909)
elif sl == 5:
    g = 909
    g += N-10000+1
    print(g)
elif sl == 6:
    print(90909)

Measured memory_bytes: 3060
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int year = sc.nextInt();
            int month = sc.nextInt();
            int day = sc.nextInt();
            if(year < 1868 || (year == 1868 && month <= 8) || (year == 1868 && month == 9 && day < 8)){
                System.out.println("pre-meiji");
            }else if(year < 1912 || (year == 1912 && month < 7) || (year == 1912 && month == 7 && day <= 29)){
                System.out.println("meiji " + (year - 1867) + " "+ month + " " +  day);
            }else if(year < 1926 || (year == 1926 && month < 12) || (year == 1926 && month == 12 && day <= 24)){
                System.out.println("taisho " + (year - 1911) + " "+ month + " " +  day);
            }else if(year < 1989 || (year == 1989 && month == 1 && day <= 7)){
                System.out.println("showa " + (year - 1925) + " "+ month + " " +  day);    
            }else{
                System.out.println("heisei " + (year - 1988) + " "+ month + " " +  day); 
            }
        }
    }
}


Measured memory_bytes: 26052
#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>

#include<queue>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
 
#define INF (1e9)
typedef long long unsigned int ll;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
 

template<typename T>
int vector_finder(std::vector<T> vec, T number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

int gcd(int a,int b){
	if(b>0){
		return gcd(b, a % b);
	}else{
		return a;
	}
}

int N;

int main()
{
	ll X, Y;
	cin >> X >> Y;
	ll count = 0;

	while(X<=Y){
		X *= 2;
		count++;
	}

	cout << count << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<cmath>
#define N 100005
#define A 1000005
#define MOD 998244353 //1000000007 // //100000000
#define inf 1000000000000000000
#define ll long long
//#define M_PI 3.141592653589793238463

using namespace std;

#define pii pair<ll, ll>
#define piii pair<ll, pii>
#define ft first
#define sd second
#define pb push_back
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n-1; i >= 0; i--)
#define itr(it, x) for(auto it = x.begin(); it != x.end(); it++)
#define mem(a, b) memset(a, (ll)b, sizeof(a))
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define edge(v, x, y) v[x].pb(y); v[y].pb(x);
#define popcount __builtin_popcount
#define ANS(s) {cout << s << "\n"; return;}

//~~~~~~fancy print~~~~~~~//
#define printpii(a) cout << a.ft << " " << a.sd << endl;
#define printpiii(a) cout << a.ft << " " << a.sd.ft << " " << a.sd.sd << endl;
#define print(a, n) rep(i, n) cout << a[i] << " "; cout << endl;
#define printv(v) for(auto x: v)cout << x << " "; cout << endl;
#define printm(a, n, m) rep(i, n) { rep(j, m) cout << a[i][j] << "\t"; cout << endl;}

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

void fast(){ios_base::sync_with_stdio(false);cin.tie(0);cout << setprecision(12) << fixed;}


void solve(){
    ll n, k;
    cin >> n >> k;
    ll a[n];
    rep(i, n) cin >> a[i];
    sort(a, a+n);
    ll ans = inf;
    rep(i, n-k+1)
    {
        ans = min(ans, a[i+k-1] - a[i]);
    }
    cout << ans;
}
main(){
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif*/
    fast();
    ll t = 1; //cin >> t;
    while(t--){
        solve();
    }
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
/*#ifndef LOCAL_RUN
    #pragma GCC optimize("Ofast")
    #pragma GCC optimize("unroll-loops")
    #pragma GCC optimize("fast-math")
    #pragma GCC target("avx2,tune=native")
#endif*/
#define X first
#define Y second
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

int main()
{
    #ifdef LOCAL_RUN
        freopen("input.txt", "r", stdin);
    //#else
        //freopen("cowcode.in", "r", stdin);
        //freopen("cowcode.out", "w", stdout);
    #endif
	ios::sync_with_stdio(false);
    cin.tie(0);

    string s, t;
    cin >> s >> t;
    int n = s.size(), m = t.size(),
        ans = m;
    for (int i = 0; i <= n - m; i++) {
        int x = 0;
        for (int j = 0; j < m; j++)
            x += int(s[i+j] != t[j]);
        ans = min(ans, x);
    }
    cout << ans;

    return 0;
}

// 272472LF


Measured memory_bytes: 3636
S = input()

former = int(S[:2])
latter = int(S[2:])

if((former >= 13 or former == 0) and 1 <= latter <= 12):
    print("YYMM")
if((latter >= 13 or latter == 0) and 1 <= former <= 12):
    print("MMYY")
if(1 <= former <= 12 and 1 <= latter <= 12):
    print("AMBIGUOUS")
if((former >= 13 or former == 0) and (latter >= 13 or latter == 0)):
    print("NA")

Measured memory_bytes: 9084
//In The Name Of GOD

#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
const ll mod = 1000000007;
const ll inf = 2000000000;
const ll infll = (ll)2*1000*1000*1000*1000*1000*1000;
const ll maxn = 20;
#define pb push_back
#define pp pop_back
#define IO ios_base::sync_with_stdio(false);

int main(){
  IO;
  ll x,y,z;
  cin>>x>>y;
  if(x%y==0){
    cout<<-1;
  }else if(2*x%y==0){
    cout<<3*x;
  }else{
    cout<<2*x;
  }
}


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

int main()
{
    int x;
    cin >> x;
    int b,f,r,v;
    int rooms[10][10][10];
    for(int i=0; i<4; i++){
        for(int j=0; j<3; j++){
            for(int h=0; h<10; h++)
                rooms[i][j][h]=0;
        }
    }
    for(int e=0; e<x; e++){
        cin >> b >> f >> r >> v;
        rooms[b-1][f-1][r-1] += v;
    }
    for(int a=0; a<4; a++){
        for(int b=0; b<3; b++){
            for(int c=0; c<10; c++){
                if(rooms[a][b][c]!=0)
                    cout << ' '<< rooms[a][b][c];
                else
                    cout << ' ' << '0';
                }
            cout << endl;
            }
    if(a != 3) cout << "####################" << endl;
    }
    
    return 0;
}

Measured memory_bytes: 3088
def cost(a, b):
    c = 0
    for ai in a:
        c += (ai-b)**2
    return c

def findcmin(a):
    cmin = cost(a, max(a))
    for b in range(min(a), max(a)):
        if cost(a, b) < cmin:
            cmin = cost(a, b)
    return cmin

n = input()
a = [int(i) for i in input().split()]
print(findcmin(a))

Measured memory_bytes: 3060
//#include <bits/stdc++.h>
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> VI;
typedef vector<VI> VVI;//例: VVI dp(10, vector<int>(10, INF);
typedef priority_queue<int, vector<int>, less<int> > QUE_int;
const int INF = 2 * pow(10, 9) + 1;//+1しないとREになるかも(out of rangeになるんかな?? )

vector<int> dx = { -1, 0, 1, 0, -1, -1, 1, 1 };
vector<int> dy = { 0, -1, 0, 1, -1, 1, -1, 1 };

ll max(ll a, ll b) { return (a > b) ? a : b; }
ll min(ll a, ll b) { return (a < b) ? a : b; }

////////////////////////////////////////////////////////////////

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = pow(10, 9) + 7;
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;
	}
};
// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
	vector<mint> fact, ifact;
	combination(int n) :fact(n + 1), ifact(n + 1) {
		assert(n < mod);
		fact[0] = 1;
		for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
		ifact[n] = fact[n].inv();
		for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
	}
	mint operator()(int n, int k) {
		if (k < 0 || k > n) return 0;
		return fact[n] * ifact[k] * ifact[n - k];
	}
};



template <typename TYPE>
void print_vec(const vector<TYPE>& v){
	for(int i=0; i<v.size(); i++){
		cout << v[i] << " ";
	}
	cout << endl;
}

vector<ll> enum_divisor(ll x){
	ll tmp = x;
	vector<ll> res;
	for(ll i=1; i*i<=x; i++){
		if(tmp%i == 0){
			res.push_back(i);
			if(i*i != tmp) res.push_back(tmp/i);//iが√tmpのときは重複して数えないようにする
		} 
	}
	return res;
}

////////////////////////////////////////////////////////////////
#define PI 3.14159265359
int main(void) {
	
	double R;
	cin >> R;
	
	double ans = 2 * PI * R;
  	cout << fixed;//小数点を確実に8桁で表示するためのもの
  	cout << setprecision(8) <<ans << endl; 


}



Measured memory_bytes: 3764
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define rep(i,x,n) for(int i=x;i<n;i++)
int main(){
  int n;
  cin>>n;
  ll a[n];
  for(int i=0;i<n;i++) cin>>a[i];
  sort(a,a+n);
  ll cnt=0;
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
    	for(int k=j+1;k<n;k++){
        	//cout<<a[i]<<" ";
          if(a[i]!=a[j] && a[j]!=a[k] && a[i]!=a[k]){
            	if(a[k]<a[i]+a[j]) cnt++;
            //cout<<a[i]<<" " <<a[j]<<" "<<a[k]<<" \n";
            }
        }
    }
  }
  cout<<cnt<<endl;
 // rep(i,0,n) cout<<a[i]<<" ";
  return 0;
}

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

string S;
string ans;

bool appear[26];

int main() { 
	cin >> S;

	for (int i = 0; i < S.length(); i++) {
		if (appear[S[i] - 'a'] == true) {
			ans = S.substr(0, i);
			break;
		}
		else {
			appear[S[i] - 'a'] = true;
			if (i == S.length() - 1) {
				ans = S;
			}
		}
	}

	for (int i = 0; i < 26; i++) {
		if (appear[i] == false) {
			cout << ans << (char)(i + 'a') << endl;
			return 0;
		}
	}

	while(1){
		int i = ans.length() - 1;
		if (i < 0) {
			break;
		}

		while (1) {
			if (ans[i] != 'z') {
				ans[i]=(char)(ans[i]+1);
				if (appear[ans[i] - 'a'] == false) {
					std::cout << ans << endl;
					return 0;
				}
			}
			else {
				string tmp = ans.substr(0, ans.length() - 1);
				appear[S[ans.length()-1]-'a'] = false;
				ans = tmp;
				break;
			}
		}
		i--;
	}

	std::cout << -1 << endl;
	return 0;
}

Measured memory_bytes: 256
s = {}
t = {}
ans = 0
for i in range(int(input())):
    key = input()
    try:
        s[key] += 1
    except:
        s[key] = 1
for i in range(int(input())):
    key = input()
    try:
        t[key] += 1
    except:
        t[key] = 1
for key in s.keys():
    snum = s[key]
    tnum = 0
    try:
        tnum = t[key]
    except:
        pass
    ans = max(ans, snum - tnum)

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, e) for (int i = (int)(s); i <= (int)(e); i++)
#define printYesNo(is_ok) puts(is_ok ? "Yes" : "No");
#define SORT(v) sort(v.begin(), v.end());
#define RSORT(v) sort(v.rbegin(), v.rend());
#define REVERSE(v) reverse(v.begin(), v.end());

template <typename T>
void printlnVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << endl;
  }
}

template <typename T>
void printVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << " ";
  }
  cout << endl;
}

int main()
{
  int q;
  cin >> q;
  rep(Q, q)
  {
    string X, Y;
    cin >> X >> Y;
    vector<vector<int> > dp(X.size(), vector<int>(Y.size()));
    if(X[0]  == Y[0])
      dp[0][0]++;

    rep(i, X.size() - 1)
    {
      if(X[i + 1] == Y[0])
        dp[i + 1][0]++;
      dp[i + 1][0] = max(dp[i + 1][0], dp[i][0]);
    }

    rep(i, Y.size() - 1)
    {
      if(X[0] == Y[i + 1])
        dp[0][i + 1]++;
      dp[0][i + 1] = max(dp[0][i + 1], dp[0][i]);
    }

    rep(i, X.size() - 1) rep(j, Y.size() - 1)
    {
      if(X[i + 1] == Y[j + 1])
        dp[i + 1][j + 1] = dp[i][j] + 1;
      else
        dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1]);
    }

    cout << dp[X.size() - 1][Y.size() - 1] << endl;
  }
  return 0;
}


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

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifndef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

int main() {
	long long a, b, c, d;
	cin >> a >> b >> c >> d;
	--a;
	long long fromOneToB = b - (b / c) - (b / d) + (b / lcm(c, d));
	long long fromOneToA = a - (a / c) - (a / d) + (a / lcm(c, d));
	debug() << imie(fromOneToB) imie(fromOneToA);
	cout << fromOneToB - fromOneToA << "\n";
}


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

using System.Collections;

class Program
{
    static void Main()
    {
        var s = int.Parse(Console.ReadLine());

        int[] a = new int[1000000];
        a[0] = s;

        var set = new HashSet<int>();
        set.Add(s);

        for(int i = 1; i < a.Length; i++)
        {
            var next = f(a[i - 1]);

            if(set.Contains(next))
            {
                Console.WriteLine(i + 1);
                return;
            }
            set.Add(next);
            a[i] = next;
        }
    }

    static int f(int n)
    {
        if (n % 2 == 0)
        {
            return n / 2;
        }
        else
        {
            return 3 * n + 1;
        }
    }
    
}

Measured memory_bytes: 13280
#include<iostream>
using namespace std;
int main()
{
  int r,g,b;
  cin>>r>>g>>b;
  int i=100*r+10*g+b;
  if(i%4==0)
    {
      cout<<"YES"<<endl;
    }else{
    cout<<"NO"<<endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <complex>
#include <vector>
#include<limits>
#include<iomanip>
#include<cassert>

using namespace std;

typedef long long ll;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;

#define debug(x) cout << #x << " = " << (x) << endl;
#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n-1;i >= 0;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second

const long double pi = 3.141592653589793;
const int mod = 1e9 + 7;

int main() {

 // freopen("input.in","r",stdin);
 // freopen("output.out","w",stdout);

 ios_base::sync_with_stdio(false);
 cin.tie(NULL);

 int D, CT = 26;
 cin >> D;
 vector<int> C(CT);
 vector<vector<int>> S(D, vector<int>(CT));
 rep(i, CT) cin>>C[i];
 rep(i, D) rep(j, CT) cin>>S[i][j];

 vector<int> A(26, -1);
 for(int i = 0;i < D;i++) {
   int maxm = INT_MIN, in = -1;
   for(int j = 0;j < CT;j++) {
     int temp = A[j];
     A[j] = i;
     int tmax = S[i][j];
     for(int k = 0;k < 26;k++) {
       tmax -= C[k]*(i-A[k]);
     }
     if(tmax > maxm) {maxm = tmax;in=j;}
     A[j] = temp;
   }
   A[in] = i;
   cout << in +1 << endl;
 }


 return 0;
}


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

int main() {
    int N,K,Q;
    cin>>N>>K>>Q;
    vector<int> a(Q);
    vector<int> point(N,K-Q);

    rep(i,Q){
        cin>>a[i];
        point[a[i]-1]++;
    }

    rep(i,N){
        //cout<<point[i];
        if(point[i]>0) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    

}


Measured memory_bytes: 1408
ps = dict()
ss = []
n = int(input())
for _ in range(n):
    s = input()
    ss.append(s)
    if s in ps:
        ps[s] += 1
    else:
        ps[s] = 1
ts = []
m = int(input())
for _ in range(m):
    s = input()
    ts.append(s)
    if s in ps:
        ps[s] -= 1
    else:
        ps[s] = 1
ans = max(0, max(ps.values()))
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int>t(n+1),x(n+1),y(n+1);

  t[0]=0,x[0]=0,y[0]=0;
  for (int i = 1; i <= n; i++) cin >> t[i] >> x[i] >> y[i];

  for (int i = 0; i < n; i++)
  {
    int dt=t[i+1]-t[i];
    int dxy=abs(x[i+1]-x[i]+y[i+1]-y[i]);
    if(dt<dxy || dt%2!=dxy%2){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}

Measured memory_bytes: 1408
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/



int main() {
	
	int n;
	scanf("%d", &n);
	int bef, tmp, ans = 0;
	scanf("%d", &bef);
	rep(i, n - 1) {
		scanf("%d", &tmp);
		ans += (bef < tmp);
		bef = tmp;
	}
	printf("%d\n", ans);

	Please AC;
}


Measured memory_bytes: 3208
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(int i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
#define pb push_back
using namespace std;
using ll=long long;
using ld=long double;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
struct edge{ll to,cost;};
struct edge2{ll from,to,cost;};

template <typename T>
bool chmax(T &a, const T& b) {
    if (a < b) {
      a = b;
        return true;
    }
    return false;
}

template <typename T>
bool chmin(T &a, const T& b) {
    if (a > b) {
      a = b;
      return true;
    }
    return false;
}
const int MXN=100001;

//ダブリングを用いる
ll doubling[21][100000];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N,L,Q;
    cin >> N;
    vl X(N);
    rep(i,N){
        cin >> X[i];
    }
    rep(i,21){
        rep(j,100000){
            doubling[i][j]=0;
        }
    }
    cin >> L >> Q;
    X.pb(INF);
    rep(i,N){
        auto itr=upper_bound(X.begin(),X.end(),X[i]+L);
        itr--;
        doubling[0][i]=itr-X.begin();
    }
    rep(i,20){
        rep(j,N){
            doubling[i+1][j]=doubling[i][doubling[i][j]];
        }
    }
    rep(i,Q){
        int a,b;
        cin >> a >> b;
        a--;b--;
        if(a>b){
            swap(a,b);
        }
        ll ans=0;
        per(i,20){
            if(doubling[i][a]<b){
                ans+=(ll)pow(2,i);
              	a=doubling[i][a];
            }
        }
        cout << ans+1 << endl;
    }
}
/*
overflow checked?
corner case checked?
boundary checked?
not TLE in worst case checked?
*/


Measured memory_bytes: 21172
import java.util.*;
import java.io.*;
 
public class Main{
	public static void main(String[] args){
      	Scanner sc = new Scanner(System.in);
    	int n = Integer.parseInt(sc.next());
      	int k = Integer.parseInt(sc.next());
      	PrintWriter out = new PrintWriter(System.out);
      	ArrayList<Integer> list = new ArrayList<>();
      	for(int cnt = 0;cnt < n;cnt++){
        	list.add(Integer.parseInt(sc.next()));
        }
      	for(int cnt = k;cnt < n;cnt++){
        	if(list.get(cnt - k) < list.get(cnt)){
            	out.println("Yes");
            }else{
            	out.println("No");
            }
        }
      	out.flush();
    }
}

Measured memory_bytes: 64616
#include<stdio.h>
int main()
{
	int i,t,t1,t2,t3,t4,n;
	for(i=0;i<4;i++){
		scanf("%d %d",&t,&n);
		if(t==1){
		t1=6000*n;
		printf("%d\n",t1);
		}
		else if(t==2){
		t2=4000*n;
		printf("%d\n",t2);
		}
		else if(t==3){
		t3=3000*n;
		printf("%d\n",t3);
		}
		else if(t==4){
		t4=2000*n;
		printf("%d\n",t4);
		}
	}

	return 0;
}


Measured memory_bytes: 2112
#include <bits/stdc++.h>
#define BIT(n) (1LL << (n))
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPB(i, n) for (int i = 0; i < BIT(n); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORA(i, n) for (auto &&i : n)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define DEBUG(x) cerr << #x <<": "<<x<<"\n"
#define ALL(v) v.begin(), v.end()
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define epb emplace_back
#define int long long
using namespace std;
template <class T> using vec = std::vector<T>;
template <class T = int> T in(){T x; cin>>x;return(x);}
template <class T > void print(T& x){cout<<x<<"\n";}
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
//差が-1であるが連続していない。
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
    string S;
    cin >> S;
    int N = S.size();
    vec <int>a;
    vec <int>b;
    int tmpN=-1;
    int counter=0;
    vec<bool>flg(N,false);
    //b.pb(0);
    REP(i,N-1){
        if (S[i]!=S[i+1] ){
            a.pb(i-tmpN);
            if (counter%2==0){
                b.pb(i);
                flg[i]=true;
            }
            counter++;
            tmpN=i;
        }
    }
    a.pb(N-1-tmpN);
    //b.pb(N-1);
    /*REP(i,(int)a.size()){
        cout <<a[i]<<endl;
    }
    cout <<endl;
    REP(i,(int)b.size()){
        cout <<b[i]<<endl;
    } */
    counter=0;
  //  cout<<endl;
    REP(i,N){
        if (i==b[counter]){
            int sumR=ceil((a[2*counter]+1)/2)+a[2*counter+1]/2;
            int sumL=a[2*counter]/2+ceil((a[2*counter+1]+1)/2);
            cout <<sumR <<" ";
            i++;
            cout<<sumL<<" ";
            counter++;
            continue;
        } 
        cout << 0 << " ";
//        if (i==a)
    }
    cout<<endl;

}

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

int main() {
  int A,B;
  char C;
  cin >> A >> C >> B;
  
  if(C == '+'){
    cout << A + B << endl;
  }
  else if(C == '-'){
    cout << A - B << endl;
  }
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second
 
const int mx=200010;
const ll mod=1e9+7;


int main(){
  int n;
  cin >> n;
  ld m=0;
  rep(i,n){
    ld x; string u; cin>>x>>u;
    if(u=="JPY"){ m+=x;} else { m+=x*380000; }
  }

  cout << fixed << setprecision(10) << m << endl; 
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);++i)
#define rrep(i,n) for(ll i=(n)-1;i>=0;--i)
#define rep1(i,n) for(ll i=1;i<=(n);++i)
#define rrep1(i,n) for(ll i=(n);i>=1;--i)
#define fr first
#define sc second
#define pb push_back
#define INF 0xfffffff
typedef long long ll;
typedef pair<ll,ll> P;
typedef double db;
struct edge{ll to,cap,rev; }; // ????????????????????????

vector<edge> G[100];
vector<edge> rG[100];
ll d[100];
ll a[100];
ll cnt=0;
void add_edge(ll from,ll to,ll cap){
	G[from].pb((edge){to, cap, rG[to].size() });
	rG[to].pb((edge){from, 0, G[from].size()-1} );
}

ll calc(ll t){
	ll res = 0;
	rep(i,rG[t].size()){
		res+=rG[t][i].cap;
	}
	return res;
}

ll max_flow(ll V,ll E,ll s,ll t){
	ll res=0;
	memset( d, 0, sizeof(d) );
	memset( a, 0, sizeof(a) );
	d[s] = V;
	a[s]=-1;
	a[t]=-1;
	rep(i,G[s].size()){
		if(G[s][i].to!=t){
			edge &e = G[s][i];
			a[e.to] += e.cap;
			rG[e.to][e.rev].cap = e.cap;
			e.cap = 0;
		}
		else{
			res+=G[s][i].cap;
		}
	}

	for(;;){
		ll v = -1;  //1
		rep(i,V){
			if( a[i]>0 ){
				v = i;
				break;
			}
		}
		if(v < 0) return res+calc(t);
		ll J=0; //2
		ll id;
		rep(i,G[v].size()){
			if( G[v][i].cap>0 && d[v] - d[G[v][i].to] == 1 ){
				id = i;
				J=1;
				break;
			}
		}
		if(!J) rep(i,rG[v].size()){
			if( rG[v][i].cap>0 && d[v] - d[rG[v][i].to] == 1 ){
				id = i;
				J=2;
				break;
			}
		}
	
		if(J){  //3
			edge &e = (J==1?G[v][id]:rG[v][id]);
			if(J==1){
				ll f = min(a[v], e.cap );
				a[v] -= f;
				e.cap -= f;
				rG[e.to][e.rev].cap += f;
				if(a[e.to]>=0) a[e.to] += f;
			}
			else{
				edge &efor = G[e.to][e.rev];
				ll f = min(a[v], e.cap);
				a[v] -= f;
				e.cap -= f;
				efor.cap += f;
				if(a[e.to]>=0) a[e.to] += f;
			}
		}

		else{  //4
			ll dmin=0xfffffff;
			rep(i,G[v].size()){
				if(G[v][i].cap>0) dmin = min(dmin,d[G[v][i].to]);
			}
			rep(i,rG[v].size()){
				if(rG[v][i].cap>0) dmin = min(dmin,d[rG[v][i].to]);
			}
			d[v] = dmin + 1;
		}
	}
}

ll V,E,A[1000],B[1000],C[1000];

void input(){
	scanf("%lld%lld",&V,&E);
	rep(i,E){
		scanf("%lld%lld%lld",&A[i],&B[i],&C[i]);
	}
}

int main()
{
	input();
	rep(i,V){
		G[i].clear(); rG[i].clear();
	}
	rep(i,E) add_edge(A[i], B[i], C[i]);
	cout<<max_flow(V,E,0,V-1)<<endl;
}

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

int main() {
  int N;
  cin >> N;
  
  vector<string> blueCard(N);
  
  for (int i = 0; i < N; i++) cin >> blueCard.at(i);

  int M;
  cin >> M;
  
  vector<string> redCard(M);
  for (int i = 0; i < M; i++) cin >> redCard.at(i);

  vector<int> total(N, 0);
  int answer = 0;

  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (blueCard.at(i) == blueCard.at(j)) total.at(i)++;
    }
    
    for (int j = 0; j < M; j++) {
      if (blueCard.at(i) == redCard.at(j)) total.at(i)--;
    }
    
    answer = max(answer, total.at(i));
  }
  
  if (answer < 0) answer = 0;
  
  cout << answer << endl;
}


Measured memory_bytes: 256
// 基本テンプレート
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

int d[500010], A[500010], B[500010];

signed main() {
    int N, D; scanf("%lld%lld", &N, &D);

    int pre = D;
    A[0] = D;
    for(int i=0; i<N; i++) {
        scanf("%lld", &d[i]);
        A[i+1] = min(A[i], abs(A[i] - d[i]));
    }

    B[N] = 1;
    for(int i=N-1; i>=0; i--) {
        if(d[i] / 2 >= B[i+1]) {
            B[i] = B[i+1];
        }
        else {
            B[i] = B[i+1] + d[i];
        }
    }

    int Q; scanf("%lld", &Q);
    for(int i=0; i<Q; i++) {
        int q; scanf("%lld", &q);  q--;
        if(A[q] != 0 and A[i] >= B[i+1]) puts("YES");
        else puts("NO");
    }
    return 0;
}


Measured memory_bytes: 13696
S = input()
ans_0 = 0
ans_1 = 0
check = "0"
for i in S:
    if i == check:
        ans_0 += 1
    else:
        ans_1 += 1
    
    if check == "0":
        check = "1"
    else:
        check = "0"
print(min(ans_0,ans_1))

Measured memory_bytes: 39536
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int d[] = new int[n];
		for(int i = 0; i < n; i++) {
			d[i] = sc.nextInt();
		}
		int ans = 0;
		
		for(int i = 0; i < n; i++) {
			for(int j = i + 1; j < n; j++) {
				ans += d[i] * d[j];
//				System.out.println(i + " " + j);
			}
		}
//		ans = ans / 2;
		
		System.out.println(ans);
	}
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define pi 3.141592653589793
using namespace std;


int ones(int e) {
    int ans = 0;
    while (e) {
        e &= (e - 1);
        ans++;
    }

    return ans;
}

void f() {
    int q;
    cin >> q;
    set<int> s;
    ll even = 0, odd = 0;
    int e;
    cin >> e;
    q--;
    int p = e;
    int on = ones(e);
    while (q--) {
        int e;
        cin >> e;


    }
}


int main() {
//    cout << setprecision(10);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);



    int n, a, b;
    cin >> n >> a >> b;
    cout << min(a * n, b);



}



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

int main() {
  int n;
  cin >> n;
  rep(i,n) {
    int x;
    cin >> x;
    if(x%2==0&&x%3!=0&&x%5!=0) {
      cout << "DENIED" << endl;
      return 0;
    }
  }

  cout << "APPROVED" << endl;
  return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<algorithm>

using namespace std;

bool prime[10000001];

int main() {
	for (int i = 3; i * i <= 10000000; i += 2) {
		if (!prime[i]) {
			for (int j = i * 2; j <= 10000000; j += i) {
				prime[j] = true;
			}
		}
	}
	int n;
	while (cin >> n, n) {
		for (;;n--) {
			if (!prime[n] && !prime[n - 2] && !prime[n - 6] && !prime[n - 8] && n % 2 != 0) {
				cout << n << endl;
				break;
			}
		}
	}
	return 0;
}

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

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    
    while (!((a <= b)&(b <= c))){
        if (a>b) {
            swap(a,b);
        }
        if (b>c) {
            swap(b,c);
        }
}
    cout << a << " " << b << " " << c << endl;
    return 0;
}




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

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int a, b;
  cin >> a >> b;
  if (abs(a - b) % 2 == 1) cout << "IMPOSSIBLE" << '\n';
  else {
    int foo = abs(a - b) / 2;
    cout << min(a, b) + foo << '\n';
  }
  return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;


public class D
{
	public static void Main()
	{
		string s = GetString();
		Console.WriteLine(
			(s.Length % 2 == 0) ^ (s[0] == s[s.Length - 1]) ? "Second" : "First");
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}

Measured memory_bytes: 13908
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define int long long
#define double long double
#define all(a) a.begin(), a.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

//ABC136
signed main(void){

    string s; cin >> s;
    int n = (int)s.size();
    vector<int> ans(n, 0);

    int e = 0, o = 0;
    rep(i, n){
        if(s[i] == 'L'){
            if(i % 2 == 0){
                ans[i] += e;
                ans[i - 1] += o;
            } else {
                ans[i] += o;
                ans[i - 1] += e;
            }
            e = o = 0;
        } else {
            if(i % 2 == 0)e++;
            else o++;
        }
    }

    e = o = 0;
    for(int i = n - 1; i >= 0; i--){
        if(s[i] == 'R'){
            if(i % 2 == 0){
                ans[i] += e;
                ans[i + 1] += o;
            } else {
                ans[i] += o;
                ans[i + 1] += e;
            }
            e = o = 0;
        } else {
            if(i % 2 == 0)e++;
            else o++;
        }
    }

    rep(i, n){
        if(i)cout << ' ';
        cout << ans[i];
    }
    cout << endl;

}

Measured memory_bytes: 1408
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<bitset>
using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define ROF(i,b,a) for (int i=(b);i>(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,n-1,-1)

typedef int i32;
typedef long long int i64;
typedef unsigned long long int ui64;
typedef float f32;
typedef double f64;
typedef long double f128;


int main(){
    int N;cin>>N;
    int ans;
    if(N%2==0){
        ans = N;
    }else{
        ans = 2*N;
    }
    cout << ans;
}





Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<stack>
#include<algorithm>

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,n) for(int i=1;i<=n;i++)

	vector<pair<int,int> > y;
int main(){
	while(1){
		int n,m,h,k;
		scanf("%d%d%d%d",&n,&m,&h,&k);
		if(n==0)break;
		
		int tt[1002];
		rep(i,n){
			scanf("%d",&tt[i]);
		}
		
		y.clear();
		rep(j,m){
			int a,b;
			scanf("%d%d",&a,&b);
			y.push_back(make_pair(b,a));
		}
		
		int num[1002];
		rep(i,1002)num[i]=i;
		
		sort(y.begin(),y.end());
		
		int hav[1002];
		rep(i,m){
			swap(num[y[i].second-1],num[y[i].second]);
		}
		
		rep(i,n){
			hav[num[i]]=tt[i];
		}
		
		rep(i,1002)num[i]=i;
		
		int maxi=0;
		rep(i,m){
			swap(num[y[i].second-1],num[y[i].second]);
			int a=num[y[i].second-1];
			int b=num[y[i].second];
			
			if(a>b)swap(a,b);
			
			if(a<k && k<=b){
				int val=hav[a]-hav[b];
				//if(val<0)val*=-1;
				maxi=max(maxi,val);
			}
		}
		
		int ans=0;
		rep(i,k){
			ans+=hav[i];
		}
		ans-=maxi;
		
		
		
		printf("%d\n",ans);
	}
}

Measured memory_bytes: 0
using System;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var set = new HashSet<int>();
        var i = 1;
        while (set.Add(n))
        {
            n = next(n);
            i++;
        }
        Console.WriteLine(i);
    }

    static int next(int n)
    {
        if (n % 2 == 0) return n / 2;
        else return 3 * n + 1;
    }
}


Measured memory_bytes: 13268
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>

using namespace std;

#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
static const ll maxLL = (ll) 1 << 62;
const ll MOD = 1000000007, INF = 1e18;

template<typename T1, typename T2>
bool pairCompare(const pair<T1, T2> &firstElof, const pair<T1, T2> &secondElof) {
    return firstElof.second > secondElof.second;
}

int mapMaxValue(std::map<ll, int> m) {
    int max = 0;
    for (std::map<ll, int>::iterator it = m.begin(); it != m.end(); it++) {
        if (max < it->second) max = it->second;
    }
    return max;
}

int main(void) {
    string s, t;
    cin >> s >> t;
    int cnt = 0;
    for (int i = 0; i < 3; ++i) {
        if (s[i] == t[i]) cnt++;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#![allow(unused_imports)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(deprecated)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;
use std::usize;

const MOD_10_9_7: u64 = 1_000_000_007;
const INF: i64 = 1_000_000_000_000;
const MIN_INF: i64 = -1_000_000_000_000;

/// FYI: https://github.com/vain0x/scan-bench
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn main() {
    let (h, w): (i64, i64) = read!(i64, i64);

    let mut ans = INF;
    for i in 1..(w + h - 1) {
        // i <= w - 1 のときは x = i のところで1つ目の区切りを入れる
        if i <= w - 1 {
            let first_s = i * h;

            // 2つ目の区切りは縦方向の中央に入れるか横方向の中央に入れるかの2通り
            // 横方向に区切りを入れる場合
            let second_s_h = (w - i) * (h / 2);
            let third_s_h = h * w - first_s - second_s_h;
            // 縦方向に区切りを入れる場合
            let second_s_v = h * ((w - i) / 2);
            let third_s_v = h * w - first_s - second_s_v;

            let s_diff_h =
                max(first_s, max(second_s_h, third_s_h)) - min(first_s, min(second_s_h, third_s_h));
            let s_diff_v =
                max(first_s, max(second_s_v, third_s_v)) - min(first_s, min(second_s_v, third_s_v));
            let s_diff = min(s_diff_h, s_diff_v);
            ans = if s_diff < ans { s_diff } else { ans };
        } else {
            // i >= w のときは y = i - w + 1 のところで1つ目の区切りを入れる
            let first_s = (i - w + 1) * w;

            // 2つ目の区切りは縦方向の中央に入れるか横方向の中央に入れるかの2通り
            // 横方向に区切りを入れる場合
            let second_s_h = w * ((h - i + w - 1) / 2);
            let third_s_h = h * w - first_s - second_s_h;
            // 縦方向に区切りを入れる場合
            let second_s_v = (h - i + w - 1) * (w / 2);
            let third_s_v = h * w - first_s - second_s_v;

            let s_diff_h =
                max(first_s, max(second_s_h, third_s_h)) - min(first_s, min(second_s_h, third_s_h));
            let s_diff_v =
                max(first_s, max(second_s_v, third_s_v)) - min(first_s, min(second_s_v, third_s_v));
            let s_diff = min(s_diff_h, s_diff_v);
            ans = if s_diff < ans { s_diff } else { ans };
        }
    }
    println!("{}", &ans);
}


Measured memory_bytes: 4352
using System;

class P
{
public static void Main()
{
            int x = 1;
            bool z = true;
            string answer = "a";
            while (z)
            {
                answer = Console.ReadLine();
                if (!(answer == "0"))
                {
                    Console.WriteLine("Case " + x.ToString() + ": " + answer);
                    x++;
                }
                else
                {
                    z = false;
                }
            }

}
}

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

int main() {
  char c;
  cin>>c;
  string result;
  
  if(c=='a' || c=='e' || c=='i' || c=='u'|| c=='o'){
  	 result="vowel";
  }
  else{
  	 result="consonant";
  }
  
  cout<<result<<endl;
}

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

int main()
{
    int s;
    cin >> s;
    int a[1000001]={s};
    int ans=0;
    bool flag=true;
    for(int i=1;flag;++i){
        if(a[i-1]%2==0) a[i] = a[i-1]/2;
        else a[i] = 3*a[i-1]+1;
        for(int j=0;j<i;++j)
            if(a[i]==a[j]){
                ans = i+1;
                flag =false;
                break;
            }
    }
    cout << ans << endl;
    return 0;
}

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

int n;
string c;

int main(void){
    cin >> n;
    cin >> c;
    int r = 0;
    for(int i = 0; i < n; i++){
        if(c[i] == 'R') r++;
    }
    int ans = 0;
    for(int i = 0; i < r; i++){
        if(c[i] == 'W') ans++;
    }
    cout << ans << endl;
    return 0;
}


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

#define rep(i, n) for (int i = 0; i < n;i++)

int main(){

    int a, b;
    string s, t, u;
    cin >> s >> t >> a >> b >> u;
    if(s==u)
        a--;
    else
        b--;
    cout << a <<" "<< b << endl;
}


Measured memory_bytes: 256