akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define int long long
#define uint unsigned int
#define pii pair<int, int>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORR(i,a,b) for(int i=(a);i>=(b);--i)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) FORR(i,n,0)
#define ALL(c) ((c).begin(),(c).end())
#define PB(a) push_back(a)
#define EMPB(...) emplace_back(__VA_ARGS__)
#define EMP(...) emplace(__VA_ARGS__)
#define MP(a,b) make_pair(a,b)
#define MT(...) make_tuple(__VA_ARGS__)
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MINF(a) memset(a,0x3f,sizeof(a))
#define PW(n) (1LL<<(n))
using namespace std;
template <class T> inline bool CHMIN(T& a, T b) { if(a>b) { a=b; return 1; } return 0; }
template <class T> inline bool CHMAX(T& a, T b) { if(a<b) { a=b; return 1; } return 0; }
template <class T> inline void SORT(T& a) { sort(ALL(a)); }
template <class T> inline void REV(T& a) { reverse(ALL(a)); }
template <class T> inline void UNI(T& a) { SORT(a); a.erase(unique(ALL(a)),a.end()); }
template <class S, class T> ostream& operator<<(ostream& os, const pair<S,T> a) {
  return os << a.first << ' ' << a.second;
}
const int MOD = 1000000007;
// const int INF = 0x3f3f3f3f3f3f3f3f;
// const double EPS = 1e-10;
/* ---------------------------------------------------------------------------------------------------- */

/* 基本要素 */
using D = double; // 座標値の型 doubleかlong double
using P = complex<D>; // Point
using L = pair<P,P>;  // Line
using VP = vector<P>;
const double EPS = 1e-8;  // 許容誤差
const double INF = 1e12;
#define X real()
#define Y imag()
#define LT(n,m) ((n)+EPS<(m)) // n < m ?
#define LE(n,m) ((n)-EPS<(m)) // n <= m ?
#define GT(n,m) LT(m,n) // n > m ?
#define GE(n,m) LE(m,n) // n >= m ?
#define EQ(n,m) (abs((n)-(m))<EPS)
#define NE(n,m) !EQ(n,m)
#define rep(i,n) for (int i=0;i<(n);++i)

namespace std {
  istream& operator >> (istream& is, P& p) {
    D F, S;
    is >> F >> S;
    p = P(F,S);
    return is;
  }
}

// 内積
D dot(P a, P b) {
  return (conj(a)*b).X;
}
// 外積
D cross(P a, P b) {
  return (conj(a)*b).Y;
}
// 点aから見た、点bから点cへの方向
int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (GT(cross(b,c),0)) return +1;  // counter clockwise
  if (LT(cross(b,c),0)) return -1;  // clockwise
  if (LT(dot(b,c),0)) return +2;  // c--a--b on line
  if (LT(norm(b),norm(c))) return -2; // a--b--c on line or a==b
  return 0;                     // a--c--b on line or a==c or b==c
}

// 円と円
int isecCC(P c1, D r1, P c2, D r2) {
  if (r1 < r2) swap(c1,c2), swap(r1,r2);
  D d = abs(c1-c2);
  if (GT(d-r1-r2,0)) return 4;  // 交差なし
  if (EQ(d-r1-r2,0)) return 3;  // 外接
  if (EQ(r1-r2-d,0)) return 1;  // 内接
  if (GT(r1-r2-d,0)) return 0;  // 包含
  return 2; // 交差
}

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

  P c1,c2;
  D r1,r2;
  cin >> c1 >> r1 >> c2 >> r2;
  cout << isecCC(c1,r1,c2,r2) << endl;
  
  return 0;
}


Measured memory_bytes: 3284
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i = 0; i < n; i++){
		cin >> a.at(i);
	}
	sort(a.begin(), a.end());
	if(n % 2 == 0){
		bool flag1 = true;
		for(int i = 0; i < n; i++){
			if(i % 2 == 0){
				if(a.at(i) != i + 1){
					flag1 = false;
					break;
				}
			}
			else{
				if(a.at(i) != i){
					flag1 = false;
					break;
				}
			}
		}
		if(flag1){
			// cout << "b.size() = " << b.size() << endl;
			long long ans1 = 1;
			for(int i = 0; i < n / 2; i++){
				ans1 %= mod;
				ans1 *= 2;
			}
			cout << ans1 % mod << endl;
		}
		else{
			cout << 0 << endl;
		}
	}
	else{
		bool flag2 = true;
		for(int i = 0; i < n; i++){
			if(i % 2 == 0){
				if(a.at(i) != i){
					flag2 = false;
					break;
				}
			}
			else{
				if(a.at(i) != i + 1){
					flag2 = false;
					break;
				}
			}
		}
		if(flag2){
			// cout << "b.size() = " << b.size() << endl;
			long long ans2 = 1;
			for(int i = 0; i < (n - 1) / 2; i++){
				ans2 %= mod;
				ans2 *= 2;
			}
			cout << ans2 % mod << endl;
		}
		else{
			cout << 0 << endl;
		}
	}
	// cout << "a: ";
	// for(int i = 0; i < (int)a.size(); i++){
	// 	cout << a.at(i) << " ";
	// }
	// cout << endl << "b: ";
	// for(int i = 0; i < (int)b.size(); i++){
	// 	cout << b.at(i) << " ";
	// }
	// cout << endl;
	// cout << b.size() << endl;
	return 0;
}

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

int main() {

  int K, S, ans;
  cin >> K >> S;
  
  for(int x = 0; x <= K; x++){
    for(int y = 0; y <= K; y++){
      int z = S - x - y;
      if( 0 <= z and z <= K ) {
        ans++;
      }
    }
  }
  
  cout << ans;

  return 0;
}


Measured memory_bytes: 256
a,b,c,x,y=map(int,input().split())

if a+b<=2*c:
  print(a*x+b*y)
else:
  if x>y and a<2*c:
    print(a*(x-y)+2*c*y)
  elif x<y and b<2*c:
    print(b*(y-x)+2*c*x)
  else:
    print(2*c*max(x,y))

Measured memory_bytes: 3060
import numpy as np
N = int(input())
A = np.array(input().split(), dtype = np.int32)
 
counter = np.bincount(A)
if len(counter) <= 2:
  answer = counter.sum()
else:
  answer = (counter[2:] + counter[1:-1] + counter[:-2]).max()
print(answer)

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

using namespace std;

int main()
{
  int64_t n, acc;
  vector<int64_t> a, b;

  cin >> n;
  for (int64_t i = 0; i < n+1; i++) {
    int64_t a1;
    cin >> a1;
    a.push_back(a1);
  }
  for (int64_t i = 0; i < n; i++) {
    int64_t b1;
    cin >> b1;
    b.push_back(b1);
  }

  acc = 0;
  for (int64_t i = 0; i < n; i++) {
    if (a[i] < b[i]) {
      acc += a[i];
      b[i] -= a[i];
    } else {
      acc += b[i];
      b[i] = 0;
    }
    if (b[i] < a[i+1]) {
      acc += b[i];
      a[i+1] -= b[i];
    } else {
      acc += a[i+1];
      a[i+1] = 0;
    }
  }

  //for (int64_t i = 0; i < n+1; i++) {
  //  cout << a[i] << ' ';
  //}
  //cout << endl;
  //for (int64_t i = 0; i < n; i++) {
  //  cout << b[i] << ' ';
  //}
  //cout << endl;

  cout << acc << endl;
  return 0;
}


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

#define REP(i,n) for(ll i=0; i<(ll)(n); i++)
#define FOR(i,n,m) for (ll i=n; i<(ll)(m); i++)
#define pb push_back
#define INF 1000000007LL
#define all(a) (a).begin(),(a).end()
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)

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

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

ll N, M;
int main(){
    ios::sync_with_stdio(false);
    cin >> N >> M;
    if(N == 1 && M == 1) {
        cout << 1 << endl;
        return 0;
    }
    if(N == 1 || M == 1) {
        cout << N * M - 2 << endl;
        return 0;
    }
    ll omote = 2 * N + 2 * (M-2);
    ll ura = N * M - omote;
    cout << ura << endl;
    return 0;
}


Measured memory_bytes: 256
h,w,a,b=gets.split.map &:to_i;r=0;M=10**9+7;I=[1,1];*F=I;*R=I;2.upto(h+w){|i|I<<z=(M-M/i)*I[M%i]%M;F<<i*F[-1]%M;R<<z*R[-1]%M};(b...w).each{|i|r=(r+F[h-a-1+i]*R[h-a-1]*R[i]*F[a-1+w-1-i]*R[a-1]*R[w-1-i])%M};p r

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

int main() {
  int N;
  cin >> N;
  bool can = true;
  for (int i = 0; i < N; i++) {
    int tmp;
    cin >> tmp;
    if (tmp % 2 == 0) {
      if (tmp % 3 != 0 && tmp % 5 != 0) {
        can = false;
        break;
      }
    }
  }
  if (can) cout << "APPROVED" << endl;
  else cout << "DENIED" << endl;
}


Measured memory_bytes: 256
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons;

void main()
{
    auto abcd = readln.chomp.split("").to!(int[]);

    string[3] ret;
    bool solve(int i, int n) {
        if (i == 3 && n == 7) return true;
        if (i == 3) return false;
        ret[i] = "+";
        if (solve(i+1, n + abcd[i+1])) return true;
        ret[i] = "-";
        if(solve(i+1, n - abcd[i+1])) return true;
        return false;
    }
    solve(0, abcd[0]);

    writefln("%d%s%d%s%d%s%d=7", abcd[0], ret[0], abcd[1], ret[1], abcd[2], ret[2], abcd[3]);
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define OUT(x)                cout << #x << " = " << x << endl; 
#define rep(i, n)             for (int (i) = 0; (i) < (int)(n); (i)++)
#define rer(i, l, r)          for (int (i) = (int)(l); (i) <= (int)(r); (i)++)
#define reu(i, l, r)          for (int (i) = (int)(l); (i) < (int)(r); (i)++)
#define each(i, v)            for (auto i : v)
#define all(x)                (x).begin(), (x).end()
#define rall(x)               (x).rbegin(), (x).rend()
#define pb(x)                 push_back(x)
#define bp(x)                 __builtin_popcount(x)
#define mp(x, y)              make_pair((x), (y))
#define fi                    first
#define se                    second
#define setp(x)               setprecision(x)
#define mset(m, v)            memset(m, v, sizeof(m))
static const int INF        = 0x3f3f3f3f;
static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
static const int MOD        = 1000000007;
static const double PI      = 3.14159265358979;

#define int                   long long

typedef vector<double>        vd;
typedef vector<string>        vs;
typedef vector<bool>          vb;
typedef vector<int>           vi;
typedef pair<int, int>        pii;
typedef vector<pii>           vpii;

template<typename T> void pv(T a, T b) { for (T i = a; i != b; i ++) cout << *i << " "; cout << endl; }
template<typename T, typename U> inline void amin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if (x < y) x = y; }
int in() { int _x; cin >> _x; return _x; }

int g[1010][1010];

struct state { int x, score; };
      
signed main() { 
        int n, m;
        cin >> n >> m;
        rep(i, n) rep(j, n) g[i][j] = 0;
        rep(i, m) {
                int a, b, c;
                cin >> a >> b >> c;
                a --;
                b --;
                g[a][b] = c;
        }
        vi used(1010, -INFL);
        queue<state> q;
        q.push({0, 0});
        int cnt = 0;
        int prev;
        int f = 0;
        while (true) {
                state p;
                bool ff = false;
                if (!q.empty()) {
                        p = q.front(); q.pop();
                        ff = true;
                }
                cnt ++;
                if (ff) {
                rep(i, n) {
                        if (g[p.x][i] != 0 && used[i] < p.score + g[p.x][i]) {
                                used[i] = p.score + g[p.x][i];
                                q.push({i, p.score + g[p.x][i]});
                        }
                }
                }
                if (q.empty() && p.x == n - 1) break;
                if (cnt > 3000 && cnt < 5000) prev = used[n - 1];
                if (cnt > 7000) {
                        if (prev == used[n - 1]) f = 1;
                        else f = 2;
                        break;
                }
        }
        if (f == 0 || f == 1) cout << used[n - 1] << endl;
        else cout << "inf" << endl;
}


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

using namespace std;

int main() {

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

	int n, k;
	cin >> n >> k;

	vector<int> h(n + 1), dp(n + 1, 1e9);

	for(int i = 1; i <= n; i++) {
		cin >> h[i];
	}

	dp[1] = 0;
	
	for(int i = 2; i <= n; i++) {
		for(int j = 1; j <= min(k, i - 1); j++) {
			dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i-j]));
		}
	}

	cout << dp[n];

	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define cmin(a,b) (a>b?a=b:a)
#define cmax(a,b) (a<b?a=b:a)
#define mem(a,k) memset(a,k,sizeof(a))
#define lop(i,s,t) for(int i=s;i<(t);++i)
#define rep(i,s,t) for(int i=s;i<=(t);++i)
#define dec(i,s,t) for(int i=s;i>=(t);--i)
#define fore(i,v) for(int i=g[v],d=es[i].d;i;i=es[i].nxt,d=es[i].d)
using namespace std;

#define Pr(f,...) fprintf(stderr,f,##__VA_ARGS__),fflush(stderr)

typedef long long ll;

template<typename T>
void read(T &x){
	x=0; 
	char c;
	for(c=getchar();!isdigit(c);c=getchar()); 
	for(;isdigit(c);c=getchar())x=x*10+c-'0'; 
}

const int N=1e6+50,P=1e9+7;

int mul(int a,int b){ return 1ll*a*b%P; }
int add(int a,int b){ a+=b; return a>=P?a-P:a; }
int sub(int a,int b){ a-=b; return a<0?a+P:a; }
int gcd(int a,int b){ return !b?a:gcd(b,a%b); }

int n,m,s[N],ans,a[N]; 

int main(int argc,char *argv[]){
#ifdef CURIOUSCAT
	freopen("d.in","r",stdin); 
#endif
	scanf("%d",&n); 
	rep(i,1,n)scanf("%d",a+i);
	s[1]=1; rep(i,2,n)s[i]=mul(P-P/i,s[P%i]); 
	rep(i,1,n)s[i]=add(s[i],s[i-1]); 
	rep(i,1,n)ans=add(ans,mul(sub(add(s[i],s[n-i+1]),1),a[i])); 
	rep(i,1,n)ans=mul(ans,i); 
	printf("%d\n",ans);
	return 0;
}

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

int main() {

  int a,b,c; cin >> a >> b >> c;
  int x,y; cin >> x >> y;
  
  int s = a*x + b*y;
  int t = 2*c*max(x,y);
  int u;
  if (x == y){
    u = 2*c*x;
  } else if (x > y){
    u = 2*c*y + a*(x-y);
  } else {
     u = 2*c*x + b*(y-x);
  }

  cout << min(s,min(t,u)) << endl;
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
char enl = '\n';
#define rep(i, from, to) for (int i = from; i < (to); ++i)
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<pair<int, int>> vii;

bool check(string c, char x) {
    if (c.size() == 0) return false;
    for (auto g : c) {
        if (g != x) return true;
    }
    return false;
}

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

    string s;
    cin >> s;

    int minops = 200;
    rep(i,0,26) {
        char x = 'a' + i;
        string c = s;
        int ops = 0;
        while (check(c, x)) {
            ops++;
            string cp = "";
            rep(i,0,c.size()-1) {
                if (c[i] == x || c[i+1] == x) {
                    cp += x;
                } else {
                    cp += c[i];
                }
            }
            c = cp;
        }
        minops = min(minops, ops);
    }

    cout << minops << endl;


            

    return 0;
}


Measured memory_bytes: 256
# ANSHUL GAUTAM
# IIIT-D

# from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from sys import stdin
from sys import maxsize
# from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''
4 1 3
'''

def nCr(n, r):
	num = den = 1
	mod = 10**9 + 7
	for i in range(r):
		num = (num * (n - i)) % mod
		den = (den * (i + 1)) % mod
	return (num * pow(den,mod - 2, mod)) % mod

def solve(n,a,b):
	mod = 10**9 + 7
	ans = pow(2,n,mod)
	ans -= nCr(n,a)
	ans -= nCr(n,b)
	return max(0,(ans-1)%mod)

n,a,b = map(int, stdin.readline().rstrip().split())
ans = solve(n,a,b)
print(ans)


Measured memory_bytes: 4852
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
#include <map>
#include <queue>
#include <set>

#define ll long long
#define REP(i,n) for(int i = 0; i < n; i++)
#define PI 3.141592653589
#define MOD 1000000007

using namespace std;

template<typename T> T gcd(T a, T b){return (a % b)? gcd(b, a % b) : b;}
template<typename T> T lcm(T a, T b){return a * b / gcd(a, b);}

int main(void){
    ll n, d;
    cin >> n >> d;
    int ctr = 0;
    REP(i,n){
        ll x, y;
        cin >> x >> y;
        if(x*x + y*y <= d*d) ctr++;
    }
    
    cout << ctr << endl;
    return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <fstream>
using namespace std;
const int nmax=2005;
const long long mod=924844033;
long long dp[nmax][nmax];
long long modes[nmax],pond[nmax],fact[nmax];
long long ans;
int n,k,i,j,rr,cate;
int main()
{
    //freopen("data.in","r",stdin);
    ios_base::sync_with_stdio(false);
    cin>>n>>k;
    dp[0][0]=1;
    for(i=1;i<=n;i++)
    {
        for(j=0;j<=i;j++)
        {
            if(i>=2&&j) dp[i][j]=dp[i-2][j-1];
            dp[i][j]+=dp[i-1][j];
            if(dp[i][j]>=mod)
                dp[i][j]-=mod;
        }
    }
    modes[0]=1;
    for(rr=0;rr<k;rr++)
    {
        cate=(n-1)/k;
        if(rr<=(n-1)%k) cate++;
        for(i=1;i<=cate;i++)
            pond[i]=(dp[cate][i])%mod;
        for(int dd=0;dd<2;dd++)
         for(i=n;i>=0;i--)
            for(j=1;j<=min(n-i,cate);j++)
                modes[i+j]=(modes[i+j]+1LL*modes[i]*pond[j])%mod;
    }
    fact[0]=1;
    for(long long I=1;I<=n;I++)
       fact[I]=(1LL*fact[I-1]*I)%mod;
    for(i=1;i<=n;i++)
    {
        if((i&1)) ans+=(1LL*modes[i]*fact[n-i])%mod;
        else ans-=(1LL*modes[i]*fact[n-i])%mod;
        if(ans<0) ans+=mod;
        if(ans>=mod) ans-=mod;
    }
    ans=(fact[n]-ans+mod)%mod;
    cout<<ans;
    return 0;
}


Measured memory_bytes: 30208
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars, Usize1};
use proconio::{fastout, input};
#[fastout]
fn main() {
    input! {
        n: usize,
        a: [usize; n],
    }
    let mut count_one = 0;
    let mut count_four = 0;
    for i in 0..n {
        if a[i] % 4 == 0 {
            count_four += 1;
        } else if a[i] % 2 == 0 {
        } else {
            count_one += 1;
        }
    }
    if count_four >= n / 2 {
        println!("Yes");
    } else if count_one > count_four {
        println!("No");
    } else {
        println!("Yes");
    }
}


Measured memory_bytes: 3664
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

K = int(input())

print(l[K - 1])

Measured memory_bytes: 3060
n, m = map(int, input().split())
b = [False]*(n+2)
for _ in range(m):
    i = int(input())
    b[i] = True
M = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
for i in range(1, n+1):
    if b[i] == False:
        dp[i] = (dp[i-1] + dp[i-2])%M
print(dp[n])


Measured memory_bytes: 7668
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
#define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
#define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
#define memmin(x) memset((x),-1,sizeof((x)))
#define memzer(x) memset((x), 0,sizeof((x)))
#define meminf(x) memset((x),0x3f,sizeof((x)))
#define int long long
typedef long long ll;
typedef pair < int , int >  pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}



signed main(){
    string str;
    cin >> str;
    cout << 700 +(str[0]=='o')*100+(str[1]=='o')*100+(str[2]=='o')*100 fin;
  
  return 0;
}



struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;


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

//#define int long long
//using ll = boost::multiprecision::cpp_int;
using ll = long long;
//constexpr int INF = 1e9;//INT_MAX=(1<<31)-1=2147483647
constexpr ll INF = (ll)1e18;//(1LL<<63)-1=9223372036854775807
constexpr ll MOD = (ll)1e9 + 7;
constexpr double EPS = 1e-9;
constexpr int dx[4]={1,0,-1,0};
constexpr int dy[4]={0,1,0,-1};
#ifdef LOCAL_ENV
	#define debug(var) std::cout<<#var" = "<<var<<std::endl
#else
	#define debug(var)
#endif
#define p(var) std::cout<<var<<std::endl
#define rep(i, n)   for(ll i=0, i##_length=(n); i< i##_length; ++i)
#define repeq(i, n) for(ll i=1, i##_length=(n); i<=i##_length; ++i)
#define all(a) (a).begin(), (a).end()
#define PI (acos(-1))
template<typename T> inline T power(T x, T n){ return n ? power(x*x%MOD,n/2)*(n%2?x:1)%MOD : 1; }
template<typename T> inline T gcd(T a, T b) { return b ? gcd(b,a%b) : a; }
template<typename T> inline T lcm(T a, T b) { return a / gcd(a,  b) * b; }
template<typename T1, typename T2>inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template<typename T1, typename T2>inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
	for (int i = 0, len = v.size(); i < len; ++i){
		s << v[i]; if (i < len - 1) s << "\t";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
	for (int i = 0, len = vv.size(); i < len; ++i){
		s << vv[i] << endl;
	}
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const map<T1, T2>& m) {
	s << "{" << endl;
	for (typeof(m.begin()) itr = m.begin(); itr != m.end(); ++itr){
		s << "\t" << (*itr).first << " : " << (*itr).second << endl;
	}
	s << "}" << endl;
	return s;
}

/*-----8<-----8<-----*/

constexpr ll N_MAX = 100;
constexpr ll T_I_MAX = 1000000000000000000;

ll N;
ll T[N_MAX];

void input() {
	scanf("%lld", &N);
	rep(i, N) scanf("%lld", T + i);
}

void solve() {
	ll ans = T[0];

	repeq(i,N-1){
		ans=lcm(ans,T[i]);
	}

	printf("%lld\n", ans);
}

signed main() {
	input();
	solve();
	return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define VSORT(v) sort(v.begin(), v.end())
#define DVSORT(v) sort(v.begin(), v.end(),greater<int>())
#define SORT(v, n) sort(v, v+n)
#define DSORT(v,n) sort(v, v+n,greater<int>())
#define vi vector<int>
#define pb push_back
#define P pair<int,int>


template <class T> void chmin(T&a, const T&b) { a = min(a,b); }
template <class T> void chmax(T&a, const T&b) { a = max(a,b); }

const double EPS =1e-9;
const long INF =999999999;
const long MOD =1000000007; //10^9+7
#define PI 3.14159265258979

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

int main(void){	
	int n,l,r,result=0,numbers[100005]={};

	cin>>n;
	REP(i,n){
		cin>>l>>r;
		numbers[l]++;
		numbers[r+1]--;
	}
	
	if(numbers[0]>0) result++;
	FOR(i,1,100001){
		numbers[i]+=numbers[i-1];
		if(numbers[i]>0) result++;
	}
	cout<<result<<endl;

	return 0;
}



Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
 using namespace std;
 string s;
 int main()
 {
 	cin>>s;
 	int n=s.length();
	int l=0,r=n-1;
	while(l<=r){
		if(s[l]!=s[r]){
			cout<<"No";
			return 0;
		}
		l++,r--;
	}
	int len=(n-1)/2;
	l=0,r=len-1;
	while(l<=r){
		if(s[l]!=s[r]){
			cout<<"No";
			return 0;
		}
		l++,r--;
	}
	len=(n+3)/2;
	l=len-1,r=n-1;
	while(l<=r){
		if(s[l]!=s[r]){
			cout<<"No";
			return 0;
		}
			l++,r--;
	}
	cout<<"Yes";
	return 0;
 }

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using Graph = vector<vi>;  // vi <=> vl
using vb = vector<bool>;
using boolGraph = vector<vb>;
using P = pair<int, int>;  // int <=> ll
const int MOD = 1e9+7;
const double EPS = 1e-9;

int main() {
  int n, k; cin >> n >> k;
  cout << (n-2)/(k-1)+1 << endl;
  return 0;
}


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

using namespace std;

int main()
{
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  const int x=c-a,y=d-b;
  cout<<string(x,'R')<<string(y,'U');
  cout<<string(x,'L')<<string(y,'D');
  cout<<'D'<<string(x+1,'R')<<string(y+1,'U')<<'L';
  cout<<'U'<<string(x+1,'L')<<string(y+1,'D')<<'R';
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define int long long
#define inf 1000000007
#define LINF 100000000000000007LL
#define ll long long
using namespace std;
int cnt[61];
signed main(){
	int n;
	cin>>n;
	vector<int> a(n);
	for(int i=0;i<n;i++){
		cin>>a[i];
		for(int j=0;j<=59;j++){
			if( (a[i]>>j)%2 ) cnt[j]++;
		}
	}
	int cur = 1, ans = 0;
	for(int i=0;i<=59;i++){
		int pl = cur * cnt[i];
		pl %= inf;
		pl *= (n-cnt[i]);
		pl %= inf;
		ans += pl;
		ans %= inf;
		cur *= 2;
		cur %= inf;
	}
	cout<<ans<<endl;
	return 0;
}

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

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

	for (int i = 0; i < N; i++) {
		char S;
		cin >> S;

		if (S == 'Y') {
			cout << "Four\n";
			break;
		}
		
		else if (i == N - 1) {
			cout << "Three\n";
		}
	}
}


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

def main
  n = gets.chop.to_i
  a_arr = gets.chop.split.map(&:to_i).map {|a| a - 1 }
  b_arr = gets.chop.split.map(&:to_i)
  c_arr = gets.chop.split.map(&:to_i)

  ans = 0
  ans += b_arr[a_arr[0]]
  1.upto(n-1) do |i|
    a_cur = a_arr[i]
    a_prev = a_arr[i-1]
    ans += b_arr[a_cur]
    if a_cur - 1 == a_prev
      ans += c_arr[a_prev]
    end
  end
  puts ans
end

if __FILE__ == $0
  main
end

Measured memory_bytes: 1788
#include  <iostream>
#include  <stdio.h>
#include <algorithm>
#include <iomanip>
using namespace std;
//#include <vector>
//#include <stack>
//#include <queue>

#include <math.h>
int standerd = int(pow(10.0,9.0)) + 7;

string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 
#include <string>


int getIntSubstr(string s,int start_index,int length){
    return atoi(s.substr(start_index,length).c_str());
}
  
int main(){

    int N;
    int K;
    cin >> N;
    cin >> K;

    int tmp_kaisu=0;
    int kaisu[N+1];

    double tmpK;
    tmpK=K;
    for( int ni = N ; ni > 0 ; ni-- ){
        while(ni < tmpK){
            tmp_kaisu++;
            tmpK = tmpK/2;
        }
        kaisu[ni]=tmp_kaisu;
    }
    double ans = 0.0;
    for( int ni = N ; ni > 0 ; ni-- ){
        double added = 1.0 / N;
        for( int ki = 0 ; ki < kaisu[ni] ; ki++ ){
            added = added * 0.5;
        }
        ans = ans + added;
    }
    //1000000000
    cout << setprecision(12) << ans;


}

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

#define mod 1000000007
#define REP(i, n) for (int i = 0; i < n; i++)

using namespace std;

/*long C(long n, long r){
    if(n < r) return 0;
    long p[n+1][n+1];
    p[0][0] = 1;
    for(int i = 1; i <= n; i++){
        p[i][0] = 1;
        p[i][i] = 1;
        for(int j = 1; j <= i-1; j++){
            p[i][j] = p[i-1][j] + p[i-1][j-1];
        }
    }
    return p[n][r];
}*/

 
void solve() {
    int N;
    cin >> N;
    int a[N];
    int f = 0, t = 0, o = 0;
    REP(i, N) {
        int a;
        cin >> a;
        if(a % 4 == 0){
            f++;
        }
        else if(a % 2 == 0){
            t++;
        }
        else{
            o++;
        }
    }
    bool ok = false;
    if(t == 0){
        if(f + 1 >= o) ok = true;
    }
    else{
        if(f >= o) ok = true;
    }
    if(ok){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}
 
int main() {
    solve();
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #define int long long int
    int h,n,cnt=0,a;
    cin>>h>>n;
    for(int i=0;i<n;i++)
    {
        cin>>a;
        cnt+=a;
    }
    if(cnt>=h)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
fun main(args: Array<String>) {
    val mod = 1e9.toLong() + 7

    val fact = LongArray(200000)
    fact[0] = 1L
    for (i in 1 until fact.size) {
        fact[i] = i * fact[i - 1] % mod
    }

    fun factorial(n: Long): Long {
        return fact[n.toInt()]
    }

    fun div(a: Long, b: Long): Long {

        fun calc(a: Long, b: Long): Long {
            if (b == 0L) return 1L
            if (b % 2L == 0L) {
                val d = calc(a, b / 2)
                return d * d % mod
            }
            return a * calc(a, b - 1) % mod
        }

        return a * calc(b, mod - 2) % mod
    }

    fun conb(n: Long, k: Long): Long {
        return div(div(factorial(n), factorial(n - k)), factorial(k))
    }

    fun factorize(n: Int): MutableMap<Int, Int> {
        val r = mutableMapOf<Int, Int>()
        var x = n
        var i = 2
        while (i * i <= n) {
            while (x % i == 0) {
                r[i] = (r[i] ?: 0) + 1
                x /= i
            }
            i++
        }
        if (x > 1) {
            r[i] = (r[i] ?: 0) + 1
        }
        return r
    }

    val (n, m) = readLine()!!.split(' ').map { it.toInt() }
    factorize(m).values
            .map { it.toLong() }
            .fold(1L) { acc, i -> acc * conb(i + n - 1, i) % mod }
            .let { println(it) }
}


Measured memory_bytes: 43080
import numpy as np
n, m = map(int, input().split())

ks = [np.array(list(map(int, input().split()))[1:]) - 1 for i in range(m)]
p = list(map(int, input().split()))

def get_state(s):
    return np.array([s[k].sum() for k in ks]) % 2 == p

def get_bin(integer, length):
    return (np.array([integer & (2 ** i) for i in range(length)]) > 0).astype(int)

print(sum(get_state(get_bin(i, n)).all() for i in range(2**n)))


Measured memory_bytes: 14484
n, k, q = gets.split.map(&:to_i)
arr = n.times.map { k-q }
a = q.times.map { gets.to_i-1}
a.each do |i|
  arr[i] += 1
end
 
arr.each do |el|
  puts el > 0 ? 'Yes' : 'No'
end

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

static const int INF = 1e9;
int c[10][10], d[10];

void dijkstra(int s){
    vector<bool> visited(10);
    priority_queue<pair<int, int>> pq;
    pq.emplace(0, s);
    d[s] = 0;
    while(!pq.empty()){
        int u = pq.top().second;
        int v = -pq.top().first;
        pq.pop();
        visited[u] = true;
        if(v > d[u]) continue;
        for(int i = 0; i < 10; i++){
            if(visited[i]) continue;
            if(d[i] > d[u] + c[i][u]){
                d[i] = d[u] + c[i][u];
                pq.emplace(-d[i], i);
            }
        }
    }
}

int main(){
    int h, w;
    cin >> h >> w;
    for(int i = 0; i < 10; i++){
        d[i] = INF;
        for(int j = 0; j < 10; j++){
            cin >> c[i][j];
        }
    }
    dijkstra(1);
    int ans = 0;
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            int a;
            cin >> a;
            if(a == -1) continue;
            ans += d[a];
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3636
ans = []

while True:
    n = int(input())
    
    if n == 0:
        break

    l_step, r_step = 0, 0
    flag = False
    step = input().split()
    cnt = 0
    for i in range(n):
        
        if step[i] == "lu":
            l_step = 1
        elif step[i] == "ru": 
            r_step = 1
        elif step[i] == "ld":
            l_step = 0
        elif step[i] == "rd":
            r_step= 0

        if flag == False:
            if l_step + r_step == 2:
                cnt += 1
                flag = True

        else:
            if l_step + r_step == 0:
                cnt += 1
                flag = False

    ans.append(cnt)

for i in ans:
    print(i)



Measured memory_bytes: 5628
#include <bits/stdc++.h>
#include<random>
using namespace std; typedef unsigned long long _ulong; typedef long long int lint; typedef pair<lint, lint> plint; typedef pair<double long, double long> pld;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define FOR(i, begin, end) for(lint i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(lint i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define endk '\n'
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
const lint MOD = 1e9 + 7, INF = 1e18;
lint dx[8] = { 0, -1, 1, 0, 1, -1, 1, -1 }, dy[8] = { 1, 0, 0, -1, -1, -1, 1, 1 };
typedef pair<double, lint> Pa;
typedef pair<plint, lint> tlint;
struct edge {
	lint cost;
	lint u, v;
};

#include<atcoder/all>
using namespace atcoder;

lint N, M, u, v;
int main() {
	cin >> N >> M;
	scc_graph scc(N);
	REP(i, M) {
		cin >> u >> v;
		scc.add_edge(u, v);
	}
	auto vec = scc.scc();
	cout << SZ(vec) << endk;
	for (auto vs : vec) {
		cout << SZ(vs) << " ";
		for (auto v : vs) {
			cout << v << " ";
		}
		cout << endk;
	}
}


Measured memory_bytes: 40576
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<stdio.h>
#include<cstring>
#include<math.h>
#include<map>
#include<bitset>
#include<iomanip>
#include<queue>
#include<functional>
#include<stack>
#include<tuple>
#include<cassert>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using ll = long long;
using P = pair<int, int>;
using MATRIX = vector< vector<ll> >;
template <class T> inline bool chmin(T &x, const T &y) {if (x > y) {x = y; return 1;} return 0;}
template <class T> inline bool chmax(T &x, const T &y) {if (x < y) {x = y; return 1;} return 0;}

int main() {
  string s;
  cin >> s;
  if(s[s.size()-1] == 's') {
    cout << s << "es" << endl;
  } else {
    cout << s << 's' << endl;
  }
  return 0;
}

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

#define rep(i,s,n) for(ll i = (s); i < (n); i++)
#define rep0(i,n) rep(i,0,n)
#define rep1(i,n) rep(i,1,n+1)
#define repR(i,s,n) for(ll i = (n-1); i >= (s); i--)
#define repR0(i,n) repR(i,0,n)
#define repR1(i,n) repR(i,1,n+1)

#define BR "\n"
#define SP " "
#define SHOW(x) for(int i = 0; i < x.size(); i++) { cout << x[i] << SP; } cout << BR;
#define SHOW2(x) for(int j = 0; j < x.size(); j++) { SHOW(x[j]); } cout << BR;
#define fcout cout << fixed << setprecision(18)

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

int a[100];
int cells[100][100]; // r * c

int main() {
  string S;
  cin >> S;

  string ans = "Yes";
  rep0(i, S.size()) {
    if ((i + 1) % 2 == 1 && S[i] == 'L') {
      ans = "No";
      break;
    }else if ((i + 1) % 2 == 0 && S[i] == 'R') {
      ans = "No";
      break;
    }
  }
  cout << ans << BR;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
	int x, fh, five;
	long long int hap;
	cin>>x;
	fh = x/500;
	hap = fh * 1000;
	x = x%500;
	five = x/5;
	hap = hap + five*5;
	cout<<hap<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) (a).size() 
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,a,n) for(int i=a;i<n;i++)
#define foreach(c,itr) for(__typeof((c).begin(),(c).end())itr=c.begin();itr!=c.end();itr++) 
#define fill(a,b) memset(a,b,sizeof(a))
#define re return
#define INF 1e9
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<pi > vpi; 
int main(){
	int a,b;
	cin>>a>>b;
	int ans=a-b*2;
	if(ans>0){
		cout<<ans;
	}
	else{
		cout<<"0"; 
	}
	re 0;
}

Measured memory_bytes: 256
#include <iostream>

int main()
{
    std::string s;
    std::cin >> s;

    int ans = 0;
    int count = 0;
    for (int i = 0; i < s.length(); i++) {
        if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
            count++;
        } else {
            ans = std::max(ans, count);
            count = 0;
        }
    }

    ans = std::max(ans, count);

    std::cout << ans << std::endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//ifstream cin("lineup.in");
//ofstream cout("lineup.out");
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
int main(){
    long long a,b;
    cin>>a>>b;
    long long z=__gcd(a,b);
    long long x=a*b;
    cout<<x/z<<endl;
}


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

int main() {
    int A,B,C,D;
    cin >> A >> B >> C >> D;
    if (A + B > C + D)
        cout << "Left" << endl;
    else if (A + B == C + D)
        cout << "Balanced" << endl;
    else{
        cout << "Right" << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <math.h>
#include <string>
#include <numeric>
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define rep1(i,n) for(ll i=1;i<n;++i)
#define mrep(i,n) for(ll i=n;i>=0;--i)
#define all(a) (a).begin(),(a).end()
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vb vector<bool>
#define vvb vector<vector<bool> >
#define pl pair<ll,ll>
#define inf 1001001001001000
//#define mod 1000000007
#define mod 2019
#define pi 3.1415926535
using namespace std;

ll mpow(ll a,ll b){
    if(b == 0) return 1;
    if(b == 1) return a%mod;
    if(b%2 == 0) return mpow((a*a)%mod,b/2)%mod;
    else return (a%mod)*mpow((a*a)%mod,(b-1)/2)%mod;
}

ll comb(ll a,ll b){
    if(a<b) return 0;
    if(a == b) return 1;
    ll ue = 1,sita = 1;
    rep(i,b){
        sita *= (i+1);
        ue *= a--;
    }
    return ue/sita;
}


int main(void){
    string suz;
    cin>>suz;
    vl pitsu(suz.size());
    pitsu[suz.size()-1] = suz[suz.size()-1]-'0';
    ll count = 1;
    mrep(i,suz.size()-2){
        pitsu[i] = (pitsu[i+1]+(mpow(10,count)*(suz[i]-'0'))%mod)%mod;
        count++;
    }
    map<ll,ll> ngo;
    rep(i,suz.size()){
        ngo[pitsu[i]]++;
    }
    ll ans = 0;
    for(pair<ll,ll> mp:ngo){
        if(mp.first == 0) ans += mp.second;
        ans += comb(mp.second,2);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 5108
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
 
int main(int argc, char* argv[])
{
    long n, k;
    scanf("%ld %ld", &n, &k);

    printf("%d\n", (n-2) / (k-1) + 1);
 
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int64_t i = 0; i < n; ++i)
using namespace std;

int main() {
  int n, m, M;
  cin >> n;
  vector<int> v(n);
  rep(i, n) cin >> v[i];
  m = v[0]; M = v[0];
  rep(i, n-1){
    m = min(m, v[i+1]); M = max(M, v[i+1]);
  }
  cout << M - m << endl;
  return 0;
}

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

const int N=1e7+10;
ll n,divnum[N],ans;

void getdivs(ll n){
	for(ll i=1;i*i<=n;i++){
		for(ll j=i;j*i<=n;j++){
			divnum[i*j]++;
			if(i!=j) divnum[i*j]++;
		}
	}
}
void work(){
	cin>>n;
	getdivs(n);
	for(ll i=1;i<=n;i++) ans+=divnum[i]*i;
	cout<<ans<<endl;
	return ;
}

int main(){
	//work();
	work();	
	return 0;
}


Measured memory_bytes: 81672
#include <iostream>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <string>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける
using vl = vector<ll>;  // long longの1次元の型に vl という別名をつける
using vvl = vector<vl>; // long longの2次元の型に vvl という別名をつける
int MOD = 1000000007; //10^9 + 7

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

// 無限大の値
const ll  lINF = 1LL << 60;
const int iINF = 1 << 29;

int main(void){
  int n;
  cin  >> n;
  cout << (n / 10 == 9 || n % 10 == 9 ? "Yes" : "No") << endl;
  return 0;
} 

Measured memory_bytes: 3568
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll MOD=1000000007;
int inf=1000001000;
ll INF=100000000000000000;


int main() {
    ll n,a;
    cin >> n >> a;
    ll dp[n+1][a*n+1];
    rep(i,n+1){
        rep(j,a*n+1) dp[i][j]=0;
    }
    dp[0][0]=1;
    rep(i,n){
        ll f;
        cin >> f;
        for (int j=i;j>=0;j--){
            for (int k=a*n;k>=0;k--){
                if (k+f>a*n) continue;
                dp[j+1][k+f]+=dp[j][k];
            }
        }
    }
    ll ans=0;
    rep(i,n){
        ans+=dp[i+1][(i+1)*a];
    }
    cout << ans << endl;
}



Measured memory_bytes: 1280
#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

const int INF = 1e9 + 7;

string s[205];

vi G[205], ans;
int vis[205];

bool dfs(int u, int c = 1) {
	vis[u] = c;
	for(int v:G[u]) {
		if(vis[v] == 0) {
			if(!dfs(v, c^1^2))
				return false;
		}
		else if(vis[v] == c)
			return false;
	}
	return true;
}

int32_t main()
{
	IO_OP;
	
	int n;
	cin >> n;
	for(int i=0;i<n;i++)
		cin >> s[i];	
	for(int i=0;i<n;i++) {
		for(int j=0;j<n;j++) {
			if(s[i][j] == '1')
				G[i].PB(j);
		}
	}
	if(!dfs(0)){
		cout << -1 << endl;
		return 0;
	}
	int ans = 0;
	for(int i=0;i<n;i++) {
		memset(vis, 0, sizeof vis);
		int cans = 0;
		vi v({i});
		vis[i] = 1;
		while(v.size()) {
			vi s;
			for(int uu:v)
				for(int u:G[uu])
					if(!vis[u]) {
						s.PB(u);
						vis[u] = 1;
					}
			swap(s, v);
			cans++;
		}
		ans = max(ans, cans);
	}
	cout << ans << endl;
}





Measured memory_bytes: 512
#include<iostream>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)  REP(i,0,n)

#define NODE 301
const int INF = ( 1 << 21);

int table[2][NODE][NODE];
inline void solve(int n){
  rep(k,n)
    rep(i,n)
    rep(j,n)table[0][i][j]=min(table[0][i][j],table[0][i][k]+table[0][k][j]),
    table[1][i][j]=min(table[1][i][j],table[1][i][k]+table[1][k][j]);
}


main(){
  int n,m;
  while(cin>>m>>n && n){
    rep(i,n){
      rep(j,n)table[0][i][j]=table[1][i][j]=INF;
      table[0][i][i]=table[1][i][i]=0;
    }
    rep(i,m){
      int a,b,cost,time;
      cin>>a>>b>>cost>>time;
      a--,b--;
      table[0][a][b]=cost;table[0][b][a]=cost;
      table[1][a][b]=table[1][b][a]=time;
    }

    solve(n);
    int q;
    cin>>q;
    rep(i,q){
      int f,t,type;
      cin>>f>>t>>type;
      cout << table[type][f-1][t-1] << endl;
    }
    
  }
}

Measured memory_bytes: 1108
#include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N = 1000;

int lcs(string x, string y) {
	int c[N + 1][N + 1];
	int m, n, i, j;

	m = x.size();
	n = y.size();

	int maxl = 0;
	x = ' ' + x;
	y = ' ' + y;

	for (i = 0; i <= m; i++)c[i][0] = 0;
	for (j = 0; j <= n; j++)c[0][j] = 0;

	for (i = 1; i <= m; i++) {
		for (j = 1; j <= n; j++) {
			if (x[i] == y[j])c[i][j] = c[i - 1][j - 1] + 1;
			else c[i][j] = max(c[i - 1][j], c[i][j - 1]);
		}
	}

	return c[m][n];
}

int main() {
	string s1, s2;
	int n, i;
	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		cin >> s1 >> s2;
		cout << lcs(s1, s2) << endl;
	}

	return 0;
}


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

#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int main() {
	cin.sync_with_stdio(false); cin.tie(0);
	cin.exceptions(cin.failbit);

	int c[3][3];
	rep(i, 0, 3) rep(j, 0, 3) cin >> c[i][j];

	bool gd =
		c[0][1] - c[0][0] == c[1][1] - c[1][0] && c[1][1] - c[1][0] == c[2][1] - c[2][0] &&
		c[0][2] - c[0][1] == c[1][2] - c[1][1] && c[1][2] - c[1][1] == c[2][2] - c[2][1] &&
		c[1][0] - c[0][0] == c[1][1] - c[0][1] && c[1][1] - c[0][1] == c[1][2] - c[0][2] &&
		c[2][0] - c[1][0] == c[2][1] - c[1][1] && c[2][1] - c[1][1] == c[2][2] - c[1][2];
	cout << (gd ? "Yes" : "No") << endl;
}


Measured memory_bytes: 256
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import permutations,combinations
from collections import defaultdict,Counter
from math import gcd,ceil,floor,factorial,pi
# from fractions import gcd
from functools import reduce
from pprint import pprint

def myinput():
    return map(int,input().split())

def mylistinput(n):
    return [ list(myinput()) for _ in range(n) ]

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col):
    data.sort(key=lambda x:x[col],reverse=False)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

r = int(input())
ans = 2*pi*r
print(ans)

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

int m , n ;

const pair < int , int > INF = make_pair( -int(1e9) + 7 , int(1e9) + 7 ) ;

int a[1010][1010] , sum[1010][1010] ;

pair < int , int > dp[1010][1010] ;

int get_sum( int x1 , int y1 , int x2 , int y2 ){
	return sum[x2][y2] - sum[x1 - 1][y2] - sum[x2][y1 - 1] + sum[x1 - 1][y1 - 1] ;
}

pair < int , int > combine( pair < int , int > foo , pair < int , int > bar ){
	if( foo.first - foo.second > bar.first - bar.second ) return foo ;
	return bar ;
}

pair < int , int > find_answer( int x , int y ){
	if(x == m && y == n) return dp[x][y] = make_pair(0 , 0) ;
	if( dp[x][y] != INF ) return dp[x][y] ;
	if( x != m ){
		pair < int , int > foo = find_answer(x + 1 , y) ;
		swap( foo.first , foo.second ) ;
		if( (x + y) % 2 == 0 ) foo.first += get_sum( x + 1 , y + 1 , x + 1 , n ) ;
		else foo.second += get_sum( x + 1 , y + 1 , x + 1 , n ) ;
		dp[x][y] = combine( dp[x][y] , foo ) ;
	}
	if( y != n ){
		pair < int , int > foo = find_answer(x , y + 1) ;
		swap(foo.first , foo.second) ;
		if( (x + y) % 2 ) foo.first += get_sum( x + 1 , y + 1 , m , y + 1 ) ;
		else foo.second += get_sum( x + 1 , y + 1 , m , y + 1 ) ;
		dp[x][y] = combine( dp[x][y] , foo ) ;
	}
	return dp[x][y] ;
}

int main(){
	#define NAME "ForecastofForces"
	//freopen( NAME".inp" , "r" , stdin ) ; freopen( NAME".out" , "w" , stdout ) ;

	cin >> n >> m ;

	for( int i = 1 ; i <= m ; ++ i ){
		for( int j = 1 ; j <= n ; ++ j ) {
			cin >> a[i][j] ;
			sum[i][j] = a[i][j] + sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1] ;
		}
	}
	
	for( int i = 0 ; i <= m ; ++ i ){
		for( int j = 0 ; j <= n ; ++ j ) dp[i][j] = INF ;
	}
	
	pair < int , int > ans = find_answer(0 , 0) ;

	cout << abs(ans.first - ans.second) << endl ;

	return 0 ;
}


Measured memory_bytes: 19140