akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define P pair<ll,ll>
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

const ll mod=1e9+7;

ll com(ll a,ll b,ll c) {
  ll d=1, e = (b*c)%mod, m_ = mod-2;
  while(m_ != 0) {
    if (m_&1) d = (d*e)%mod;
    e = e*e%mod;
    m_ = m_ >> 1;
  }
  return (a*d)%mod;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,m,ans=1;cin>>n>>m;
  if(n>1) {
    map<ll,ll> mp;
    {
      for (ll i=2;i*i<=m;i++) {
        while (m % i == 0) {
          mp[i]++;
          m /= i;
        }
      }
      if (m != 1) mp[m] = 1;
    }
    ll mx=0;
    for(auto i:mp) mx=max(mx,i.second);
    lvector v(n+mx+10,1);
    for(ll i=1;i<=n+mx;++i) v[i]=(v[i-1]*i)%mod;
    for(auto i:mp) ans=(ans*com(v[i.second+n-1],v[n-1],v[i.second]))%mod;
  }
  print(ans%mod);
  return 0;
}


Measured memory_bytes: 1024
w,h,n = map(int,input().split())
W = [1]*w
H = [1]*h
for i in range(n):
    x,y,a = map(int,input().split())
    if a == 1:
        W[0:x] = [0]*(x)
    elif a == 2:
        W[x:] = [0]*(w)
    elif a == 3:
        H[0:y] = [0]*(y)
    else:
        H[y:] = [0]*(h)

print(sum(W)*sum(H))

Measured memory_bytes: 3064
import java.io.*;

public class Main{

    public static void main(String[] args) throws IOException{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String N_moji = br.readLine();
	int N = Integer.parseInt(N_moji);
	long i,j,count = 1;

	for(i = 2; i <= N; i++){
	    if(sosuu(i)){
		count = (count * (kazu(i, N)+1)) % ((long)Math.pow(10,9) + 7);
	    }
	}
	System.out.println(count);	
    }
	
    public static boolean sosuu(long i){
	long j,dame = 0;
	if(i == 1){
	    return false;
	}else{
	    for(j = 2; j < i; j++){
		if((i % j) == 0){
		    dame++;
		}
	    }
	    if(dame > 0){
		return false;
	    }else{
		return true;
	    }
	}
    }

    public static long kazu(long i, int N){
	long j,k,count = 0;
	for(j = 2; j <= N; j++){
	    k = j;
	    while(k % i == 0){
		count++;
		k /= i;
	    }
	}
	return count;
    }
}


Measured memory_bytes: 8272
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define M 100000
bool mark;

int main()
{
    ll x,y,z,n,m,a,i,j,k,l,sum=0;
    cin>>n;
    x=2;
    y=1;
    /*if(n==1)
    {
        cout<<x<<endl;
        return 0;
    }*/
    if(n==1)
    {
        cout<<y<<endl;
        return 0;
    }
    for(int i=2;i<=n;i++)
    {
       sum=x+y;
       x=y;
       y=sum;
    }
    cout<<sum<<endl;


    return 0;
}



Measured memory_bytes: 384
import java.util.*;
 
class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    for(int i=2;i>=0;i--){
      if(x/(int)(Math.pow(10,(double)i))==7){
         System.out.println("Yes");
         break;
      }
      if(i==0)
         System.out.println("No");
      x%=(int)(Math.pow(10,(double)i));
    }
  }
}

Measured memory_bytes: 35784
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		sc.close();
		
		int ans = 0;
		for(int i = 0;i <= A;++i) {
			for(int j = 0;j <= B;++j) {
				int res = X - (500*i + 100*j);
				if(res >= 0 && res / 50 <= C)
					ans++;
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 23764
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
#define ALL(X) X.begin(), X.end()
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef std::pair<LL,LL> PLL;//
typedef std::pair<int,int> PII;//
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)1e18+20;
const LD PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

int N;
vector< vector<LL> > dist,gra;

void f(int u,int v){
	if( gra[u][v] >= 0 ) return;
	
	bool flag = false;
	for(int k=0;k<N;++k){
		if( k == u || k == v ) continue;
		if( dist[u][k]+dist[k][v] == dist[u][v] ){
			flag = true;
			f(u,k);
			f(k,v);
		}
	}
	if( flag == false ){
		//中継で一致するものがないなら(u,v)辺がある
		gra[u][v] = dist[u][v];
		gra[v][u] = dist[v][u];
	}
}
void solve(){
	cin >> N;
	
	dist = vector< vector<LL> >(N,vector<LL>(N));
	LL temp;
	for(int i=0;i<N;++i){
		for(int j=0;j<N;++j){
			cin >> temp;
			dist[i][j] = temp;
		}
	}
	for(int k=0;k<N;++k){
		for(int i=0;i<N;++i){
			for(int j=0;j<N;++j){
				if( dist[i][k]+dist[k][j] < dist[i][j] ){
					cout << -1 << endl;
					//最短ではない
					return;
				}
			}
		}
	}
	
	gra = vector< vector<LL> >(N,vector<LL>(N,-1));
	
	for(int i=0;i<N;++i){
		for(int j=i;j<N;++j){
			if( i==j ){
				gra[i][j] = 0;
				continue;
			}
			bool flag = false;
			for(int k=0;k<N;++k){
				if( i==k || j==k) continue;
				if( dist[i][k]+dist[k][j] == dist[i][j] ){
					//中継の最短がある。
					flag = true;
					break;
				}
			}
			if( flag == false ){
				//(i,j)が最短で分割できない
				gra[i][j] = dist[i][j];
				gra[j][i] = dist[j][i];
			}
		}
	}

	LL ans = 0;
	for(int i=0;i<N;++i){
		for(int j=i;j<N;++j){
			LL res = gra[i][j];
			if( res > 0 ){
				ans += res;
			}
		}
	}
	cout << ans << endl;
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()

Measured memory_bytes: 1664
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
signed main(){
    int N; cin >> N;
    int M; cin >> M;
    priority_queue<int,vector<int>>que;
    for(int i = 0; i < N; ++i){
        int t; cin >> t;
        que.push(t);
    }
    while(M--){
        auto top = que.top();
        que.pop(); top /= 2;
        que.push(top);
    }
    int sum = 0;
    while(not que.empty()) sum += que.top(), que.pop();
    cout << sum << endl;
}


Measured memory_bytes: 1400
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b;
  cin >> a >> b;
  int n = a*b;
  int n1 = n/2 * 2;
  if(n == n1){
  	cout << "Even" << endl;
  }else{
  	cout << "Odd" << endl;
  }
}

Measured memory_bytes: 256
# coding: utf-8

import sys
import math
import collections
import itertools
import bisect
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def lcm(x, y) : return (x * y) // math.gcd(x, y)
def I() : return int(input())
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 LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")
def YesNo(B) : print("Yes" if B else "No")
def YESNO(B) : print("YES" if B else "NO")

N = I()
A = LI()
B = LI()
C = LI()

A.sort()
C.sort()

ans = 0
for b in B:
    a = bisect.bisect_left(A, b)
    c = bisect.bisect_right(C, b)

    ans += a * (N - c)

print(ans)


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

int main(void){
    int n = 0;
    char s[101];
    int ans = 0;
    int cnt = 0;

    scanf("%d%s", &n, s);

    for(int i = 1; i < n; i++){
        for(char j = 'a'; j <= 'z'; j++){
            int a_absent = 0, b_absent = 0;
            //前半文字列の中にあるか
            for(int k = 0; k < i; k++){
                if(s[k] == j){
                    a_absent = 1;
                    break;
                }
            }
            //後半文字列の中にあるか
            for(int k = i; k < n; k++){
                if(s[k] == j){
                    b_absent = 1;
                    break;
                }
            }

            if(a_absent == 1 && b_absent == 1){
                cnt++;
            }

        }
        if(ans < cnt){
            ans = cnt;
        }
        cnt = 0;
    }


    printf("%d\n", ans);

    return 0;

} 


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <iomanip>
#include <algorithm>

using namespace std;

#define rep(countName, left, right) for (int countName = left; countName < right; countName++)

/* ****************************** ユークリッド互除法 ****************************** */
long long GCD(long long a, long long b)
{
    if (a % b == 0)
    {
        return b;
    }
    else
    {
        return GCD(b, a % b);
    }
}
/* ****************************** ユークリッド互除法 ****************************** */

/* ****************************** 累積和 ****************************** */
vector<long long> CUSUM(vector<long long> &&v)
{
    int n = v.size();
    vector<long long> cusum(n);
    cusum[0] = v[0];
    rep(i, 1, n)
    {
        cusum[i] = v[i] + cusum[i - 1];
    }
    return cusum;
}

//部分和

long long partSum(vector<long long> &&v, long long left, long long right)
{
    return (v[right] - v[left]);
}

/* ****************************** 累積和 ****************************** */

/* ****************************** 二項係数 ****************************** */
//http://drken1215.hatenablog.com/entry/2018/06/08/210000

const int MAX = 800000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit()
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k)
{
    if (n < k)
    {
        return 0;
    }
    if (n < 0 || k < 0)
    {
        return 0;
    }

    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

/* ****************************** 二項係数 ****************************** */

int main(void)
{

    int x, a;
    cin >> x >> a;
    if (x >= a)
    {
        cout << 10 << endl;
    }
    else
    {
        cout << 0 << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#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 ans[1 << 19];
int main()
{
	int M, K;
	cin >> M >> K;
	if (K >= (1 << M)) {
		cout << -1 << endl;
	}
	else if (M == 1) {
		if (K == 0) {
			for (int i = 0; i <= 1; i++) {
				cout << i << " " << i << " ";
			}
			cout << endl;
		}
		else {
			cout << -1 << endl;
		}
	}
	else {
		vector<int> ans;
		vector<int> rans;
		for (int i = 0; i < (1 << M); i++) {
			if (i == K)  continue;
			ans.push_back(i);
		}
		rans = ans;
		reverse(rans.begin(), rans.end());
		cout << K << " ";
		for (int num : ans) cout << num << " ";
		cout << K << " ";
		for (int num : rans) cout << num << " ";
		cout << endl;
	}
}

Measured memory_bytes: 4272
n,k,c = map(int,input().split())
s = input()
canwork=[0]*(n+1) #canwork[i]:=i日目までに働くことができる最大日数(1-indexed)
canwork2 = [0]*(c+n+3)
for i in range(n):
    if s[i] == "o":
        canwork[i+1]=max(canwork[i],canwork[i-c]+1)
        
    else:
        canwork[i+1] = canwork[i]
        
for i in range(n)[::-1]:
    if s[i] == "o":
        canwork2[i]=max(canwork2[i+1],canwork2[i+c+1]+1)
    else:
        canwork2[i] = canwork2[i+1]

ans = []
for i in range(n):
    if canwork[i]+canwork2[i+1]==k-1:
        ans.append(i+1)
print(*ans)

Measured memory_bytes: 97584
import java.util.Scanner;

class Main{
    public static void main(String args[]){
        Scanner str = new Scanner(System.in);
        String S = str.next();
        StringBuilder result = new StringBuilder("");
        for(int i = 0; i < S.length(); i++){
            result.append("x");
        }

        System.out.println(result);
    }
}

Measured memory_bytes: 21844
use std::vec::Vec;
use std::cmp::*;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
  let (a, b, c) = {
    let v: Vec<u64> = read_vec();
    (v[0], v[1], v[2])
  };

  if a + b >= c {
    println!("Yes");
  } else {
    println!("No");
  }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll INF = 1e9;
bool graph[nmax][nmax];
vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}

class UnionFind
{
public:
    vector<ll> Parent;

    UnionFind(ll N)
    {
        Parent = vector<ll>(N, -1);
    }
    ll find(ll A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = find(Parent[A]);
    }

    ll size(ll A)
    {
        return -Parent[find(A)];
    }

    bool Union(ll A, ll B)
    {
        A = find(A);
        B = find(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

ll lcm(ll a, ll b)
{
    ll g = gcd(a, b);
    return a / g * b;
}

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}

ll ceil(ll a, ll b)
{
    return (a + b - 1) / b;
}

ll combination(ll n, ll r)
{
    ll ans = 1;
    for (int i = n; i > n - r; --i)
    {
        ans = ans * i;
    }
    for (int i = 1; i < r + 1; ++i)
    {
        ans = ans / i;
    }
    return ans;
}
void solve(long long N, long long P, std::vector<long long> A)
{
    int even = 0, odd = 0;
    for (int i = 0; i < N; i++)
    {
        if (A[i] % 2 == 0)
        {
            even++;
        }
        else
        {
            odd++;
        }
    }
    if (even == N)
    {
        if (P == 0)
        {
            cout << (ll)pow(2, N) << endl;
        }
        else
        {
            cout << 0 << endl;
        }
    }else{
        cout << (ll)pow(2,N-1) << endl;
    }
}

int main()
{
    long long N;
    scanf("%lld", &N);
    long long P;
    scanf("%lld", &P);
    std::vector<long long> A(N);
    for (int i = 0; i < N; i++)
    {
        scanf("%lld", &A[i]);
    }
    solve(N, P, std::move(A));
    return 0;
}


Measured memory_bytes: 640
#include<iostream>
using namespace std;
 
int main() {
  int A,N,B;
  int bingo[3][3];
  int hit[3][3];
  for(int i=0;i<3;i++){
      for(int j=0;j<3;j++){
          cin>>A;
          bingo[i][j]=A;
      }
  }
  cin>>N;
  for(int k=0;k<N;k++){
      cin>>B;
      for(int i=0;i<3;i++){
        for(int j=0;j<3;j++){
            if(bingo[i][j]==B){
                hit[i][j]=1;
            }
        }
    }
  }
  if(hit[0][0]==1 && hit[0][1]==1 && hit[0][2]==1){
      cout<<"Yes";
  }else if(hit[1][0]==1 && hit[1][1]==1 && hit[1][2]==1){
      cout<<"Yes";
  }else if(hit[2][0]==1 && hit[2][1]==1 && hit[2][2]==1){
      cout<<"Yes";
  }else if(hit[0][0]==1 && hit[1][0]==1 && hit[2][0]==1){
      cout<<"Yes";
  }else if(hit[0][1]==1 && hit[1][1]==1 && hit[2][1]==1){
      cout<<"Yes";
  }else if(hit[0][2]==1 && hit[1][2]==1 && hit[2][2]==1){
      cout<<"Yes";
  }else if(hit[0][0]==1 && hit[1][1]==1 && hit[2][2]==1){
      cout<<"Yes";
  }else if(hit[0][2]==1 && hit[1][1]==1 && hit[2][0]==1){
      cout<<"Yes";
  }else{
      cout<<"No";
  } 
  return 0; 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()
#define INF 1<<28

using namespace std;

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

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

	vector<int> A(3, 0);
	rep (i, 3) cin >> A[i];
	sort(ALL(A));

	int res = INF;
	do{
		int curr = 0;
		rep (i, 3){
			if (i != 0){
				curr += abs(A[i-1] - A[i]);
			} // end if
		} // end rep
		res = min(res, curr);
	}while(next_permutation(ALL(A)));

	cout << res << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  while(1){
    int x,y,z;
    cin>>x>>y>>z;
    if(x==0&&y==0&&z==0){
      break;
    }
    int maxv=-1e9;
    for(int i=1;i<z;i++){
      for(int j=1;j<z;j++){
        if(i*(100+x)/100+j*(100+x)/100==z){
          maxv=max(i*(100+y)/100+j*(100+y)/100,maxv);
        }
      }
    }
    cout<<maxv<<endl;
  }
  return 0;
}


Measured memory_bytes: 3100
#include <iostream>
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define pii std::pair<int,int>
#define pli std::pair<ll,int>
#define pil std::pair<int,ll>
#define psi std::pair<string,int>
#define pll std::pair<ll,ll>
#define pci std::pair<char,int>
#define sll(x) scanf("%lld",&x)
#define prll(x) printf("%lld ",x)
#define pri(x) printf("%d ",x)
#define si(x) scanf("%d",&x)
#define pb push_back
#define vll std::vector<ll>
#define vpi std::vector<std::pair<int,int>>
#define vi std::vector<int>
#define vvi std::vector<std::vector<int>>
#define vvpil std::vector<std::vector<std::pair<int,ll>>>
#define vlpii std::vector<std::list<pii>>
#define vlpil std::vector<std::list<pil>>
#define li std::list<int>
#define lpil std::list<pil>
#define Endl printf("\n")
#define vli vector<list<int>>
#define vvll vector<vector<ll>>
#define mp make_pair
#define x first
#define y second
#define ma 100000000
#define imie(...) "[" << #__VA_ARGS__": " << (__VA_ARGS__) << "] "
const ll  INF=10000000000000;
const ll mod = 1e9 + 7;
const ll mod2 = 1e9 + 9 ;
using namespace std;

void add(int& a , int b){
	a += b;
	if(a >= mod) a -= mod;
}
ll mul(ll a , ll b){
	return (a * b) % mod;
}
ll Pow(ll a , ll b){
	if(b == 0) return 1 ;
	ll c = Pow(a , b / 2) ;
	if(b % 2) return (a * ((c * c)% mod )) % mod ;
	return (c * c) % mod ;
}

int main(){
	IOS;
	cout.precision(50) ;
	int n , k , q;cin >> n >> k >> q ;
	vi pl(n + 1 , 0) ;
	vi a(q);for(int i = 0 ; i < q ; i++) {cin >> a[i] ; pl[a[i]]++ ;}
	for(int i = 1 ; i <= n ; i++){
		if(q - pl[i] < k) cout << "Yes" << endl ;
		else cout << "No" << endl ;
	}
	
	return 0;
}


Measured memory_bytes: 1408
#pragma region RegionDefs
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include "boost/multi_array.hpp"
#define rep(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define reps(i,j,n) for(int i=(j),i##_len=(n);i<i##_len;++i)
#define repr(i,n) for(int i=(n);i>=0;--i)
#define all(x) begin(x),end(x)
using namespace std;
template<class T=int> using P  = pair<T, T>;
template<class T=int> using V  = vector<T>;
template<class T=int> using PQ = priority_queue<T>;
template<class T=int> using PQG = priority_queue<T, V<T>, greater<T>>;
typedef long long ll;
const int INF = 1e9;
const ll MOD = 1000000007LL;
void in() {}
template<class Head, class... Tail>
void in(Head&& head, Tail&&... tail)
{
    cin >> head;
    in(move(tail)...);
}
#define IN(...) ll __VA_ARGS__; in(__VA_ARGS__)
//時間が厳しいとき使う
#define INI(...) int __VA_ARGS__; in(__VA_ARGS__)
#define INS(T, ...) T __VA_ARGS__; in(__VA_ARGS__)
#define VIN(T, v, n) V<T> v(n); for(auto& _elem:v)cin>>_elem
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 (a>b) {a=b; return 1;} return 0;}
#define y0 y__0
#define y1 y__1
#define j0 j__0
#define j1 j__1
#pragma endregion RegionDefs

void solve()
{
    string s, t; cin >> s >> t;
    cout << t << s << endl;
}

int main()
{
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(numeric_limits<double>::max_digits10);

    solve();

    return 0;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 55;
const int mod = 1000000007;
//const int mod = 998244353;

template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline void line_out(const vector<T> vec) {
  int n = SZ(vec);
  rep(i, n) {
    cout << vec[i];
    if(i < n-1) cout << " ";
  }
  cout << endl;
  return;
}

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++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  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()
{
  int x, y, a, b, c;
  cin >> x >> y >> a >> b >> c;
  vector<ll> p(a), q(b), r(c);
  rep(i, a) cin >> p[i];
  rep(i, b) cin >> q[i];
  rep(i, c) cin >> r[i];

  sort(rALL(p));
  sort(rALL(q));
  sort(rALL(r));

  priority_queue<ll,vector<ll>,greater<ll>> pq;
  ll sum = 0;
  rep(i, x) {
    sum += p[i];
    pq.push(p[i]);
  }
  rep(i, y) {
    sum += q[i];
    pq.push(q[i]);
  }
  ll ans = sum;
  rep(i, c) {
    ll del = pq.top(); pq.pop();
    pq.push(r[i]);
    sum += r[i]-del;
    chmax(ans, sum);
  }
  cout << ans << endl;
}

Measured memory_bytes: 7704
using System;
using System.Linq;
class Program {
    static int n, x;
    static int[] a;
    static bool[,] vis; // solve(depth, sum) ????¨??????????????????????????????°
    static bool[,] dp; // solve(depth, sum) ??????
    public static bool solve(int depth, int sum) {
        if (depth == n) return (sum == x);
        if (sum > x) return false; // sum ??? x ????¶???????????????§?????????
        if (vis[depth, sum]) return dp[depth, sum];
        bool ret = false;
        if (solve(depth + 1, sum + a[depth]) == true) ret = true; // a[depth] ????????¶??´???
        if (solve(depth + 1, sum) == true) ret = true; // a[depth] ????????°????????´???
        vis[depth, sum] = true;
        dp[depth, sum] = ret;
        return ret;
    }
    public static void Main() {
        n = int.Parse(Console.ReadLine());
        a = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int q = int.Parse(Console.ReadLine());
        int[] b = Console.ReadLine().Split().Select(int.Parse).ToArray();
        for (int i = 0; i < q; i++) {
            x = b[i];
            vis = new bool[n, x + 1];
            dp = new bool[n, x + 1];
            bool ret = solve(0, 0);
            Console.WriteLine(ret ? "yes" : "no");
        }
    }
}

Measured memory_bytes: 9624
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = list(map(int, iss()))
    K = ii()

    for k in range(K):
        if S[k] != 1:
            print(S[k])
            exit()
    else:
        print(1)


if __name__ == '__main__':
    main()


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

using namespace std;

#define REP(i, n) for (int i=0; i<(n); ++i)
#define FOR(i, a, n) for (int i=(a); i<(n); ++i)

#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<<endl;

template<class T>
ostream &operator<<(ostream &os, const vector <T> &v) {
  os << "[";
  REP(i, SZ(v)) {
    if (i) os << ", ";
    os << v[i];
  }
  return os << "]";
}

template<class T, class U>
ostream &operator<<(ostream &os, const pair <T, U> &p) {
  return os << "(" << p.first << " " << p.second << ")";
}

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

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

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;

const ll MOD = 1e9 + 7;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;
const ld eps = 1e-9;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  ll n, x, m; cin >> n >> x >> m;
  ll orx = x;

  ll ans = 0;
  ll cnt = 0;
  vector<int> v(m, -1);
  if(x < m) v[x] = 0;
  REP(i, n) {
    ans += x;
    x %= m;
    x = x * x % m;
    if(x == 0) {
      cout << ans << endl;
      return 0;
    }
    //cout << x << endl;
    if(v[x] != -1) break;
    cnt++;
    v[x] = cnt;
  }
  if(cnt == n) {
    cout << ans << endl;
    return 0;
  }
  //cout << cnt << endl;
  //cout << x << endl;

  ll be = v[x], ed = cnt+1;
  //cout << be << " " << ed << endl;
  ll su = 0;
  ll tmpx = x;
  while(1) {
    su += x;
    x = x * x % m;
    if(x == tmpx) break;
  }
  ans -= su;

  //cout << ans << ":" << su << endl;

  ll add = 0;
  x = tmpx;
  REP(i, (n-be) % (ed - be)) {
    add += x;
    x = x * x % m;
  }
  cout << ans + su * ((n - be) / (ed - be)) + add << endl;

  return 0;
}


Measured memory_bytes: 3720
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
#define all(a) (a).begin(),(a).end()

int main(void){
    int n;
    cin >> n;
    if (n == 2) {
        int a1, a2;
        cin >> a1 >> a2;
        cout << abs(a1-a2) << endl;
        cout << max(a1,a2) << " " << min(a1,a2) << endl;
        return 0;
    }
    vector<int> plus, minus;
    rep(i,n){
        int a;
        cin >> a;
        if (a > 0) plus.push_back(a);
        else minus.push_back(a);
    }
    sort(all(plus),greater<int>());
    sort(all(minus),greater<int>());
    vector<pair<int,int>> res;
    if (minus.empty()) {
        int x = plus.back(); plus.pop_back();
        int y = plus.back(); plus.pop_back();
        assert(x <= y);
        res.push_back({x,y});
        minus.push_back(x-y);
    }
    if (plus.empty()) {
        int x = minus[0];
        int y = minus[1];
        minus.erase(minus.begin(), minus.begin()+2);
        assert(x <= y);
        res.push_back({x,y});
        plus.push_back(x-y);
    }
    assert(!minus.empty() && !plus.empty());
    while (plus.size() > 1) {
        res.push_back({minus[0], plus.back()});
        minus[0] -= plus.back();
        plus.pop_back();
    }
    while (minus.size()) {
        res.push_back({plus[0], minus.back()});
        plus[0] -= minus.back();
        minus.pop_back();
    }
    assert(minus.empty() && plus.size() == 1);
    cout << plus[0] << endl;
    for (auto p : res) {
        cout << p.first << " " << p.second << endl;
    }
    return 0;
}


Measured memory_bytes: 3444
l, r = map(int, input().split())

if 2019 < (r-l):
    print(0)
else:
    x = 2019
    for i in range(l, r+1):
        for j in range(i+1, r+1):
            x = min(x, ((i * j) % 2019))
    print(x)


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


#define MAX 100000
#define SENTINEL 2000000000

struct Card {
	char suit;
	int value;
};

struct Card L[MAX / 2 + 2], R[MAX / 2 + 2];
Card A[MAX], B[MAX];

void merge(Card A[], int n, int left, int mid, int right) {
	int i, j, k;
	int n1 = mid - left;
	int n2 = right - mid;
	for (int i = 0; i < n1; i++)L[i] = A[left + i];
	for (int i = 0; i < n2; i++)R[i] = A[mid + i];
	L[n1].value = R[n2].value = SENTINEL;
	L[n1].suit = R[n2].suit = 'x';
	i = j = 0;
	for (k = left; k < right; k++) {
		if (L[i].value <= R[j].value) {
			A[k] = L[i++];
		}
		else {
			A[k] = R[j++];
		}
	}


}
void mergeSort(Card A[], int n, int left, int right) {
	int mid;
	if(left + 1 < right) {
		mid = (left + right) / 2;
		mergeSort(A, n, left, mid);
		mergeSort(A, n, mid, right);
		merge(A, n, left, mid, right);
	}
}

int partition(Card A[],int n,int p, int r) {
	int i, j ;
	Card t, x;
	x = A[r];
	i = p - 1;
	for (j = p; j < r; j++) {
		if (A[j].value <= x.value) {
			i++;
			t = A[i]; A[i] = A[j]; A[j] = t;
		}
	}
	t = A[i + 1]; A[i + 1] = A[r]; A[r] = t;
	return i + 1;

}

void quickSort(Card A[], int n, int p, int r) {
	int q;
	if (p < r) {
		q = partition(A, n, p, r);
		quickSort(A, n, p, q - 1);
		quickSort(A, n, q + 1, r);
	}
}
int main() {
	int n, i, v;
	//Card A[MAX], B[MAX];
	char S[10];
	int stable = 1;

	scanf("%d", &n);
	for ( i = 0; i < n; i++) {
		scanf("%s %d",S, &v);
		A[i].suit = B[i].suit = S[0];
		A[i].value = B[i].value = v;
	}
	mergeSort(A, n, 0, n);
	quickSort(B, n, 0, n - 1);

	for ( i = 0; i < n; i++) {
		if (A[i].suit != B[i].suit)stable = 0;
	}
	if (stable == 1)printf("Stable\n");
	else printf("Not stable\n");

	for ( i = 0; i < n; i++) {

		printf("%c %d\n", B[i].suit,B[i].value);
	}

	return 0;
}


Measured memory_bytes: 5428
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
#include <map>
#include <cmath>
#include <math.h>
#include <cstdio>
#include <iomanip>
typedef  long long ll;
using namespace std;


int main(void) {
	ll a, b, ans = 0;
	cin >> a >> b;
	for (int i = 0; i < 8000; i++)
	{
		if ((int)(i * 0.08) == a && (int)(i * 0.1) == b)
		{
			cout << i << endl;
			return 0;
		}
	}
	cout << -1 << endl;
	return 0;
}

Measured memory_bytes: 256
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
# import numpy as np
starttime = time.time()
# import numpy as np
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def L(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]

try:
    sys.setrecursionlimit(int(pow(10,6)))
    sys.stdin = open("input.txt", "r")
    # sys.stdout = open("../output.txt", "w")
except:
    pass


n,m=L()
A=[input() for i in range(n)]
dp=[[0 for i in range(m)] for j in range(n)]
for i in range(n):
    for j in range(m):
        if i==0 and j==0:
            dp[i][j]=1
            continue
        if i==0:
            if A[i][j]==".":
                dp[i][j]=dp[i][j-1]
        elif j==0:
            if A[i][j]==".":
                dp[i][j]=dp[i-1][j]
        else:
            if A[i][j]==".":
                dp[i][j]=(dp[i-1][j]+dp[i][j-1])%mod
            else:
                dp[i][j]=0
    # print(*dp[i])
print(dp[-1][-1])



endtime = time.time()
# print(f"Runtime of the program is {endtime - starttime}")



Measured memory_bytes: 52164
//By TheOneYouWant
#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define memreset(a) memset(a,0,sizeof(a))
#define testcase(t) int t;cin>>t;while(t--)
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = s; i < e; i++)
#define rforn(i,s) for(int i = s; i >= 0; i--)
#define rforsn(i,s,e) for(int i = s; i >= e; i--)
#define leadzero(a) __builtin_clz(a) // count leading zeroes
#define trailzero(a) __builtin_ctz(a) // count trailing zeroes
#define bitcount(a) __builtin_popcount(a) // count set bits (add ll)
#define ln endl
#define dbg(x) cerr<<#x<<" = "<<x<<endl
#define dbg2(x,y) cerr<<#x<<" = "<<x<<" & "<<#y<<" = "<<y<<endl;
#define dbgstl32(v) cerr<<#v<<" = \n"; { int c=0; forstl(it,v) \
cerr<<"    Term "<< ++c <<" = "<<it<<ln;} cerr<<endl
#define dbgstlp32(v) cerr<<#v<<" = \n"; { int c=0; forstl(it,v) \
cerr<<"    Term "<< ++c <<" = "<<it.fi<<" , "<<it.se<<ln;} cerr<<endl
#define dbgarr(v,s,e) cerr<<#v<<" = "; forsn(i,s,e) cerr<<v[i]<<", "; cerr<<endl
#define inp freopen("input.txt", "r", stdin)
#define outp freopen("output.txt", "w", stdout)
#define dbgm(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}
typedef long long int  ll;
typedef long double  ld;
typedef pair<ll,ll> p64;
typedef pair<int,int> p32;
typedef vector<ll> v64;
typedef vector<int> v32; 
typedef vector<v32> vv32;
typedef vector<v64> vv64;
typedef vector<p32> vp32;
typedef vector<vp32> vvp32;
typedef map<int,int> m32;
const int LIM = 2e5+5, MOD = 1e9+7, EPS = 1e-9;
int t,n,m,k,x,y;
int main(){
	fastio;
	cin>>n>>k;
	int a[n];
	forn(i,n) cin>>a[i];
//	sort(a.begin(),a.end());
	bool dp[k+1] = {0};
	dp[0] = 0;
	forsn(i,1,k+1){
		bool p =1;
		forn(j,n){
			if(i-a[j]>=0 && dp[i-a[j]]==0) p=0;
		}
		if(p==1) dp[i] = 0;
		else dp[i] = 1;
	}
//	forn(i,k+1) cout<<i<<" "<<dp[i]<<ln;
	if(dp[k]==0) cout<<"Second"<<ln;
	else cout<<"First"<<ln;
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <sstream>
#include <queue>
#include <deque>
#include <set>
#define ll long long
#define MP make_pair
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define F first
#define S second
#define SHN 1e9
#define lSHN 1e18
using namespace std;
int n;
map<int, bool> mp;
int res;
int main()
{
	cin >>n;
	for (int i=0;i<n;i++)
	{
		int x;
		cin >>x;
		mp[x]^=1;
	}
	for (map<int, bool>::iterator it=mp.begin();it!=mp.end();it++)
	{
		if (!it->second) continue;
		res++;
	}
	cout <<res;
	return 0;
}

Measured memory_bytes: 4864
fn read_lines() -> Vec<String> {
    use std::io::Read;

    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    return buf.lines().map(|e| e.to_string()).collect::<Vec<_>>();
}

fn main() {
    let input = read_lines();
    let n: usize = input[0].parse().unwrap();
    let mut series = input[1].split_whitespace().map(|s| s.parse().unwrap()).collect::<Vec<u32>>();
    let r = n - 1;

    let q = partition(&mut series, 0, r);

    let small = series[0..q].iter().map(|e| format!("{}", e)).collect::<Vec<String>>().join(" ");
    let large = series[q+1..r+1].iter().map(|e| format!("{}", e)).collect::<Vec<String>>().join(" ");
    println!("{} [{}] {}", small, series[q], large);
}

fn partition<T: Ord + Clone>(series: &mut Vec<T>, p: usize, r: usize) -> usize {
    let x = series[r].clone();
    let mut i = (p as i64) - 1;
    for j in p..r {
        if series[j] <= x {
            swap(series, (i + 1) as usize, j);
            i += 1;
        }
    }
    swap(series, (i + 1) as usize, r);
    return (i + 1) as usize;
}

fn swap<T: Clone>(series: &mut Vec<T>, i: usize, j: usize) {
    let tmp = series[i].clone();
    series[i] = series[j].clone();
    series[j] = tmp;
}


Measured memory_bytes: 9016
#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, M;
    cin >> N >> M;
    cout << (N*(N-1)/2)+(M*(M-1)/2) << endl;
    return 0;
}

Measured memory_bytes: 3612
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <utility>
#include <functional>
#include <iomanip>
#include <typeinfo>
#include <iterator>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <tuple>
#include <map>
#include <set>
#include <numeric>
using namespace std;

#define all(container) container.begin(), container.end()
#define sortall(container) (sort(container.begin(), container.end()))
#define yn(cond) ((cond) ? (cout << "Yes" << endl) : (cout << "No" << endl))
#define YN(cond) ((cond) ? (cout << "YES" << endl) : (cout << "NO" << endl))
#define LLONG_MAX numeric_limits<long long>::max()
#define INT_MAX numeric_limits<int>::max()

typedef long long       ll;
typedef vector<int>     vi;
typedef vector<ll>      vll;
typedef vector<double>  vd;
typedef vector<bool>    vb;
typedef vector<string>  vs;
typedef vector<char>    vc;
typedef pair<int, int>  pii;
typedef pair<ll, ll>    pll;
typedef vector<pii>     vpii;
typedef vector<pll>     vpll;
typedef vector<vll>		vvll;
typedef vector<vi>		vvi;
typedef vector<vb>		vvb;
typedef vector<vs>		vvs;
typedef vector<vc>		vvc;

typedef struct edge_ {
	ll to;
	ll cost;
} edge;

typedef struct point_ {
	ll x, y;
	point_(ll x = 0, ll y = 0) : x(x), y(y) {}
} point;

constexpr double	PI = 3.14159265358979323846;
constexpr ll		INF = 1 << 15;
constexpr ll		MOD = (ll)1e9 + 7;
constexpr double	EPS = 1e-7;
constexpr int		dy4[4] = { 0, 1, 0, -1 };
constexpr int		dx4[4] = { 1, 0, -1, 0 };
constexpr int		dy8[8] = { 0, 1, 1, 1, 0, -1, -1, -1 };
constexpr int		dx8[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };

template<typename T>
istream& operator >> (istream& is, vector<T>& vec) {
	for (T& x : vec) is >> x;
	return is;
}

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vec) {
	for (const T& x : vec) os << x << " ";
	return os;
}

template<typename S, typename T>
istream& operator >> (istream& is, pair<S, T>& p) {
	is >> p.first >> p.second;
	return is;
}

istream& operator >> (istream& is, point& p) {
	is >> p.x >> p.y;
	return is;
}

template<typename S, typename T>
ostream& operator << (ostream& os, const pair<S, T>& p) {
	os << "{" << p.first << " " << p.second << "}";
	return os;
}

ostream& operator << (ostream& os, const point& p) {
	os << "(" << p.x << " " << p.y << ")";
	return os;
}

/******************************************************************************/
/**********************         Don't make WA !!         **********************/
/******************************************************************************/


int main()
{
	ll A, B, C;
	cin >> A >> B >> C;

	vll N = { A, B, C };
	int n = 0;
	for (int i = 0; i < 3; i++)
		if (N[i] % 2 == 0)
			n++;

	if (n != 0)
		cout << 0 << endl;
	else {
		sortall(N);
		cout << N[0] * N[1] << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <iostream>
#include <bitset>
#include <cassert>
#include <queue>
#include <random>
#include <stack>
#include <iomanip>
#include <math.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define repf(i, a, b) for (ll i = (ll)a; i < (ll)b; i++)
#define repr(i, a, b) for (ll i = (ll)a; i > (ll)b; i--)
#define repv(x, arr) for (auto &x : arr)
#define all(v) (v).begin(), (v).end()
#define vec(name, num) vector<ll> name((num), 0);
#define mp(a, b) make_pair(a, b)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int infi = 2147483600;
const ll infl = 1e17;

int main()
{
    ll n,k;
    cin >> n >> k;
    vll a(n);
    rep(i, n) cin >> a[i];
    vll s(n+1,0);
    vll s2(n + 1, 0);
    rep(i,n){
        s2[i + 1] = s2[i] + a[i];
        s[i + 1] = s[i] + max(0ll,a[i]);
    }
    ll ans = 0;
    repf(i,k,n+1){
        ans=max(ans,max(s[n]-(s[i]-s[i-k]),s[n]-(s[i]-s[i-k])+s2[i]-s2[i-k]));
    }
    cout << ans << endl;
}

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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x, n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair< int, int > P;
typedef pair< int, P > PP;

//-------------------------------------------------

int n, m;
ll x[1000], y[1000], z[1000];
int f[2] = {-1, 1};

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

	cin >> n >> m;
	REP(i, n) {
		cin >> x[i] >> y[i] >> z[i];
	}
	ll ans = -LINF;
	REP(i, 8) {
		ll a[n] = {};
		REP(j, n) a[j] = f[i&1]*x[j] + f[(i>>1)&1]*y[j] + f[(i>>2)&1]*z[j];
		sort(a, a + n);
		ll tmp = 0;
		REP(j, m) tmp += a[n - j - 1];
		ans = max(ans, abs(tmp));
	}
	cout << ans << endl;

	return 0;
}



Measured memory_bytes: 256
//#if 0
//????????????????§£?????????????????????????????????????????????????????????C++??§string??????????????§???
//?????????????????§???????????§???AOJ?????????????????????Runtime Error??????????????????????????????
//??£????????¨??????????????????????????????????????????????????????Runtime Error???????????¨???????????????
//??§???????????????????????????????????§???
//#endif
#include<iostream>
#include<string>
#define lth 1010

using namespace std;

int main()
{
	int n, L[1010][1010], Lmax = 0, *save;
	string *Xi, *Yi;
	cin >> n;
	save = new int[n];
	if (n <= 20)
	{
		Xi = new string[lth];
		Yi = new string[lth];
	}
	else
	{
		Xi = new string[1010];
		Yi = new string[1010];
	}
	for (int k = 0; k < n; k++)
	{
		Lmax = 0;
		string X, Y;
		cin >> X >> Y;
		for (int i = 0; i <= X.length(); i++)
		{
			if (i != 0)
				Xi[i] = X.substr(0, i );
		}
		for (int i = 0; i <= Y.length(); i++)
		{
			if (i != 0)
				Yi[i] = Y.substr(0, i );
		}
		for (int i = 0; i <= X.length(); i++)
			for (int j = 0; j <= Y.length(); j++)
			{
				if (i == 0 || j == 0)
					L[i][j] = 0;
				else if (Xi[i][i - 1] == Yi[j][j - 1])
				{
					L[i][j] = L[i - 1][j - 1] + 1;
				}
				else
				{
					L[i][j] = (L[i][j - 1] > L[i - 1][j]?L[i][j - 1] : L[i - 1][j]);
				}
				if (Lmax < L[i][j]) Lmax = L[i][j];
			}
		save[k] = Lmax;
	}

	for (int i = 0; i < n; i++)
		cout << save[i] << endl;
}

Measured memory_bytes: 8204
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define ALL(v) v.begin(),v.end()
using ll = long long;
using pii = pair<int,int>;
using vi = vector<int>;
using vs = vector<string>;
using vb = vector<bool>;
using vll = vector<long long>;
using vpii = vector<pair<int,int>>;
using vivi = vector<vector<int>>;
using vbvb = vector<vector<bool>>;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
const int mod = 1000000007;
const int inf = 1001001001;



int main(void) {
  ll n,a,b;
  cin >> n >> a >> b;
  vll x(n);
  rep(i,n)cin >> x[i];
  ll ans = 0;
  rep(i,n-1){
    ans+=min({b,(x[i+1]-x[i])*a});
  }
  cout << ans << endl;
  
}




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

int gcd(int a,int b){
    if(a<b)swap(a,b);
    if(a%b==0)return b;
    else return gcd(b,a%b);
}


int main(){
    long n,xx;
    cin >> n >> xx;
    long x[n];
    long dist[n];
    for(int i=0;i<n;i++){
        cin >> x[i];
        dist[i] = abs(x[i]-xx);
    }
    long ans = dist[0];
    for(int i=1;i<n;i++){
        ans = gcd(ans,dist[i]);
    }
    cout << ans << endl;
    
}

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

int main(){
    int n;
    cin >> n;
    vector<int> candy1(n);
    vector<int> candy2(n);
    for(int i=0; i<n; i++){
        cin >> candy1.at(i);
    } 
    for(int i=0; i<n; i++){
        cin >> candy2.at(i);
    }
    int ans=0;
    for(int i=1; i<=n; i++){
        int cnt=0;
        for(int j=0; j<i; j++){
            cnt += candy1.at(j);
            //cout << cnt << " ";
        }
        for(int j=i-1; j<n; j++){
            cnt += candy2.at(j);
            //cout << cnt << " ";
        }
        //cout << cnt << endl;
        ans = max(ans, cnt);
    }
    cout << ans << endl;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define int long long
using namespace std;

typedef long long ll;

int K, prime[1000];

double ans;

vector<int> A;

void update(int num, int sum){
  ans = max( ans, 1.0 * sum / num ); 
}

void dfs(int x, int num, int upper, int sum){
  
  if( x == (int)A.size() ) return;

  int add = 0;
  
  for(int i=1;i<=upper;i++){

    add += pow( A[x], i );
    
    int nnum = num * pow( A[x], i );
    
    if( nnum > K ) break;
    
    update( nnum, sum * ( 1 + add ) );
    
    dfs( x + 1, nnum, i, sum * ( 1 + add ) );
    
  }
  
}

signed main(){
  
  for(int i=0;i<1000;i++) prime[i] = 1;
  
  prime[0] = prime[1] = 0;
  
  for(int i=0;i<100;i++){
    
    if( prime[i] == 0 ) continue;
    
    for(int j=i*2;j<=1000;j+=i) prime[j] = 0;
    
  }
      
  ll x = 1;
  
  for(int i=0;i<1000;i++){
    
    if( prime[i] == 1 ){
      x *= i;
      A.push_back(i);
    }
    
    if( x > 1e15 ) break;
    
  }
  
  while(1){
  
    cin>>K;

    if( K == 0 ) break;
    
    if( K == 1 ){
      cout<<1<<endl;
      continue;
    }    
    
    ans = 0;
    
    dfs( 0, 1, 50, 1 );
    
    printf("%.6f\n", ans );

  }
  
  return 0;
}



Measured memory_bytes: 3396