akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(a,b) __gcd(a,b) 
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define uint unsigned int
#define MOD 1000000007
#define MAXN 200005
#define MAXH 4
#define MAXM 100
#define ll long long
#define ull unsigned long long
#define RNG rng mt19937(time(NULL))
#define udist(a,b) uniform_int_distribution<uint32_t> distribution(a,b)
#define max3(a,b,c) max(a, max(b, c))
#define min3(a,b,c) min(a, min(b, c))
#define gmax(a,b) a = max(a, b)
#define gmin(a,b) a = min(a, b)
#define whatis(x) cerr << #x << " is " << (x) << endl;
#define T long long
#define mat vector<vector<T>>
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define cld complex<long double>
using namespace std;
const int N = 45;
ll dp[N][1 << 17];
ll ans[N];

inline ll mul(ll x, ll y){
	return x * y % MOD;
}

inline ll add(ll x, ll y){
	ll res = x + y;
	if(res >= MOD)res-=MOD;
	return res;
}

int main(){
	fast_io();
	int n,c[3];	
	cin >> n >> c[0] >> c[1] >> c[2];
	ll inv = (1 << (c[0]-1));
	inv<<=c[1];
	inv|=(1 << (c[1] - 1));
	inv<<=c[2];
	inv|=(1 << (c[2] - 1));
	dp[0][0] = 1;

	fu(i,1,n){
		cu(k,0,1 << 17){
			fu(x,1,10){
				int msk = ((k << x) | (1 << (x-1))) & ((1 << 17) - 1);
				if((msk & inv) == inv){
					ans[i] = add(ans[i], dp[i-1][k]);
				}
				else{
					dp[i][msk] = add(dp[i][msk], dp[i-1][k]);
				}
			}
		}
	}
	ll res = 0;
	ll m = 1;
	fd(i,n,1){
		res = add(res, mul(m, ans[i]));
		m = mul(m, 10);
	}
	cout << res << '\n';
}


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

#define NIL -2
#define INF 1000000001
#define EPS 1e-10
#define equals(a,b) (fabs((a) - (b)) < EPS)

using namespace std;
class Point{
    public:
    double x,y;

    Point(double x = 0,double y = 0): x(x), y(y) {}

    Point operator + (Point p){ return Point(x+p.x, y+p.y); }
    Point operator - (Point p){ return Point(x-p.x, y-p.y); }
    Point operator * (double k){ return Point(x*k,y*k);      }
    Point operator / (double k){ return Point(x/k,y/k);      }

    double norm(){ return x*x + y*y;}
    double abs(){ return sqrt(norm());}
    double dot(Point p){
        return x*p.x + y*p.y;
    }
    double prod(Point p){
        return x*p.y - y*p.x;
    }

    bool operator < (Point &p){
        return x != p.x ? x < p.x : y < p.y;
    }
    bool operator == (Point &p){
        return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
    }
  
};
typedef Point Vector;

int main(){
    int q;
    scanf("%d",&q);
    double x0,y0,x1,y1,x2,y2,x3,y3;
    for(int i = 0;i < q;i++){
        scanf("%lf %lf %lf %lf %lf %lf %lf %lf ",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3);
        Vector p10(x1-x0,y1-y0);
        Vector p32(x3-x2,y3-y2);
        if(p10.dot(p32) == 0) printf("1\n");
        else if(p10.prod(p32) == 0) printf("2\n");
        else printf("0\n");
    }
    return 0;
}


Measured memory_bytes: 3252
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1e9+7;

int main(void){

    int A,B,T; cin>>A>>B>>T;
    int ans = (int)((T+0.5) / A) * B;
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

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

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

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

int main(){
    ll n, m; cin>>n>>m;
    vector<ll> a(n), b(m);
    for(int i=0; i<n; i++) cin>>a[i];
    for(int i=0; i<m; i++) cin>>b[i];
    sort(a.begin(), a.end(), greater<ll>());
    sort(b.begin(), b.end(), greater<ll>());

    ll cntd=0, cntr=0;
    ll ans=1;
    for(ll i=n*m; i>=1; i--){
        if(cntd<n && cntr<m && a[cntd]==i && b[cntr]==i){
            cntd++, cntr++;
        }
        else if(cntd<n && a[cntd]==i){
            ans*=cntr;
            cntd++;
        }
        else if(cntr<m && b[cntr]==i){
            ans*=cntd;
            cntr++;
        }
        else{
            ans*=((cntd*cntr)-(n*m-i));
        }
        ans%=MOD;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define _LIBCPP_DEBUG 0
using namespace std;
typedef long long int ll;
ll MOD = 1e9 + 7;
int INF = 1 << 20;


int main(void){

    ll H,W; cin>>H>>W;

    if(H==1 || W==1){
        cout<<1<<endl;
        return 0;
    }

    if(H%2==0 || W%2==0){
        cout<<H*W /2<<endl;
        return 0;
    }else{
        cout<<(H*W+1) /2<<endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
  int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  
  if(a<=b&&a<=c)
  {if(b>c)
      printf("%d %d %d\n",a,c,b);
   else
      printf("%d %d %d\n",a,b,c);}
  else if(b<=a&&b<=c)
  {if(a>c)
      printf("%d %d %d\n",b,c,a);
    else
      printf("%d %d %d\n",b,a,c);}
  else
  {if(a>b)
      printf("%d %d %d\n",c,b,a);
   else
      printf("%d %d %d\n",c,a,b);}
  
  return 0;
}


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

int N;

bool odd(int n) {
  if(n / 10 == 0) return 1;
  return (1 + odd(n/10))%2;
}

int main () {
  cin >> N;

  int ans = 0;
  for(int i = 1; i <= N; i++) ans += odd(i);
  cout << ans << endl;
  return 0;
}


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

#define ll long long
long long INF = 1e18;

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

	int n, k1;
	cin >> n >> k1;
	vector<int> p(n), c(n);
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		x--;
		p[i] = x;
	}
	for (int i = 0; i < n; i++) cin >> c[i];

	long long ans = -INF;
	for (int i = 0; i < n; i++) {
		int k = k1;
		long long sum = 0;
		queue<int> q;
		q.push(p[i]);
		vector<bool> visited(n);
		visited[i] = true;
		long long length = 0;
		while (k--) {
			int v = q.front();q.pop();
			sum += c[v];
			length++;
			ans = max(ans, sum);
			if (visited[v]) 
				break;
			visited[v] = true;
			q.push(p[v]);
		}
		if (k <= 0) continue; // no more k
		while (!q.empty()) q.pop();
		long long times = k / length;
		if (times) times--;
		sum += (times * sum);
		k -= (times * length);
		ans = max(ans, sum);
		//updateshit and count cycle
		for (int i = 0; i < n; i++) visited[i] = false;
		while (!q.empty()) q.pop();
		q.push(i);
		while (k--) {
			int v = q.front();
			q.pop();
			sum += c[p[v]];
			ans = max(ans, sum);
			q.push(p[v]);
		}

	}
	cout << ans;

	return 0;
}

Measured memory_bytes: 3688
n = int(input())
a = list(map(int, input().split()))
m = 10 ** 6 + 1
cnt = [0] * m
for x in a:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    for i in range(x, m, x):
        cnt[i] += 1
ans = 0
for x in a:
    if cnt[x] == 1:
        ans += 1
print(ans)


Measured memory_bytes: 32068
import java.util.Scanner;
   
class Main{
 public static void main(String[] arge){
     
Scanner sc=new Scanner(System.in);

while (true){ 

int a=sc.nextInt();
int b=sc.nextInt();

if(a==0 && b==0)
{break;}
else{
for ( int i = 0; i < a; i++ ){
for ( int j = 0; j < b; j++ ){
        if((i>0 && i<a-1) && (j>0 && j<b-1)){
            System.out.print(".");
        } else {
            System.out.print("#");
        }
    }
    System.out.println("");
} 
}
System.out.println("");	
}
}
}





Measured memory_bytes: 31976
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cmath>
using namespace std;
int n,a[120],tot=0;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		for(int j=1;j<i;j++) tot+=a[i]*a[j];
	}
	printf("%d\n",tot);
}

Measured memory_bytes: 256
#pragma GCC optimize "03"
#include <bits/stdc++.h>
using namespace std;
 
#define int long long int
#define ld double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif

const int N = 2e5 + 5;
const int mod = 1e9 + 7;



signed main() {
	#ifdef LOCAL
		freopen("input.txt","r",stdin);
	#endif
	IOS;
	int n, h, w;
	cin >> n >> h >> w;
	cout << (n-h+1)*(n-w+1);
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

public class Contestant
{
    public static void Main(string[] args)
    {
        checked
        {
            var /*XY*/ (X, Y) = (Int(), Int());

            for (int i = 0; i <= X; i++)
            {
                var legs = i * 2 + (X - i) * 4;
                if (legs == Y)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }

            Console.WriteLine("No");
        }
    }

    private static string NextInput = "";

    private static int Int() => int.Parse(Str());
    private static long Long() => long.Parse(Str());
    private static float Float() => float.Parse(Str());
    private static double Double() => double.Parse(Str());
    private static string Str()
    {
        var s = NextInput;
        if (s == "") s = Console.ReadLine();

        var idx = s.IndexOf(' ');
        if (idx >= 0)
        {
            NextInput = s.Substring(idx + 1);
            return s.Substring(0, idx);
        }
        NextInput = "";
        return s;
    }
}



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

int r, c, k;
long long val[3001][3001];
long long dp[3001][3001][4];
int main(){
    cin >> r >> c >> k;
    ms(val, 0);ms(dp, 0);

    rep(i, k){
        int R, C, V;
        cin >> R >> C >> V;
        val[R - 1][C - 1] = V;
    }

    if(val[0][0] > 0)dp[0][0][1] = val[0][0];

    rep(i, r){
        rep(j, c){
            // 横に移動
            long long temp = 0;
            rep(m, 3){
                temp = max(dp[i][j + 1][m + 1], dp[i][j][m] + val[i][j + 1]);
                temp = max(temp, dp[i][j][m + 1]);
                dp[i][j + 1][m + 1] = temp;
            }
            //縦に移動
            
            long long temp1 = 0;
            rep(m, 4) temp1 = max(temp1, dp[i][j][m]);
            dp[i + 1][j][0] = max(temp1, dp[i + 1][j][0]);
            dp[i + 1][j][1] = max(temp1 + val[i + 1][j], dp[i + 1][j][1]);
            
        }
    }
    
    long long res = 0;
    rep(i, 4) res = max(res, dp[r - 1][c - 1][i]);
    cout << res << endl;

}


Measured memory_bytes: 355432
#include <bits/stdc++.h>
#define REP(i, n) for (long long i = 0; i < (long long)n; i++)
//#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using Vl = vector<ll>;
using vi = vector<int>;
using Graph = vector<vi>;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  // std::cout << std::fixed << std::setprecision(15); //"for float-base
  // problem"
  /*body*/
  int X, Y;
  cin >> X >> Y;
  int max = 4 * X, min = 2 * X;
  if (max < Y || min > Y || Y % 2 != 0)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}

Measured memory_bytes: 3652
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int a[105];
int main(void){
    int n; cin>>n;
    for(int i=0;i<2*n;i++){
        cin>>a[i];
    }
    sort(a,a+2*n);
    int i=0; int ans=0;
    while(i<=2*n){
        ans=ans+a[i];
        i=i+2;
    }
    cout<<ans<<endl;
}


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

using namespace std;

#define FAST_IO ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mod 1000000007
#define endl "\n"
typedef long long ll;
 
int main(){ 
	
	FAST_IO;
   
	int n,W;
	cin>>n>>W;

	int V = 100007;

	ll w[n],v[n];

	for(int i=0; i<n; i++){
		cin>>w[i]>>v[i];
	}

	ll dp[V];
	ll inf = 1e10;

	for(int i=0; i<V; i++){
		dp[i] = inf;
	}

	dp[0] = 0;

	for(int i=0; i<n; i++){
		for(ll j=V-1; j>=0; j--){
			if(j>=v[i])
				dp[j] = min(dp[j],dp[j-v[i]]+w[i]);
		}
	}

	ll ans = 0;
	for(int i=0; i<V; i++){
		//cout<<dp[i]<<" ";
		if(dp[i] <= W)
			ans = i;
	}

	cout<<ans<<endl;

}
 

Measured memory_bytes: 1024
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    rest = dict()

    for i in range(n):
        si, pi = input().split()

        if si not in rest.keys():
            rest[si] = [(i + 1, int(pi))]
        else:
            rest[si].append((i + 1, int(pi)))

    for key, values in sorted(rest.items(), key=lambda x: x[0]):
        for no, values in sorted(values, key=lambda y: y[1], reverse=True):
            print(no)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
import java.util.*;
import java.util.Map.Entry;



public class Main{

	
	//最大公約数・最小公倍数（セットで使う）
	public static long gcm(long a, long b) {
		long result = a;
		long k = 0;
		long n = b;
		do {
			k = result % n;
			result = n;
			n = k;
		} while(k != 0);
		return result;
	}
	
	public static long lcm(long a, long b) {
		long g;
		g = gcm(a, b);
		return a/g*b;
	}
	
	static long gcd (long a, long b) {
		long temp;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return b;
	}
	
	//等差数列
	static long tousasum(int n) {
		return (long)n*((long)n+1)/2;
	}



	//素数判定
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2) if(n%i==0){return false;}
		return true;
	}


	//倍数判定（10進数以外のときに有用）
	static boolean isMultiple (String s, int base, int m) {
		int temp = 0;
		for (int i=0; i<s.length(); i++) {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		}
		if (temp==0) {return true;}
		return false;
	}


	//階乗
	static long factorial (int i) {
		if (i==1) {return 1;}
		else {return i*factorial(i-1);}
	}


	//進数変換
	static String toNbase (String sm, int m, int n) {
		return Long.toString(Long.parseLong(sm,m),n);
	}
	
	public static final long gcd_n(long[] param) {
	    final int len = param.length;
	    long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
	    for (int i = 1; i < len - 1; i++) {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    }
	    return g;
	}
	
	public static long lcm_n(long[] numbers) {
		long l;
		l = numbers[0];
		for (int i = 1; i < numbers.length; i++) {
			l = lcm(l, numbers[i]);
		}
		return l;
	}
	
	
 public static void main(String[] args) {
	 Scanner sc=new Scanner(System.in);
	 int N=sc.nextInt();
	 long T=sc.nextLong();
	 long[] t=new long[N];
	 long result=0;
	 for(int i=0;i<N;i++) {
		 t[i]=sc.nextLong();
	 }
	 
	 for(int i=0;i<N-1;i++) {
		 if((t[i+1]-t[i])<=T) {
			 result+=(t[i+1]-t[i]);
		 }else {
			 result+=T;
		 }
	 }
	 result+=T;
	 
	 System.out.println(result);
 }
	


}




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

#define name ""
#define ini freopen(name".inp","r",stdin); freopen(name".out","w",stdout)
#define foe(it,c) for (__typeof(c.begin()) it = c.begin(); it != c.end(); it++)
#define long long long 
#define db double 
#define pii pair <int, int>
#define pll pair <long, long>
#define all(c) c.begin(), c.end()
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

const int INF = 1e9+7;
const int MOD = 1e9+7;
const int dx[4] = {0,0,-1,1};
const int dy[4] = {-1,1,0,0};

int main()
{
  fastio;
  long h; cin >> h;
  long res = 0, cnt = 1;
  while (h > 0){
    if (h == 1){
      res += cnt;
      h--;
    }
    else {
      res += cnt;
      cnt *= 2;
      h /= 2;  
    }
  }
  cout << res;
  return 0;
}

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

using namespace std;
#define FOR(i, a, b) for (int i = (a), _##i = (b); i < _##i; ++i)
#define REP(i, a) for (int i = 0, _##i = (a); i < _##i; ++i)
#define pb push_back
const int INF = 1000000000;
 
struct Edge {
    int a, b, cap, flow;
};

struct MaxFlow {
    int n, s, t;
    vector<int> d, ptr, q;
    vector< Edge > e;
    vector< vector<int> > g;

    MaxFlow(int n) : n(n), d(n), ptr(n), q(n), g(n) {
        e.clear();
        REP(i,n) {
            g[i].clear();
            ptr[i] = 0;
        }
    }

    void addEdge(int a, int b, int cap, int inv = 0) {
        Edge e1 = { a, b, cap, 0 };
        Edge e2 = { b, a, inv, 0 };
        g[a].push_back( (int) e.size() );
        e.push_back(e1);
        g[b].push_back( (int) e.size() );
        e.push_back(e2);
    }
    int getMaxFlow(int _s, int _t) {
        s = _s; t = _t;
        int flow = 0;
        for (;;) {
            if (!bfs()) break;
            REP(i,n) ptr[i] = 0;
            while (int pushed = dfs(s, INF))
                flow += pushed;
        }
        return flow;
    }

private:
    bool bfs() {
        int qh = 0, qt = 0;
        q[qt++] = s;
        REP(i,n) d[i] = -1;
        d[s] = 0;

        while (qh < qt && d[t] == -1) {
            int v = q[qh++];
            REP(i,g[v].size()) {
                int id = g[v][i], to = e[id].b;
                if (d[to] == -1 && e[id].flow < e[id].cap) {
                    q[qt++] = to;
                    d[to] = d[v] + 1;
                }
            }
        }
        return d[t] != -1;
    }

    int dfs (int v, int flow) {
        if (!flow) return 0;
        if (v == t) return flow;
        for (; ptr[v] < (int)g[v].size(); ++ptr[v]) {
            int id = g[v][ptr[v]],
                to = e[id].b;
            if (d[to] != d[v] + 1) continue;
            int pushed = dfs(to, min(flow, e[id].cap - e[id].flow));
            if (pushed) {
                e[id].flow += pushed;
                e[id^1].flow -= pushed;
                return pushed;
            }
        }
        return 0;
    }
};


vector<int> rw[110],cl[110];
int r,c;
string s;

int main(){
//	freopen("test.in","r",stdin);
	cin >> r >> c;
	MaxFlow flow(r+c+2);
	REP(i,r){
		cin >> s;
		REP(j,c){
			if(s[j] != '.'){
				flow.addEdge(i,j+r,1,1);
				if(s[j] == 'S'){
					flow.addEdge(r+c,i,INF);
					flow.addEdge(r+c,j+r,INF);
				}
				if(s[j] == 'T'){
					flow.addEdge(i,r+c+1, INF);
					flow.addEdge(j+r,r+c+1, INF);
				}
			}
		}
	}	
	int flw = flow.getMaxFlow(r+c,r+c+1);
	if(flw < INF)
		cout << flw << endl;
	else 
		cout << -1 << endl;
	return 0;
}

Measured memory_bytes: 948
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <string>
#include <functional>
 
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> P;
typedef vector<P> vpl;
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
//const int V = 100005;
ll dy[8] = {1,0,-1,0,1,-1,1,-1};
ll dx[8] = {0,1,0,-1,1,-1,-1,1};
const double pi = acos(-1);
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << endl;}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){cout << a << " " << b << " " << c << endl;}
#define INT_MAX 1<<30;
const int MAX = 1020000;
const double EPS = 1e-6;
const int mod = 1e9+7;

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

ll lcm(ll a, ll b){
    return a/GCD(a,b)*b;
}

 
int main(){
    ll n; cin >> n;
    string s,t; cin >> s >> t;
    rep(i,n){
        cout << s[i] << t[i];
    }
    cout << endl;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
from sys import exit
n, y  = map(int, input().split())
for i in range(n+1):
    for j in range(n+1-i):
        if 10000*i+5000*j+1000*(n-i-j) == y:
            print(i, j, n-i-j)
            exit()
print(-1, -1, -1)

Measured memory_bytes: 3060
#include<iostream>
using namespace std;
int main(){
  int a,b,k,i;cin >> a >> b >> k;
  for(i=0;i<k;i++){
    if(i%2==0){
      b += a/2;a /= 2;
    } else {
      a += b/2;b /= 2;
    }
  }  
  cout << a << " " << b << endl;
}

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

void solve(long long N, long long M) {
    ll ans = 0;
    // まずSを使う
    if (M >= 2 * N) {
        // Sが全て使える場合
        ans += N;
        M -= 2 * N;
    } else {
        // Sが全て使えない場合、Mを使いきる
        ans += M / 2;
        M = 0;
    }
    // 残りのc4つでScc
    ans += M / 4;
    cout << ans << endl;
}

int main() {
    long long N;
    scanf("%lld", &N);
    long long M;
    scanf("%lld", &M);
    solve(N, M);
    return 0;
}


Measured memory_bytes: 3656
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <math.h>

using namespace std;

int main(){
    long long A, B, N;
    cin >> A >> B >> N;
    if(B==0) cout << 0 << endl;
    else if(N >= B) cout << (A * (B-1))/ B << endl;
    else cout << A * N / B << endl;
}

Measured memory_bytes: 3560
#include<bits/stdc++.h>
#define lowbit(i) ((i)&-(i))
using namespace std;
int n,bit[100100];
void add(int i,int x)
{   while(i<=n)
    {  bit[i]+=x;
        i+=lowbit(i);
   }
}

int sum(int x)
{    int s=0;
    while(x>0)
    {  s+=bit[x];
        x-=lowbit(x);
    }    return s;
}
int main()
{  int q;
    scanf("%d%d",&n,&q);
    memset(bit,0,sizeof(bit));
    for(int i=0;i<q;i++)
    {
        int com,x,y;
        scanf("%d%d%d",&com,&x,&y);
        if(com==0) add(x,y);
        else printf("%d\n",sum(y)-sum(x-1));
    }
    return 0;
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define REP(i,k,n) for(int(i)=(k);(i)<(n);++(i))
#define ALL(x) (x).begin(),(x).end()
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)
using namespace std;
typedef long long ll;

string S;

int main()
{
  cin >> S;

  int cnt1 = 0;
  REP(i,0,S.length()) {
    if (i % 2 == 0 && S[i] == '0') ++cnt1;
    if (i % 2 == 1 && S[i] == '1') ++cnt1;
  }

  int cnt2 = 0;
  REP(i,0,S.length()) {
    if (i % 2 == 1 && S[i] == '0') ++cnt2;
    if (i % 2 == 0 && S[i] == '1') ++cnt2;
  }

  cout << min(cnt1, cnt2) << endl;

  return 0;
}


Measured memory_bytes: 512
#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<stdbool.h>
#include<math.h>
#include<sstream>
#include<math.h>
#include<vector>
#include<functional>
#include<queue>
#include<utility>
#include<bitset>
typedef long long ll;
#define N (1000000000+7)
#define INF 1e10
#define Length 80000
using namespace std;
typedef pair<ll, ll> P;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

bool used[110];

bool cmp(const pair<int,int> &a,const pair<int,int> &b) {
	return a.first * a.first + a.second * a.second > b.first*b.first + b.second * b.second;
}

void solve(int n) {
	vector<pair<int, int>>p(n), q(n);
	for (int i = 0;i < n;i++) {
		cin >> p[i].first >> p[i].second;
	}
	for (int i = 0;i < n;i++) {
		cin >> q[i].first >> q[i].second;
	}
	int dist = Length, flag = 0;
	int ans = 0;
	sort(p.begin(), p.end());
	for (int i = 0;i < n;i++) {
		dist = Length;
		flag = 0;
		for (int j = 0;j < n;j++) {
			if (!used[j]) {
				int x = q[j].first - p[i].first;
				int y = q[j].second - p[i].second;
				if ((x > 0) && (y > 0) && y < dist) {
					dist = y;
					flag = j;
				}
			}
		}
		if (dist < Length) {
			ans++;
			used[flag] = true;
		}
	}
	cout << ans << endl;
}

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

ll Q[110];
	
int main(void){
	int n;
	cin >> n;
	vector<int>a(n), b(n);
	for (int i = 0;i < n;i++) {
		cin >> a[i];
		b[i] = a[i];
	}
	sort(b.begin(), b.end());
	if (b[n / 2 - 1] == b[n / 2]) {
		for (int i = 0;i < n;i++) {
			cout << b[n / 2] << endl;
		}
	}
	else {
		for (int i = 0;i < n;i++) {
			if (a[i] <= b[n / 2 - 1])cout << b[n / 2] << endl;
			else cout << b[n / 2 - 1] << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3712
//Author:- S_Aditya

#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define ll long long 
#define scn(n) scanf("%d",&n)
#define lscn(n) scanf("%lld",&n)
#define lpri(n) printf("%lld",n)
#define pri(n) printf("%d",n)
#define pln() printf("\n")
#define priln(n) printf("%d\n",n)
#define lpriln(n) printf("%lld\n",n)
#define rep(i,init,n) for(int i=init;i<n;i++)
#define pb push_back     
#define mp make_pair
#define F first
#define S second
#define gcd __gcd
#define inf INT_MAX
#define ninf INT_MIN
const ll mod=1e9+7;         
const int N=3e3+4;

ll a[N];

//dp[i][j] tells the maximum value first player can take,
//if we the range is i to j and first player starts the game

ll dp[N][N];

int main()                  
{
    int n;
    
    scn(n);
    
    ll sum=0;
    
    rep(i,0,n)
    {
        lscn(a[i]);
        
        sum+=a[i];  dp[i][i]=a[i];
    }
    
    rep(i,0,n-1)
    dp[i][i+1]=max(a[i],a[i+1]);
    
    for(int len=3;len<=n;len++)
    {
        for(int i=0;i+len-1<n;i++)
        {
            int j=i+len-1;
            
            ll x=a[i]+min(dp[i+1][j-1],dp[i+2][j]);
            
            ll y=a[j]+min(dp[i+1][j-1],dp[i][j-2]);
            
            dp[i][j]=max(x,y);
        }
    }
    
    ll player_1,player_2;
    
    player_1=dp[0][n-1];
    
    player_2=sum-player_1;
    
    ll ans=player_1-player_2;
    
    printf("%lld",ans);
} 


Measured memory_bytes: 70016
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String args[]) {
		FastScanner scanner = new FastScanner();
		int t=scanner.nextInt();
		int x=scanner.nextInt();
		System.out.println((double)t/x);
	}
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}


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

int main(){
  string S;
  bool b=1;
  cin >> S;
  sort(S.begin(),S.end());
  for(int i=0;i<S.size()-1;++i){
    if(S.at(i)==S.at(i+1)){
      b=0; break;
    }
  }
  if(b){
    cout << "yes" << endl;
  }else{
    cout << "no" << endl;
  }
}


Measured memory_bytes: 256
import java.util.Scanner;
   
class Main{
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
   
        int i;
        int[] height = new int[10];
        int[] h = new int[]{0, 0, 0};
        for(i = 0; i < 10; i++){
            height[i] = stdIn.nextInt();
   
            if(h[0] <= height[i]){
                h[2] = h[1];
                h[1] = h[0];
                h[0] = height[i];
            } else if(h[1] <= height[i]) {
                h[2] = h[1];
                h[1] = height[i];
            } else if(h[2] <= height[i])
                h[2] = height[i];
        }
   
        for(int j = 0; j < 3; j++)
            System.out.println(h[j]);
    }
}

Measured memory_bytes: 26096
#include<bits/stdc++.h>
#define ll long long
#define inf 9999999999999999
#define F first
#define S second
#define eb emplace_back
#define mpp make_pair
#define P(x) cout<<__LINE__ <<": "<<#x<<' '<<(x)<<'\n'
#define dbg cout<<__LINE__ <<": 0manush\n"
#define read(x) freopen("input.txt","r",stdin)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pi 2*acos(0.0)
#define ee exp(1)
#define mx 50000
#define mod 1000000007
using namespace std;

int main(){//read(x);
//fast;
ll r,g,h,i,j,x,t,y,z=0,e,f,a,b,c,d,n,m,l,k;
cin>>n;
c=0;l=0;
for(i=1;i<=n;i++){
    cin>>a>>b;
    if(a==b)c++;
    else c=0;
//    cout<<i<<' '<<c<<endl;
    if(c>=3)l++;
}
if(l==0)cout<<"No\n";
else cout<<"Yes\n";
}





















Measured memory_bytes: 3632
/** source code by coolreshab **/

#include<bits/stdc++.h>
using namespace std;

#define MAX 100000
#define MAX1 100000
#define inf 1000000000
#define mod 1000000007
#define ll long long

int deg[5];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
   
    //begin
    int i,u,v,one,two;
    for(i=1;i<4;++i)
    {
        cin>>u>>v;
        deg[u]++;
        deg[v]++;
    }
    one=two=0;
    for(i=1;i<=4;++i)
    {
        if(deg[i]==1)
            one++;
        else if(deg[i]==2)
            two++;
        else
            break;
    }
    if(i==5)
    {
        if(one==2 and two==2)
            cout<<"YES";
        else
            cout<<"NO";
    }
    else
        cout<<"NO";
    //end

    return 0;
}


Measured memory_bytes: 256
import Control.Applicative
import Control.Monad
import Control.Monad.ST
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import qualified Data.Foldable as Foldable
import qualified Data.Set as Set
--import qualified Data.Sequence as Sequence
import Data.List.Split
import Data.Bits
import Data.Char
import Data.Ix
import Data.Ratio
import Data.Ord
import Data.Tuple
--import Data.Array
--import Data.Array.Unboxed
import Data.Array.IArray
import Data.Array.MArray
import Data.Array.IO
import Data.Array.ST
import Data.IORef
import Data.STRef
-- import System.IO.Unsafe

-- templete
readInt = read :: String -> Int
readInteger = read :: String -> Integer
readDouble = read :: String -> Double
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
getInteger = readLn :: IO Integer
getIntegers = map readInteger . words <$> getLine
getDouble = readLn :: IO Double
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
apply2 :: (a -> a -> b) -> [a] -> b
apply2 f [x,y] = f x y
apply3 :: (a -> a -> a -> b) -> [a] -> b
apply3 f [x,y,z] = f x y z
apply4 :: (a -> a -> a -> a -> b) -> [a] -> b
apply4 f [x,y,z,w] = f x y z w
fnTuple :: (a -> b, a -> c) -> a -> (b, c)
fnTuple (f,g) a = (f a, g a)
replace :: (Eq a) => a -> a -> [a] -> [a]
replace x y = map (\z -> if z==x then y else z)
binMap :: (a -> a -> b) -> [a] -> [b]
binMap f (x:xs@(y:_)) = f x y : binMap f xs
binMap _ _ = []
splitRec :: Int -> [a] -> [[a]]
splitRec _ [] = []
splitRec n xs = let (y,ys) = splitAt n xs in y : splitRec n ys
infixl 7 `divCeil`
divCeil :: Integral a => a -> a -> a
x `divCeil` y = (x+y-1) `div` y
-- templete

calc ts = sum $ map (sin . (*pi) . (/180.0) . fromIntegral) (360 - sum ts:ts)


main = do
    m <- getInt
    when (m/=0) $ do
        u <- replicateM (m-1) getInt
        n <- getInt
        v <- replicateM (n-1) getInt
        print $ (`mod` 3) $ subtract 1 $ fromEnum $ compare (calc u) (calc v)
        main




Measured memory_bytes: 4368
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

class UnionFind:
    def __init__(self, n):
        # 初期状態は全要素が根なので、親は自分自身
        self.par = [i for i in range(n+1)]
        # 集団の要素数(size)を格納する(初期は全て1)
        self.size = [1] * (n+1)
    
    # 根を検索する関数
    def find(self, x):
        # 根までたどったらその番号を返す
        if self.par[x] == x:
            return x
        # 根でないなら親の要素で再検索
        else:
            # 検索過程で親を書き換える(圧縮経路)
            self.par[x] = self.find(self.par[x])
            return self.find(self.par[x])
  
    # 結合(unite)する関数
    def unite(self, x, y):
        # 根を探す
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        # サイズを比較し、小さい方を大きい方に繋げる
        if self.size[x] < self.size[y]:
            self.par[x] = y
            self.size[y] += self.size[x]
        else:
            self.par[y] = x
            self.size[x] += self.size[y]
           
    # 同じグループに属するかを判定する関数
    def is_same(self, x, y):
        return self.find(x) == self.find(y)
    
    # 要素が属する木のサイズを返す関数
    def get_size(self, x):
        return self.size[self.find(x)]
    
    # グループ数を返す関数
    def group_sum(self):
        c = 0
        for i in range(len(self.par)):
            if self.find(i) == i:
                c += 1
        return c
    

def main():
    N,M,*ab = map(int, read().split())

    E = []
    for a, b in zip(*[iter(ab)]*2):
        E.append((a, b))

    ans = 0
    for i in range(M):
        # i番目以外をつなぐ
        uf = UnionFind(N)
        for j, (a, b) in enumerate(E):
            if j == i:
                continue
            uf.unite(a, b)
        if uf.get_size(E[i][0]) + uf.get_size(E[i][1]) == N:
            ans += 1
    
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, n) for (int i = 1; i <= (n); i++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
using ll = long long;
using Grid = vector<vector<int>>;
using vi = vector<int>;

int main() {
    int N, K;
    cin >> N >> K;
    vi v(N);
    rep(i, N) cin >> v[i];
    ll ans = 0;

    rep(l, min(N, K)+1) {
        rep(r, min(N - l, K - l)+1) {
            if (l + r == 0)
                continue;
            vi a;
            a.reserve(l + r);
            rep(i, l) a.push_back(v[i]);
            rep(i, r) a.push_back(v[N - 1 - i]);
            sort(rall(a));
            int back = min(K - l - r, l + r);
            while (back > 0 && (*a.rbegin()) < 0)
                a.pop_back(), back--;
            ans = max(ans, accumulate(all(a), 0ll));
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
int main() {
  string t;
  cin >> t;
  int size = t.size();
  for(int i = 0; i < size; i++){
    if(t.at(i) == '?') {
      t.at(i) = 'D';
    }
  }
  cout << t;
}

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

int main() {
  int N, M;
  cin >> N >> M;
  
  bool nothing = false;
  vector<int> num(N);
  for(int i = 0; i< N; i++)
  {
    num.at(i) = 10; // 初期化
  }
  for(int i = 0; i < M ; i++)
  {
    int s,c;
    cin >> s >> c;
    if((N== 3|| N== 2) && s == 1 && c == 0)
    {
      nothing = true; break; // 2桁以上で1桁目が0
    }
    if(num.at(s-1) != 10  && num.at(s-1) != c)
    {
      nothing = true; break;
    }
    num.at(s-1) = c;
  }
  
  if(nothing)
  {
    cout << "-1"<< endl;
  }
  else
  {
    if(N == 1)
    {
      if(num.at(0) == 10){num.at(0) = 0;}
      cout << num.at(0) << endl;
    }
    else if( N == 2)
    {
      if(num.at(0) != 10 && num.at(1) == 10)
      {
        num.at(1) = 0;
        cout << num.at(0) << num.at(1) << endl;
      }
      else if(num.at(0) == 10 && num.at(1) != 10)
      {
        num.at(0) = 1;
        cout << num.at(0) << num.at(1) << endl;
      }
      else if(num.at(0) == 10 && num.at(1) == 10)
      {
        cout << 1 << 0 << endl;
      }
      else
      {
        cout << num.at(0) << num.at(1) << endl;
      }
    }
    else if(N==3)
    {
      if(num.at(0) != 10 && num.at(1) == 10 && num.at(2) == 10)
      {
        num.at(1) = 0;
        num.at(2) = 0;
        cout << num.at(0) << num.at(1)<< num.at(2) << endl;
      }
      else if(num.at(0) == 10 && num.at(1) != 10 && num.at(2) == 10)
      {
        num.at(0) = 1;
        num.at(2) = 0;
        cout << num.at(0) << num.at(1) << num.at(2) <<endl;
      }
      else if(num.at(0) == 10 && num.at(1) == 10 && num.at(2) != 10)
      {
        num.at(0) = 1;
        num.at(1) = 0;
        cout << num.at(0) << num.at(1) << num.at(2) <<endl;
      }
      else if(num.at(0) != 10 && num.at(1) != 10 && num.at(2) == 10)
      {
        num.at(2) = 0;
        cout << num.at(0) << num.at(1) << num.at(2) <<endl;
      }
      else if(num.at(0) != 10 && num.at(1) == 10 && num.at(2) != 10)
      {
        num.at(1) = 0;
        cout << num.at(0) << num.at(1) << num.at(2) <<endl;
      }
      else if(num.at(0) == 10 && num.at(1) != 10 && num.at(2) != 10)
      {
        num.at(0) = 1;
        cout << num.at(0) << num.at(1) << num.at(2) <<endl;
      }
      else if(num.at(0) == 10 && num.at(1) == 10 && num.at(2) == 10)
      {
        num.at(0) = 1;
        num.at(1) = 0;
        num.at(2) = 0;
        cout << num.at(0) << num.at(1) << num.at(2) <<endl;
      }
      else
      {
        cout << num.at(0) << num.at(1) << num.at(2) << endl;
      }
    }
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>

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

using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define P pair<ll, ll>
#define sz(x) (ll)x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<ll>
#define COUT(x) cout<<(x)<<endl
#define MA map<ll,ll>
#define SE set<ll>
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,VE,greater<ll>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl

ll gcd(ll a, ll b) {
	if (a < b)swap(a, 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;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}


const long long MOD = 1000000007;
const long long INF = 1e9;
const long long LINF = 1LL << 50;
#define int long long
int dp[55][55][3010];
signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, a; cin >> n >> a;
	VE x(n); rep(i, n)cin >> x[i];
	int X = 0;
	rep(i, n) {
		chmax(X, x[i]);
	}
	chmax(X, a);
	rep(i, 55)rep(j, 55)rep(k, 3010)dp[i][j][k] = 0;
	rep(j, n+1) {
		rep(k, n+1) {
			rep(s, n*X+1) {
				if (j == 0 && k == 0 && s == 0) {
					dp[j][k][s] = 1;
				}
				else if (j >= 1 && s < x[j-1]) {
					dp[j][k][s] = dp[j - 1][k][s];
				}
				else if (j >= 1 && k >= 1 && s >= x[j-1]) {
					dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j-1]];
				}
				else {
					dp[j][k][s] = 0;
				}
			}
		}
	}
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		ans += dp[n][i][i*a];
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 71424
// inputに入力データ全体が入る
function Main(input) {
	var line = input.split("\n");
	var tmp = line[0].split(" ");
	var N = Number(tmp[0]);
	var M = Number(tmp[1]);
	var ans = Math.abs((M-2)*(N-2));
	if(ans > 1000000000000000){
		var MM = M-2;
		var NN = N-2;
		var MMtop = Math.floor(MM/10000);
		var MMbottom = MM%10000;
		var NNtop = Math.floor(NN/10000);
		var NNbottom = NN%10000;
		var MN1 = MMtop * NNtop;
		var MN2 = MMbottom * NNtop + NNbottom * MMtop;
		var MN3 = MMbottom * NNbottom;
		var MNbottom = (MN2 + Math.floor(MN3/10000)) + "";
		MNbottom += ("00000" + MN3%10000).slice(-4);
		var ans = (MN1 + Math.floor(Number(MNbottom)/100000000)) + "";
		ans += ("000000000" + MNbottom%100000000).slice(-8);
	}
	console.log(ans);
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

int n;
int s = 0;
string ans;

int main() {
    cin >> n;

    int i = n;
    while(i > 0) {
        s += i%10;
        i /= 10;
    }

    if (n%s == 0)
    {
        ans = "Yes";
    } else {
        ans = "No";
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
//#pragma once
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <numeric>

using namespace std;
#define modd 1000000007


typedef pair<long long, long long> pl;



#define ll long long




/*
class UnionFind {
public:
	vector <ll> par; 
	vector <ll> siz;
	vector <ll> gr;

	// Constructor
	UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) ,gr(sz_){
		for (ll i = 0; i < sz_; ++i) par[i] = i; 
	}
	void init(ll sz_) {
		par.resize(sz_);
		siz.assign(sz_, 1LL);  // resize だとなぜか初期化されなかった
		for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
	}

	// Member Function
	// Find
	ll root(ll x) { // 根の検索
		while (par[x] != x) {
			x = par[x] = par[par[x]]; // x の親の親を x の親とする
		}
		return x;
	}

	// Union(Unite, Merge)
	bool merge(ll x, ll y) {
		x = root(x);
		y = root(y);
		if (x == y) return false;

		// merge technique（データ構造をマージするテク．小を大にくっつける）
		if (siz[x] < siz[y]) swap(x, y);
		siz[x] += siz[y];
		par[y] = x;
		return true;
	}



	bool issame(ll x, ll y) { // 連結判定
		return root(x) == root(y);
	}

	ll size(ll x) { // 素集合のサイズ
		return siz[root(x)];
	}


};*/


long long N, M, K, a, b, c, d, e,H, W;
long long A[200000]= {};
long long B[2][100000] = {};
long long C[20][200] = {};
bool f, ff;
string S[200];
set <long long>sll;
pl bufpl;
vector <long long>vl[100005];
vector <pl>vpl[100005];
vector <string> vs;
set<ll> llset;

struct ST
{
	long long hajime;
	long long owari;
	long long zahyou;
	int bangou;

	bool operator<(const ST& another) const
	{
		return hajime < another.hajime;//年齢を比較
	};

};



vector <ST> vst;
ST st[200005];



int main() {

	cin >> N;

	cout << (N-2)*180<<endl;

	
	return 0;

}


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

using namespace std;

int main() {
	int n;
	cin >> n;
	long long ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			for (int k = 1; k <= n; k++) {
				ans += __gcd(i, __gcd(j, k));
			}
		}
	}
	cout << ans << "\n";
	return 0;
}


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

template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }

constexpr int MAX_N = 100;
constexpr int INF = (1 << 29);
int dist[MAX_N][MAX_N];

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

	for(int n, m, s, g1, g2; cin >> n >> m >> s >> g1 >> g2 && n;) {
		--s; --g1; --g2;
		fill_n((int *)dist, sizeof(dist) / sizeof(int), INF);

		for(int i = 0; i < n; ++i) {
			dist[i][i] = 0;
		}

		for(int i = 0; i < m; ++i) {
			int from, to, cost;
			cin >> from >> to >> cost;
			dist[from - 1][to - 1] = cost;
		}

		for(int k = 0; k < n; ++k) {
			for(int i = 0; i < n; ++i) {
				for(int j = 0; j < n; ++j) {
					chmin(dist[i][j], dist[i][k] + dist[k][j]);
				}
			}
		}

		int ans = INF;
		for(int i = 0; i < n; ++i) {
			chmin(ans, dist[s][i] + dist[i][g1] + dist[i][g2]);
		}

		assert(ans != INF);
		cout << ans << endl;
	}

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1236
#include<iostream>
#include<vector>
#include<algorithm>
#define INF 1e9

using namespace std;
int main(){

  int n,m;
  cin >>n>>m;

  int dp[n+1];
  int coin[m];

  for(int i=0 ; i < m ; i++)cin >>coin[i];

  for(int i=0 ; i < n+1 ; i++)dp[i]=INF;
  dp[0]=0;
  
  for(int i=0 ; i < m ; i++){
    for(int j=coin[i] ; j <= n+1 ; j++){
      dp[j]=min(dp[j],dp[j-coin[i]]+1);
    }
  }
  
  cout <<dp[n]<<endl;
  
  return 0;
}

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

int main(){
 int n;
 cin >> n;
 vector<int> p(n);
  for(int i=0;i<n;i++) cin >> p[i];
 int m = p[0];
 int ans = 1;
 for(int i=1;i<n;i++){
    m = min(m, p[i-1]);
    if(p[i]<= m) ans++;
 }  
 cout << ans << endl;
 return 0;
}

Measured memory_bytes: 1024