akhauriyash/Code-Regression huggingface dataset:
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#include <bitset>
#include <functional>
#include <cassert>

#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll conbinationMemo[100][100];

void cmemoInit(){
    rep(i, 100){
        rep(j, 100){
            conbinationMemo[i][j] = -1;
        }
    }
}
 
ll nCr(ll n, ll r){
    if(conbinationMemo[n][r] != -1) return conbinationMemo[n][r];
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return conbinationMemo[n][r] = (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
//-----------------------ここから-----------
ll factorial[2010000];
ll invfactorial[2010000];

ll extGCD(ll a, ll b, ll &x, ll &y){
	if (b == 0){
		x = 1;
		y = 0;
		return a;
	}
 
	ll d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}

ll nCrM(ll n, ll r){
	ll ret = factorial[n];
	ret *= invfactorial[n - r];
	ret %= MOD;
	ret *= invfactorial[r];
	ret %= MOD; 
	return ret;
}

ll modpow(ll a, ll b){
    ll res = 1;
    while(b > 0){
        if(b & 1){
            res *= a;
            res %= MOD;
        }
        a *= a;
        a %= MOD;
        b >>= 1;
    }
    return res;
}
int main(void){
    ll k;
    string s;
    cin >> k >> s;

    factorial[0] = 1;

    for (int i = 1; i < 2010000; i++){
        factorial[i] = (factorial[i - 1] * i) % MOD;
    }
    for (int i = 0; i < 2010000; i++){
        ll x, y;
        ll g = extGCD(factorial[i], MOD, x, y);
        while (x < 0) x += MOD;
        x %= MOD;
        invfactorial[i] = x;
    }

    ll ans = 0;
    for(ll i = 0; i <= k; i++){
        ans += modpow(26, i) * modpow(25, k - i) % MOD * nCrM(s.size() + k - i - 1, s.size() - 1);
        ans %= MOD;
    }

    cout << ans << endl;
}


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

int main() {
    int a, b;
    cin >> a >> b;
    if (a < b) {
        cout << "a < b" << endl;
    } else if (a > b) {
        cout << "a > b" << endl;
    } else {
        cout << "a == b" << endl;
    }
    return 0;
}


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

int main(void){
    string str;
    cin >> str;
    int cnt = 0;
    for(int i=0;i<str.size()-1;++i){
        if(str[i]!=str[i+1]) ++cnt;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 512
s = input()

if (int(s[0:2]) == 0 or int(s[0:2]) > 12) and 0<int(s[2:4])<13:
  print('YYMM')
elif (int(s[2:4]) == 0 or int(s[2:4]) > 12) and 0<int(s[0:2])<13:
  print('MMYY')
elif 0<int(s[0:2])<13 and 0<int(s[2:4])<13:
  print('AMBIGUOUS')
else:
  print('NA')

Measured memory_bytes: 3064
import java.io.*;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int x, i = 1;
		Scanner sc = new Scanner(System.in);
		
		while(true) {
			x = sc.nextInt();
			if(x==0) break;
			System.out.println("Case "+ i++ + ": " + x);
		}
	}
}

Measured memory_bytes: 42544
//
// Created by yamunaku on 2020/01/13.
//

#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repl(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perl(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD9 998244353
#define MOD1 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)
#define CST(x) cout<<fixed<<setprecision(x)

using ll = long long;
using ld = long double;
using vi = vector<int>;
using mti = vector<vector<int>>;
using vl = vector<ll>;
using mtl = vector<vector<ll>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
template<typename T>
using heap = priority_queue<T, vector<T>, function<bool(const T, const T)>>;

int main(){
    // CFS;
    char c;
    cin >> c;
    cout << (char)(c+1) << endl;
    return 0;
}

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

int main(){
    int N;
    cin >> N;
    int ans = -1;
    for (int i = 0; i <= N; i++) {
        double X = (double)i;
        int cost = floor(X*1.08);
        if (cost == N) {
            ans = X;
        }
    }
    
    if (ans == -1) {
        cout << ":(" << endl;
    } else {
        cout << ans << endl;
    }
}

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

#define ASC(vec) vec.begin(), vec.end()    // 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend() // 降順ソート 例：sort(DESC(vec));
#define rep(i, n) for (int i = 0; i < (n); i++)
#define Rep(i, n) for (int i = 1; i < n; i++)
#define REP(i, vec) for (auto i = vec.begin(); i != vec.end(); ++i)

const int       mod = 1000000007;
const int       inf = (1 << 21);
const long long INF = 1LL << 60;

using ii = pair<int, int>;
using ll = long long;
using vi = vector<int>;
using vd = vector<double>;
using vb = vector<bool>;
using vl = vector<ll>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvb = vector<vector<bool>>;
using vii = vector<pair<int, int>>;
using vll = vector<pair<ll, ll>>;

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; }
template<class T>
T GCD(T a, T b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}
template<class T>
T LCM(T a, T b) {
	return a / GCD(a, b) * b;
}
template<class T>
inline T upper(T a, T b) {return (a + (b - 1)) / b; }

constexpr array<int, 9> dx = { 0, 1, 0, -1, -1, 1, 1, -1, 0 };
constexpr array<int, 9> dy = { 1, 0, -1, 0, 1, 1, -1, -1, 0 };

// ──────────────────────────────────────────────────────────────────

constexpr int MAX = 100010;

ll n, c, x[MAX], v[MAX], a[MAX], y[MAX], b[MAX], d[MAX];

ll solve() {
	a[0] = v[0];
	Rep(i, n) a[i] = a[i - 1] + v[i];

	rep(i, n) y[i] = c - x[i];
	b[n - 1] = v[n - 1];
	for (int i = n - 2; i >= 0; i--) b[i] = b[i + 1] + v[i];

	d[n - 1] = b[n - 1] - y[n - 1];
	for (int i = n - 2; i >= 0; i--) {
		d[i] = b[i] - y[i];
		chmax(d[i], d[i + 1]);
	}

	ll ans = 0;
	rep(i, n) {
		ll sm = 0;

		sm -= x[i];
		sm += a[i];
		chmax(ans, sm);

		sm -= x[i];
		if (i < n - 1) sm += d[i + 1];
		chmax(ans, sm);
	}
	return ans;
}

int main() {
	cin >> n >> c;

	rep(i, n) {
		cin >> x[i] >> v[i];
	}

	ll ans = 0;
	chmax(ans, solve());

	reverse(v, v + n);
	rep(i, n) x[i] = c - x[i];
	reverse(x, x + n);

	chmax(ans, solve());
	cout << ans << endl;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
#define repex(i, a, b, c) for(int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
char T[101010];
int win[101010];

int main(){
    
    // 1. 入力情報.
    int N, K, R, S, P;
    scanf("%d %d %d %d %d", &N, &K, &R, &S, &P);
    scanf("%s", T);
    
    // 2. 勝利時の得点を集計.
    rep(i, N){
        if(T[i] == 'r') win[i] = P;
        if(T[i] == 's') win[i] = R;
        if(T[i] == 'p') win[i] = S;
    }
    
    // 3. 条件を満たすように得点を抽出.
    // -> K回前と同じだったら, 得点を加算しない.
    int ans = 0;
    rep(i, K) ans += win[i];
    repx(i, K, N){
        if(T[i] == 'r'){
            if(T[i - K] != 'r' || win[i - K] == 0) ans += P;
            else                                   win[i] = 0;
        }
        if(T[i] == 's'){
            if(T[i - K] != 's' || win[i - K] == 0) ans += R;
            else                                   win[i] = 0;
        }
        if(T[i] == 'p'){
            if(T[i - K] != 'p' || win[i - K] == 0) ans += S;
            else                                   win[i] = 0;
        }
    }
    
    // 4. 出力.
    printf("%d\n", ans);
    return 0;
    
}

Measured memory_bytes: 768
n=int(input())
a=list(map(int,input().split()))

kouho=[]

#奇数番目までの和を0以上にする場合
ans=0
cumsum=0
for i in range(n):
  cumsum+=a[i]
  if i%2:
    if cumsum<=0:
      ans+=abs(0-cumsum)+1
      cumsum=1
  elif not i%2:
    if cumsum>=0:
      ans+=(cumsum+1)
      cumsum=-1
kouho.append(ans)

ans=0
cumsum=0

#偶数番目の累積和を0より大きくしたい場合
for i in range(n):
  cumsum+=a[i]
  if not i%2:
    if cumsum<=0:
      ans+=abs(0-cumsum)+1
      cumsum=1
  elif i%2:
    if cumsum>=0:
      ans+=(cumsum+1)
      cumsum=-1
kouho.append(ans)
print(min(kouho))

Measured memory_bytes: 14468
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define PI 3.141592
#define MOD7 1000000007
#define LL_INF 9000000000000000000
#define LL_MINF -9000000000000000000
#define INT_INF 2000000000
#define INT_MINF -2000000000
#define all(a) (a).begin(), (a).end()
#define fi first
#define se second
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int main(){
    int N;
    cin >> N;
    string S;
    cin >> S;
    vector<int> E(N, 0), W(N, 0);
    if(S[0] == 'E') E[0] = 1;
    else W[0] = 1;
    for(int i = 1; i < N; i++){
        if(S[i] == 'E') {
            E[i] = E[i - 1] + 1;
            W[i] = W[i - 1];
        }else{
            E[i] = E[i - 1];
            W[i] = W[i - 1] + 1;
        }
    }
    // for(int e : E) cout << e;
    // cout << endl;
    // for(int w : W) cout << w ;
    int min_n = INT_INF;
    for(int i = 0; i < N; i++){
        int left = 0, right = 0;
        if(i == 0) left = 0;
        else{
            left = W[i - 1];
        }
        if(i == N - 1) right = 0;
        else{
            right = E.back() - E[i];
        }
        min_n = min(min_n, left + right);
    }
    cout << min_n << endl;
}

Measured memory_bytes: 6140
#include<bits/stdc++.h>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define rrep(i,a) for(int i=(int)a-1;i>=0;--i)
#define REP(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RREP(i,a,b) for(int i=(int)a-1;i>=b;--i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
typedef std::vector<int> vi;
typedef std::vector<std::vector<int>> vvi;
typedef std::vector<long long> vl;
typedef std::vector<std::vector<long long>> vvl;
#define out(x) cout<<x<<"\n";
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;
 
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;
}


ll gcd(ll n, ll m) {
    ll tmp;
    while (m!=0) {
        tmp = n % m;
        n = m;
        m = tmp;
    }
    return n;
}
 
ll lcm(ll n, ll m) {
    return abs(n) / gcd(n, m)*abs(m);//gl=xy
}

using namespace std;

void solve()
{
	double r;
	cin >> r;
	cout << 2 * r * acos(-1.0);
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(15);
    solve();
    return 0;
}


Measured memory_bytes: 3744
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define PP pair<P,P>
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mkt make_tuple
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;
template<class T> inline void chmax(T& a, T b) { a = max(a, b); }
template<class T> inline void chmin(T& a, T b) { a = min(a, b); }

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x > 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}
int get_rand(int MIN, int MAX) {
	random_device rnd;
	mt19937_64 mt64(rnd());
	uniform_int_distribution<int>engine(MIN, MAX);
	return engine(mt64);
}
/*--------Library Zone!--------*/

int n;
P p[222222];
stack<int>st;
signed main() {
	cin >> n;
	rep(i, n) {
		cin >> p[i].first; p[i].second = 0;
	}
	rep(i, n) {
		cin >> p[n + i].first; p[n + i].second = 1;
	}
	sort(p, p + 2 * n);
	int ans = 1;
	rep(i, 2 * n) {
		if (st.empty())st.push(p[i].second);
		else if (st.top() != p[i].second) {
			ans *= st.size(); st.pop();
		}
		else {
			st.push(p[i].second);
		}
		ans %= mod;
	}
	cout << ans << endl;
}

Measured memory_bytes: 4224
#include<iostream>
#include<vector>

using namespace std;

int main() {
	int n;
	cin >> n;
	vector<int> v(n), c(n);
	for (int i = 0; i < n; i++) {
		cin >> v[i];
	}
	for (int i = 0; i < n; i++) {
		cin >> c[i];
	}
	int x = 0, y = 0;
	for (int i = 0; i < n; i++) {
		if (v[i] > c[i]) {
			x += v[i];
			y += c[i];
		}
	}

	cout << x - y << endl;

	return 0;
}

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

#define froop1(a,n) for(long long i = a;i < n;i++)
#define froop2(a,n) for(int i = a;i > n;i--)
int main(){
	long long N,sum = 0;
  cin >> N;
  froop1(1,N + 1){
	for(int j = 1;j <= N;j++){
		for(int k = 1;k <= N;k++){
          sum += gcd(i,gcd(j,k));
		}
	}
  }
  cout << sum << endl;

}

Measured memory_bytes: 3620
#include "bits/stdc++.h"
using namespace std; 
#define LIM 100003

#define M 1000000007
#define inf 99999999999999999LL	//long long inf
typedef long long ll;

#define sc(x) scanf("%d",&x);
#define sc2(x,y) scanf("%d%d",&x,&y);
#define sc3(x,y,z) scanf("%d%d%d",&x,&y,&z);
#define scl(x) scanf("%lld",&x);
#define scl2(x,y) scanf("%lld%lld",&x,&y);
#define scl3(x,y,z) scanf("%lld%lld%lld",&x,&y,&z);

#define pb push_back
#define mp make_pair
#define fi first
#define se second 
ll power(ll x,ll y,ll z) {	ll ret = 1;	while(y > 0) {	if(y & 1) ret = (ret*x)%z;x = (x*x)%z;y >>= 1;}return ret;}


#define debug(x) cerr<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cerr<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define debug3(x,y,z) cerr<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";
#define debug4(x,y,z,a) cerr<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\t"<<#a<<" :: "<<a<<"\n";



ll n, arr[LIM][3], dp[LIM][3] ;
ll doit(ll ind, ll last) {
	if(ind > n)
		return 0;
	ll &dpAnswer = dp[ind][last] ;
	if( dpAnswer != -1 )
		return dpAnswer ;
	ll answer = 0 ;
	for(ll i=0; i<3;i++) {
		if(last == i)
			continue;
		answer = max(answer, arr[ind][i]+doit(ind +1, i)) ;
	}
	return dpAnswer = answer ;
}
ll doit1() {
	ll maxi = 0, i, j, k;
	for(i=1; i<=n; i++) {

		for(j=0 ;j<3; j++) {

			for(k=0; k <3; k++) {
				if(k != j )
					dp[i][j] = max(dp[i][j], arr[i][j] + dp[i-1][k]) ;
			}
		}
	}
	return max(dp[n][0], max(dp[n][1], dp[n][2])) ;
}
int main() {
	int i, j, t;
	scl(n) ;
	for(i=1; i<=n; i++)
		scl3(arr[i][0], arr[i][1], arr[i][2]) ;
	ll answer = doit1() ;
	cout << answer << endl ;
	return 0;
}




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

int main() {
    string S;
    string alp="abcdefghijklmnopqrstuvwxyz";
    cin >> S;
	for(int i=0; i<S.size();++i){
      if(alp.find(S[i]) != string::npos) alp.erase(alp.find(S[i]),1);
    }
    if(alp.size() == 0 ) cout << "None" << endl;
    else  cout << alp[0] << endl;
}

Measured memory_bytes: 512
package main

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

func main() {
	io := NewIo()
	defer io.Flush()
	for {
		n, l, r := io.NextInt(), io.NextInt(), io.NextInt()
		if n == 0 {
			break;
		}
		A := make([]int, n)
		for i := 0; i < n; i++ {
			A[i] = io.NextInt()
		}
		cnt := 0
		for x := l; x <= r; x++ {
			for i := 0; i < n; i++ {
				if x%A[i] == 0 {
					if i%2 == 0 {
						cnt++
					}
					goto SKIP
				}
			}
			if n%2 == 0 {
				cnt++
			}
		SKIP:
		}
		io.Println(cnt)
	}
}

// I/O template
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buff []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buff = append(buff, line...)
		if !isPrefix {
			break
		}
	}
	return string(buff)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	s := io.tokens[io.nextToken]
	io.nextToken++
	return s
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintIntSlice(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func (io *Io) PrintStringSlice(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func Log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}

func ExampleIo() {
	io := NewIo()
	defer io.Flush()
	a := make([]int, 0, 3)
	a[0], a[1], a[2] = io.NextInt(), io.NextInt(), io.NextInt()
	io.Println(a)
	io.PrintIntSlice(a)
	Log("io", a)
}



Measured memory_bytes: 1208
#include<stdio.h>
int main()
{
   int a,b;
   char op;
   scanf("%d %c %d",&a,&op,&b);

    if(op=='+'){
        printf("%d",a+b);
    }
    else if(op=='-'){
       printf("%d",a-b);
    }
    else{
        printf("\n");
    }
    return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using Int = long long;
Int INF = 1 << 30;

int main() {
	Int N;
	std::cin >> N;

	std::string s;
	std::cin >> s;

	std::vector<Int> W(N);//0-iでWを向いている人
	std::vector<Int> E(N);//0-iでEを向いている人

	Int res = 0;
	for (Int i = 0; i < N; i++) {
		if (s[i] == 'W')res++;
		W[i] = res;
	}

	for (Int i = 0; i < N; i++) {
		E[i] = (i + 1) - W[i];
	}

	Int ans = INF;
	for (Int i = 0; i < N; i++) {
		if (i != 0 && i != N-1) {
			ans = std::min(ans, W[i - 1] + E[N - 1] - E[i]);
		}

		if (i == 0) {
			ans = std::min(ans,E[N-1]-E[0]);
		}
		if (i == N-1) {
			ans = std::min(ans,W[N-2]);
		}
	}
	std::cout << ans << std::endl;
}

Measured memory_bytes: 5380
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cstdio>
#include <list>
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tii tuple<int,int,int>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define edge(v,a,b) v[a].pb(b);v[b].pb(a);
#define vec vector<int>
#define vecll vector<ll>
#define vecstr vector<string>
#define vecch vector<char>
#define vecpii vector<pii>
#define bs binary_search
#define All(c) (c).begin(),(c).end()
using namespace std;
int in(){int x;scanf("%d",&x);return x;}
string stin(){string s;cin>>s;return s;}
ll lin(){ll x;scanf("%lld",&x);return x;}

int main(){
    int a=in(),b=in(),t=in();
    cout<<t/a*b<<endl;
}

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

#define rep(i,n) for(int i=0; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()

using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;

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; }

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

const int INF = 0x3fffffff;


ll dp[55][55][3005]={};
int main(){
	ll N, A, ans=0;

	cin >> N >> A;
	ll x[55];
	rep(i,N){
		cin >> x[i];
	}

	dp[0][0][0] = 1;
	rep(i,N) rep(j,N+1) rep(k,3000){
		if( dp[i][j][k] > 0 ){
			dp[i+1][j][k] += dp[i][j][k];
			dp[i+1][j+1][k+x[i]] += dp[i][j][k];
		}
	}
	rep(j,N+1) rep(k,3000){
		//if( k < 5 ) cout << dp[N][j][k] << endl;
		if( j == 0 ) continue;
		if( k == A * j ){
			ans += dp[N][j][k];
		}
	}

	cout << ans << endl;

	return 0;
}


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

using namespace std;

#define DIM 300009
#define INF ((long long)1e18+9ll)
#define pairll pair<long long,long long>
#define fi first
#define se second
#define ld long double
#define amen exit(0)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define endl '\n'
#define MODULO 1000000007

long long i,j,k,l,n,m;

int main()
{   
    fast;

    ld a,b,c;

    cin>>a>>b>>c;

    if(a+b+(ld)2*sqrt(b)*sqrt(a)<c)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;

    amen;
}


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

int main(){
	int money = 100000;
	int n;

	cin >> n;
	for(int i=0 ; i<n ; i++){
		money *= 1.05;
		if(money%1000 != 0){
			money += 1000 - (money%1000);
		}
	}
	cout << money << endl;
} 

Measured memory_bytes: 2992
n=int(input())
R=range(4)
dp=[[[[0]*4for k in R]for j in R]for i in range(n+1)]
dp[0][3][3][3]=1
for i in range(1,n+1):
  for j in R:
    for k in R:
      for l in R:
        for m in R:
          if(2,0,1)!=(k,l,m)!=(0,1,2)!=(k,l,m)!=(0,2,1)!=(j,l,m)!=(0,2,1)!=(j,k,m):dp[i][k][l][m]+=dp[i-1][j][k][l]
print(sum(c for a in dp[n]for b in a for c in b)%(10**9+7))

Measured memory_bytes: 3444
#include <utility>
#include <algorithm>
#include <iostream>

using namespace std;

int N,W;
int val[100+10];
int wei[100+10];
int vmax[100+10][10000+10] = {0};


int main(){
  cin >> N;
  cin >> W;


  for (int i=1;i<=N;++i){
    cin >> val[i];
    cin >> wei[i];
    //cout << val[i] << " " << wei[i] << endl;
  }

  for (int i=0;i<=N;++i){
    for (int c=0;c<=W;++c){
      if(i <= 0 || c <= 0)vmax[i][c] = 0;
      else if(c - wei[i] < 0)vmax[i][c] = vmax[i-1][c];
      else {
	vmax[i][c] = max( (val[i] + vmax[i-1][c-wei[i]]), vmax[i-1][c] );
	vmax[i][c] = max(vmax[i][c] , val[i]+vmax[i][c-wei[i]]);
	
      }
      //cout << vmax[i][c] << " ";
    }
    //cout << endl;
  }
  cout << vmax[N][W] << endl;
}
  

Measured memory_bytes: 7024
#include "iostream"
#include "algorithm"
#include "cstring"
#include "cstdio"
#include "vector"
using namespace std;
#define MAXN 2006
#define P 1000000007
int n;
vector<int> G[MAXN];
int A[MAXN] , F[MAXN] , d[MAXN] , s[MAXN] , siz[MAXN] , S;
void dfs( int u , int fa ) {
    if( A[u] ) s[u] = d[u] , siz[u] = 1; else siz[u] = s[u] = 0;
    int mxp = 0;
    for( int v : G[u] ) if( v != fa ) {
        d[v] = d[u] + 1 , dfs( v , u ) , s[u] += s[v] , siz[u] += siz[v];
        mxp = ( !mxp || s[v] > s[mxp] ) ? v : mxp;
    }
    int sum = s[u] - siz[u] * d[u] , mx = s[mxp] - siz[mxp] * d[u];
    if( sum >= 2 * mx ) F[u] = sum / 2;
    else
        F[u] = sum - mx + min( F[mxp] , ( 2 * mx - sum ) / 2 );
}
int main() {
    cin >> n;
    for( int i = 1 ; i <= n ; ++ i ) scanf("%1d",&A[i]);
    for( int i = 1 , u , v ; i < n ; ++ i ) {
        scanf("%d%d",&u,&v);
        G[u].push_back( v ) , G[v].push_back( u );
    }
    int res = 0x3f3f3f3f;
    for( int i = 1 ; i <= n ; ++ i ) {
        d[i] = 0, dfs( i , i );
        if( ( ~s[i] & 1 ) && F[i] == s[i] / 2 ) res = min( res , s[i] / 2 );
    }
    cout << ( res == 0x3f3f3f3f ? -1 : res ) << endl;
}

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using P = pair<ll, ll>;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
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;
}
struct edge {
  ll to, cost;
};

int main() {
  int N; cin >> N;
  if(N >= 1000) cout << "ABD" << endl;
  else cout << "ABC" << endl;
}

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

char a[ 101 ];
char b[ 101 ];
bool cmp(char x,char y){
	return x > y;
}
int main()
{
	gets(a);
	gets(b);
	int la = strlen(a), lb = strlen( b );
	sort( b , b + lb, cmp);
	sort( a , a + la);
	if(strcmp(a , b ) < 0)cout<<"Yes";
	else cout<<"No";  
	return 0;
}

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

#define forn(i, a, b) for (int i = a; i <= b; ++i)
#define forr(i, a, b) for (int i = a; i >= b; --i)

using namespace std;

const int N = (int)3e5 + 1;
const int INF = 1e9 + 7;

typedef long long ll;
typedef long double ld;

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

int a[4];
int main (){
  scanf ("%d %d %d", &a[1], &a[2], &a[3]);
  sort (a + 1, a + 3 + 1);
  int A = a[1], B = a[2], C = a[3];
  int x = C - B + (B - A) / 2;
  if ((A - B) & 1) x += 2;
  printf ("%d\n", x);
  return 0;
}


Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;

public class Main {

	public static void main(String[] args) {
		Task task = new Task();
		task.solve();
	}

	public static class Task {
		static final long MOD = (long) 1e9 + 7;

		public void solve() {
			Scan sc = new Scan();
			int n = (int) sc.scanLong();
			int k = (int) sc.scanLong();
			long[] arr = new long[n + 1];
			for (int i = 1; i <= n; ++i) {
				arr[i] = sc.scanLong();
			}
			long res = Long.MAX_VALUE;
			for (int i = 1; i <= n; ++i) {
				long base = Math.abs(arr[i]);
				if (i <= n - k + 1) {
					long left = (arr[i + k - 1] - arr[i]);
					res = Math.min(base + left, res);
				}
				if (i >= k) {
					long right = (arr[i] - arr[i - k + 1]);
					res = Math.min(base + right, res);
				}
			}
			System.out.println(res);
		}
	}

	public static class Scan {
		private byte[] buf = new byte[1024];
		private int index;
		private InputStream in;
		private int total;

		public Scan() {
			in = System.in;
		}

		public int scan() {
			if (total < 0)
				throw new InputMismatchException();
			if (index >= total) {
				index = 0;
				try {
					total = in.read(buf);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				if (total <= 0)
					return -1;
			}
			return buf[index++];
		}

		public long scanLong() {
			long integer = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n)) {
				if (n >= '0' && n <= '9') {
					integer *= 10;
					integer += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			return neg * integer;
		}

		public double scanDouble() throws IOException {
			double doub = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n) && n != '.') {
				if (n >= '0' && n <= '9') {
					doub *= 10;
					doub += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			if (n == '.') {
				n = scan();
				double temp = 1;
				while (!isWhiteSpace(n)) {
					if (n >= '0' && n <= '9') {
						temp /= 10;
						doub += (n - '0') * temp;
						n = scan();
					} else
						throw new InputMismatchException();
				}
			}
			return doub * neg;
		}

		public String scanString() {
			StringBuilder sb = new StringBuilder();
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			while (!isWhiteSpace(n)) {
				sb.append((char) n);
				n = scan();
			}
			return sb.toString();
		}

		public char scanChar() {
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			return (char) n;
		}

		private boolean isWhiteSpace(int n) {
			if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1)
				return true;
			return false;
		}
	}
}


Measured memory_bytes: 34352
#include <stdio.h>

int main(void)
{
	int a, b;
	int tmp;

	while (1) {
		scanf("%d %d", &a, &b);

		if (a == 0 && b == 0) {
			break;
		}

		if (a > b) {
			tmp = a;
			a = b;
			b = tmp;
		}

		printf("%d %d\n", a, b);
	}
	
	return 0;
}


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

const int mod = 1000000007;

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main(void) {
  
  int n;
  cin >> n;
  ll a[n];
  rep (i, n) cin >> a[i];

  vector<ll> num(70, 0);

  rep (i, n) rep (j, 66) {
    if (a[i] & (1LL << j)) num[j]++;
  }

  ll ans = 0;

  rep (i, 64) {
    ans += (num[i] * (n - num[i]))%mod * (modpow(2, i, mod))%mod;
    ans %= mod;
  }

  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 2560
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int n = saori.saori_hayami();
		int[] a = new int[n];
		double sum = 0;
		for(int i = 0;i < n;i++){
			a[i] = saori.saori_hayami();
			sum += a[i];
		}
		sum = sum/n;
		double min = MAX;
		int ans = 0;
		for(int i = 0;i < n;i++){
			if(min > Math.abs(a[i]-sum)){
				min = Math.abs(a[i]-sum);
				ans = i;
			}
		}
		System.out.println(ans);
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 32420
#include<iostream>
#include<math.h>
#include<iomanip>
using namespace std;
#define PI 3.14159265358979

int main(void)
{

int N;
string S;


int sum = 1;
cin>>N>>S;

char left = S[0];
for(int i=1;i<N;i++)
{
    if(S[i]!=left) sum++;
    left=S[i];

}
cout<<sum<<endl;
}

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

int main() {
  string s;
  int a, ma = INT_MAX;
  cin >> s;
  REP(i, s.length() - 2) {
    a = stoi(s.substr(i, 3));
    ma = min(abs(a - 753), ma);
  }
  cout << ma << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <deque>
#include <algorithm>
#include <math.h>
#include <random>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define int long long
#define double long double
#define Matrix vector<vector<int> >
#define kektor vector

using namespace std;

typedef long long ll;

int RanddInt(int min, int max) {
  if (max < min) {
    return 0;
  }
  random_device rd;
  mt19937 mt(rd());
  uniform_int_distribution<int> dist(min, max);
  return dist(mt);
}

const int maxn = 1e4, mod = 1e9 + 7;
bool debug = false;
int cnt = 0;
int n;
vector<int> A, B;

void solve()  { 
	cin >> n;
	A.resize(n);
	B.resize(n);
	for (int i = 0; i < n; ++i) {
		cin >> A[i]; 
	} 
	for (int i = 0; i < n; ++i) {
		cin >> B[i]; 
	} 
	for (int i = 0; i < n; ++i) {
		if (A[i] <= B[i]) {
			cnt += (B[i] - A[i]) / 2; 
		}
	}
//	cout << cnt << '\n'; 
	for (int i = 0; i < n; ++i) {
//		cout << max(0ll, A[i] - B[i]) << '\n';
		cnt -= max(0ll, A[i] - B[i]);
	}
	if (cnt < 0) {
		cout << "No"; 
		return;
	}
	cout << "Yes"; 
}


signed main() {
    /*!

    !*/
    cout.precision(10);
    cout << fixed;
    if (!debug) {
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
    }
//	freopen("TASK.in", "r", stdin);
  // 	freopen("TASK.out", "w", stdout);
    solve();
    return 0;
}


Measured memory_bytes: 384
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
D = np.array(lr())
recover = D[:, None] * D[None, :]
answer = recover.sum() - np.diag(recover).sum()
print(answer // 2)


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

const long long inf = (1ll << 31) - 1ll;
const int max_n = 200000;

int n, q;

long long seg[max_n * 2 + 1];

void init(void)
{
  int _n = n;

  n = 1;
  while (n < _n) n *= 2;

  fill(seg, seg + n * 2ll - 1ll, inf);
}

void update(int k, long long x)
{
  k = k + n - 1;

  seg[k] = x;
  while (k){
    k = (k - 1) / 2;
    seg[k] = min(seg[k * 2 + 1], seg[k * 2 + 2]);
  }
}

long long find(int a, int b, int k = 0, int l = 0, int r = n)
{
  long long ret = inf;

  if (a <= l && r <= b) {
    ret = seg[k];
  }
  else if (r <= a || b <= l){
    ret = inf;
  }
  else {
    ret = min(find(a, b, k * 2 + 1, l, (l + r) / 2), find(a, b, k * 2 + 2,(l + r) / 2, r));
  }

  return ret;
}

int main()
{
  cin >> n >> q;
  init();
  for (int i = 0; i < q; i++){
    int f;
    cin >> f;

    int a, b;
    cin >> a >> b;
    if (f == 0){
      update(a, b);
    }
    else {
      cout << find(a, b + 1) << endl;
    }
  }
}

Measured memory_bytes: 5148
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		String S;
		Scanner sc = new Scanner(System.in);
		S = sc.next();
		if (S.indexOf("A") != -1 && S.indexOf("B") != -1)
			System.out.println("Yes");
		else
			System.out.println("No");
		sc.close();
	}
}

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

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

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

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


int main()
{

   fastread();

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

      bool flag=false;

      string str;


        cin>>a>>b;

        sum=a+b;

        if(sum&1)
            cout<<"IMPOSSIBLE"<<endl;

        else cout<<sum/2<<endl;












}



Measured memory_bytes: 3536
n=int(input())

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

def lcm(a,b):
    return a*b//gcd(a,b)

ans = int(input())
for i in range(n-1):
    tmp = int(input())
    ans = lcm(tmp,ans)
print(ans)


Measured memory_bytes: 2940
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>

const uint64_t MOD = 1000 * 1000 * 1000 + 7;

template <uint8_t mod_value>
struct index_mod {
  uint8_t mod[mod_value][mod_value];
  constexpr index_mod() : mod() {
    for (size_t i = 0; i < mod_value; ++i) {
      for (size_t j = 0; j < mod_value; ++j) {
        mod[i][j] = (i * 10 + j) % mod_value;
      }
    }
  }
};

template <uint8_t mod_value>
struct sub_index {
  uint8_t index[mod_value][mod_value - 10];
  constexpr sub_index() : index() {
    auto value = 0;
    uint8_t in[mod_value] = {0};
    for (size_t i = 0; i < mod_value; ++i) {
      value += 10;
      for (size_t j = 0; j < mod_value - 10; ++j) {
        // index[i][j] = (value + j) % mod_value;
        auto v = (value + j) % mod_value;
        index[v][in[v]] = i;
        ++in[v];
      }
    }
  }
};

int main() {
  std::ios::sync_with_stdio(false);

  std::string s;
  std::cin >> s;

  // i番目の文字を見た時に13との剰余がnになる個数を数え上げる
  std::vector<uint64_t> dp(2 * 13);

  constexpr index_mod<13> imod;
  constexpr sub_index<13> sindex;

  // for (size_t i = 0; i < 13; ++i) {
  // for (size_t j = 0; j < 13; ++j) {
  //   std::cout << (int)imod.mod[i][j] << ",";
  // }
  // std::cout << std::endl;
  // }
  // for (size_t i = 0; i < 13; ++i) {
  // for (size_t j = 0; j < 3; ++j) {
  //   std::cout << (int)sindex.index[i][j] << ",";
  // }
  // std::cout << std::endl;
  // }

  uint64_t row_sum = 0;

  {  // テーブル初期化
    int val = -1;
    if (s[0] != '?') val = s[0] - '0';
    if (val == -1) {
      for (size_t i = 0; i < 10; ++i) {
        dp[i % 13] = 1;
      }
      row_sum = 10;
    } else {
      dp[val % 13] = 1;
      row_sum = 1;
    }
    // % 13は不要だけど定義に帰るため
  }

  for (size_t i = 1, e = s.length(); i < e; ++i) {
    int val = -1;
    if (s[i] != '?') val = s[i] - '0';
    if (val == -1) {
      auto temp_sum = row_sum + 3 * MOD;
      for (size_t here = 0; here < 13; ++here) {
        uint64_t no_need = 0;
        for (size_t j = 0; j < 3; ++j) {
          no_need += dp[sindex.index[here][j]];
        }
        dp[13 + here] = temp_sum - no_need;
      }
    } else {
      for (size_t pre = 0; pre < 13; ++pre) {
        dp[13 + imod.mod[pre][val]] = dp[pre];
      }
    }

    //     for (int i = 0; i < 2; ++i) {
    //     for (int j = 0; j < 13; ++j) {
    //       std::cout << dp[i * 13 + j] << ",";
    //     }
    //     std::cout << std::endl;
    //   }
    //
    row_sum = 0;
    for (size_t i = 0; i < 13; ++i) {
      dp[i] = dp[13 + i] % MOD;
      row_sum += dp[13 + i];
      // dp[i] = dp[13 + i];
    }
    row_sum %= MOD;
  }

  std::cout << dp[5] % MOD << "\n";
  return 0;
}

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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())

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

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int INT_INF = 2147483647;
const long long LL_INF = 1LL<<60;
const long long MOD = 1000000007;

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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

int main(void){
    int N; cin >> N;
    cout << (N < 1000 ? "ABC" : "ABD") << endl;
    return 0;
}

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

using namespace std;

map<long long,long long> mp;
int main()
{
    int n,x;
    scanf("%d",&n);
    mp.clear();
    mp[0]++;
    long long sum=0;
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&x);
        sum+=x;
        mp[sum]++;
    }
    long long ans=0;
    map<long long ,long long >::iterator it = mp.begin();
    for(;it!=mp.end();it++)
    {
        long long t=it->second;
        ans+=(t*(t-1)/2);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 12800
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < (int)b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const ll INF = 1e18;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n, m;
    cin >> n >> m;
    ll d[n][n] = {};
    rep(i, 0, n) rep(j, 0, n) d[i][j] = INF;
    rep(i, 0, n) d[i][i] = 0;
    rep(i, 0, m) {
        ll s, t, c;
        cin >> s >> t >> c;
        d[s][t] = c;
    }
    rep(k, 0, n) {
        rep(i, 0, n) {
            rep(j, 0, n) {
                if (d[i][k] == INF || d[k][j] == INF) continue;
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }
    rep(i, 0, n) {
        if (d[i][i] < 0) {
            cout << "NEGATIVE CYCLE" << endl;
            return 0;
        }
    }
    rep(i, 0, n) {
        rep(j, 0, n) {
            if (d[i][j] == INF) cout << "INF";
            else cout << d[i][j];
            if (j != n - 1) cout << " ";
        }
        cout << endl;
    }
    return 0;
}



Measured memory_bytes: 3152
#include<stdio.h>
#include<algorithm>
#include<bits/stdc++.h>
#define maxn 1000000007

using namespace std;

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int A,B;
  cin>>A>>B;
  if(A>=13)
    cout<<B;
  else if(A>=6 && A<=12)
    cout<<B/2;
  else
    cout<<0;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define f(i,a,n) for(i=a;i<n;i++)
#define rf(i,a,n) for(i=a;i>=n;i--)
#define ll long long
#define pii pair<int,int>
#define pll pair<long long,long long>
#define vi vector<int>
#define vll vector<long long>
#define umii unordered_map<int,int>
#define umci unordered_map<char,int>
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define F first
#define S second
#define all(v) begin(v),end(v)
#define mkp make_pair
#define setn1(a)  memset(a,-1,sizeof(a))
#define set0(a) memset(a,0,sizeof(a))
#define setl(b) memset(a,1000000001,sizeof(a))
#define M 1000000007
#define I 1000000000000000001
#define TakeInput freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);freopen("error.txt","w",stderr);


using namespace std;

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

ll func(ll n)
{
	ll cnt=0;
	while (n>0)
	{
		cnt++;
		n=n/2;
	}
	return cnt;
}
int main()
{
	#ifndef ONLINE_JUDGE
	//TakeInput
	#endif
	fast;
	ll n,i,j;
	cin >> n;
	ll ans = func(n);
	cout << (ll)(pow(2,ans))-1;
	return 0;
}


Measured memory_bytes: 512
//Think simple yet elegant.
#include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll  long long
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pi pair<int,int>
const ll maxn=1e5+10;
const ll mod=1e9+7;

int main()
{	
	fast;
	ll n,m,x,i,j,k;
	cin>>n>>m>>x;
	ll a[n][m],s=0;
	vector<ll> c(n);
	for(i=0;i<n;i++){
		cin>>c[i];
		for(j=0;j<m;++j){
			cin>>a[i][j];
		}
	}
	ll ans = 1e18;
	for(ll mask=0;mask<=(1<<n);++mask){
		ll cost=0;
		vector<ll> alg(m,0);
		for(i=0;i<n;i++){
			if(mask&(1<<i)){
				cost+=c[i];
				for(j=0;j<m;++j){
					alg[j]+=a[i][j];
				}
			}
		}
		ll e = *min_element(all(alg));
		if(e>=x)
			ans=min(ans,cost);
	}
	if(ans==1e18)
		ans=-1;
	cout<<ans;
}

Measured memory_bytes: 3560
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <functional>
#include <cmath>
#include <cstring>
using namespace std;
#define sci(n) scanf("%lld", &(n))
#define scd(n) scanf("%Ld", &(n))
typedef long long LL;
typedef long double LD;
typedef pair<LL, LL> pll;
using namespace std;
const int MAX = 1024;

LL ans;
LL n;

void dfs(LL num, LL mask) {
	if (num > n)
		return;
	if ((mask & 7) == 7)
		ans++;
	dfs(num * 10 + 3, mask | 1);
	dfs(num * 10 + 5, mask | 2);
	dfs(num * 10 + 7, mask | 4);
}

int main(void) {
	sci(n);

	dfs(0, 0);
	printf("%lld", ans);

	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        s.toLowerCase();
        int n=s.length();
        int ans=0;
        while(true){
            String t=sc.nextLine();
            if(t.equals("END_OF_TEXT")) break;
            for(String u:t.toLowerCase().split(" ")){
                if(s.equals(u)) ans++;
            }
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 26244