akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define fo(i, n) for(int i = 0; i < n; ++i)
#define ll long long int
#define fok(i, k, n) for(int i = k; i < n; ++i)
#define MOD 1000000000+7
#define all(X) X.begin(), X.end()
#define pb push_back
#define present(a, x) (a.find(x)!=a.end())
using namespace std;

map <int, set <int> > m;

int main(){
  double stime = clock();
  double r;
  cin>>r;
  cout<<fixed<<setprecision(12)<<(2*3.14159265*r)<<'\n';


  double etime = clock();
  
   // cerr << "Execution time: " << (etime - stime) / CLOCKS_PER_SEC * 1000 << " ms.\n";
}

Measured memory_bytes: 3788
#include <bits/stdc++.h>
#define sz(arr) (int)(arr).size()
#define rng(arr) arr.begin(), arr.end()
#define show(x) cout << #x << " = " << x << endl;
#define rep(i, n) for (int i = 0; i < (n); ++i)

using namespace std;
typedef long long int ll;

void _cin() {}
template <class Head, class... Tail>
void _cin(Head&& head, Tail&&... tail) {
  cin >> head;
  _cin(forward<Tail>(tail)...);
}

#define Cin(T, ...) \
  T __VA_ARGS__;    \
  _cin(__VA_ARGS__)

#define Cins(T, n, xs) \
  vector<T> xs(n);     \
  for (int i = 0; i < n; ++i) cin >> xs[i]

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

void Main() {
  Cin(int, n);
  Cins(int, n, d);

  sort(rng(d));

  cout << (d[n / 2] - d[n / 2 - 1]) << endl;
}

Measured memory_bytes: 640
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()
print(factorial(n) % mod)


Measured memory_bytes: 6224
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,ans,a[200001];
signed main()
{
	scanf("%lld",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	for(int i=1;i<=n;i++)
		if(a[i-1]>a[i])
		{
			ans+=a[i-1]-a[i];
			a[i]=a[i-1];
		}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 5320
#include <stdio.h>

int main()
{
	int a,b;
	char op;
	
	while(1)
	{
		scanf("%d %c %d",&a,&op,&b);
		
		if(op == '?'){
			break;
		}
		
		if(op == '+')
		{
			printf("%d\n",a + b);
		}
		else if(op == '-')
		{
			printf("%d\n",a - b);
		}
		else if(op == '*')
		{
			printf("%d\n",a * b);
		}
		else if(op == '/')
		{
			printf("%d\n",a / b);
		}
	}
	return 0;
}

Measured memory_bytes: 600
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	static const int INF = 1e9 + 7;
	int h, w;
	cin >> h >> w;
	vector<string> info(h);
	for (auto&& i : info) {
		cin >> i;
	}
	vector<vector<int>> dp(h + 1, vector<int>(w + 1));
	for (int i = 0; i <= w; i++) {
		dp[0][i] = INF;
	}
	for (int i = 0; i <= h; i++) {
		dp[i][0] = INF;
	}
	for (int i = 1; i <= h; i++) {
		for (int j = 1; j <= w; j++) {
			if(i == 1 && j == 1){
				dp[i][j] = 0;
				continue;
			}
			if (i == 1) {
				dp[i][j] = dp[i][j - 1] + (info[i - 1][j - 2] == '#' && info[i - 1][j - 1] == '.');
				continue;
			}
			if (j == 1) {
				dp[i][j] = dp[i - 1][j] + (info[i - 2][j - 1] == '#' && info[i - 1][j - 1] == '.');
				continue;
			}
			int left = dp[i][j - 1] + (info[i - 1][j - 2] == '#' && info[i - 1][j - 1] == '.');
			int up = dp[i - 1][j] + (info[i - 2][j - 1] == '#' && info[i - 1][j - 1] == '.');
			dp[i][j] = min(left, up);
		}
	}
	cout << dp[h][w] + (info[h - 1][w - 1] == '#') << "\n";
}

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

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;
typedef long long ll;
typedef long double ld;

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define fi first
#define se second

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;
typedef long long ll;
typedef long double ld;

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define fi first
#define se second


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

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

    ld res = 0.00;

    for(int i = 1; i <= n; ++i)
    {
        int tren = i;
        ld temp = 1.00 / n;
        while(tren < k)
        {
            tren<<=1;
            temp /= 2.00;
        }
        res += temp;
    }
    cout << fixed << setprecision(10) << res << '\n';
}


Measured memory_bytes: 3748
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,Y;
  int x=-1,y=-1,z=-1;
  cin >> N >> Y;
  for(int a=0; a<=N; a++){
  	for(int b=0; b<=N-a; b++){
      if(a*10000+b*5000+(N-a-b)*1000==Y){
        x=a;
      	y=b;
        z=N-a-b;
      }
    }
  }
  cout << x << " "<< y << " "<< z << endl;
}

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

int main() {
    cout << fixed << setprecision(10);
    
    int N; cin >> N;
    N %= 10;

    if (N == 3) {
        cout << "bon" << endl;
    } else if (N == 0 || N == 1 || N == 6 || N == 8) {
        cout << "pon" << endl;
    } else {
        cout << "hon" << endl;
    }
    return 0;
}

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

int main() {
    int N;
    scanf("%d", &N);
    int ans = 0;
    for (int i = 1; i <= N; i++) {
        if (i % 2 == 0) continue;
        int cnt = 0;
        for (int j = 1; j <= i; j++) {
            if (i % j == 0) cnt++;
        }
        if (cnt == 8) ans++;
    }
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 256
// In the name of Allah the Lord of the Worlds.

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

typedef long long ll;

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

    int n;
    cin >> n;
    vector<int>v(n);
    for(int &x:v)cin >> x;
    int mi = 1e9 , s1 = 0;
    for(int i=0;i<v.size();i++){
        s1+=v[i];
        int s2 = 0;
        for(int j=i+1;j<v.size();j++){
            s2+=v[j];
        }
        mi = min(abs(s1-s2) , mi);
    }
    cout << mi << endl;

    return 0;
}


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

int main() {

 string S;
 cin >> S;

 int num1 = 0,num0 = 0;
  for(int i = 0;i < S.size();i += 2) {
    if(S.at(i) == '1') num1++;
    if(i + 1 < S.size()) {
      if(S.at(i + 1) == '0') num1++;  
    }
  }

   for(int i = 0;i < S.size();i += 2) {
    if(S.at(i) == '0') num0++;
    if(i + 1 < S.size()) {
      if(S.at(i + 1) == '1') num0++;
    }
   }

   cout << min(num1,num0) << endl;
}


Measured memory_bytes: 512
def taka(A):
  t = 0
  for a1 in range(101):
    b1 = A[0][0] - a1#A11
    b2 = A[0][1] - a1#A12
    b3 = A[0][2] - a1#A13
    a2 = A[1][0] - b1#A21
    a3 = A[2][0] - b1#A31
    if a2 + b2 != A[1][1]:
      t = 1
    if a2 + b3 != A[1][2]:
      t = 1    
    if a3 + b2 != A[2][1]:
      t = 1      
    if a3 + b3 != A[2][2]:
      t = 1
    #print(a1, a2, a3, b1, b2, b3, t)
    if t == 0:
      return "Yes"
    
  return "No"  

if __name__ == "__main__":
  C = [0] * 3
  for i in range(3):
    C[i] = list(map(int, input().split()))
  print(taka(C))
  

Measured memory_bytes: 9096
import java.util.Scanner;

public class Main {
    void run() {
        Scanner scan = new Scanner(System.in);
        long n = scan.nextLong();
        long m = scan.nextLong();
        if (n > m) {
            long tmp = n;
            n = m;
            m = tmp;
        }
        if (n == 1) {
            if (m < 3)
                System.out.println(1);
            else
                System.out.println(m - 2);
        } else if (n == 2) {
            System.out.println(0);
        } else {
            System.out.println((n - 2) * (m - 2));
        }
    }
    public static void main(String[] args) {
        new Main().run();
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back

using namespace std;
typedef pair<ll,ll> pll;


ll n,a,b,c,d;
string s;
bool canGO(string ss, ll x, ll y)
{
        //cout << x << " " << y << endl;
        assert(ss[x] == '.' && ss[y] == '.');
        for(ll i=x+1;i<=y;i++) {
                if(ss[i] == '#' && ss[i-1] == '#') return false;
        }
        return true;
}
ll fnd(string ss, ll x, ll y)
{
        if(x==y) return -1;
        for(ll i=x;i<=y;i++){
                if(ss[i-1] != '#' && ss[i+1] != '#' && s[i] != '#') return i;
        }
        return -1;
}
int main()
{
        cin >> n >> a >> b >> c >> d;
        cin >> s;
        s = "#" + s;
        ll ok = 0;
        //s[a] = '#';
        if(c < d) {
                if(canGO(s, b, d)) {

                        string t = s;
                        s[d] = '#';
                        if(canGO(t,a,c)) ok =1;
                }
        }else {
                string t = s;
                t[b] = '#';
                if(canGO(t , a , c)){
                        t[b] = '.';
                        if(canGO(t,b,d)) ok = 1;
                }else {
                        //cout << "NYES\n\n";
                        t[b] = '.';
                        ll k = fnd(t,b,d);
                        if(k != -1){
                                t[k] = '#';
                                if(canGO(t,a,c)){
                                        t[k] = '.';
                                        if(canGO(t , b,d)) ok = 1;
                                }
                        }
                }
        }
        if(ok) cout << "Yes\n";
        else cout << "No\n";
        return 0;
}


Measured memory_bytes: 844
#include<bits/stdc++.h>
#define pb push_back
#define mod int(1e9+7)
#define N int(1e5+100)
#define pi 3.141592653589793238
#define ll unsigned long long int
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fi first
#define si second
using namespace std;
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int r;
	cin>>r;
	printf("%.3f\n",(2*pi*r));
   return 0;
}

Measured memory_bytes: 3740
// AOJ 2364: Lucky Dip
// 2017.10.4 bal4u@uu

#include <stdio.h>

#define MAX 1000500

/* UNION-FIND library */
int p[MAX], rank[MAX];
void make_set(int x) { p[x] = x, rank[x] = 0; }
void link(int x, int y) {
	if (rank[x] > rank[y]) p[y] = x;
	else { p[x] = y; if (rank[x] == rank[y]) rank[y] = rank[y] + 1;	}
}
int find_set(int x) { if (x != p[x]) p[x] = find_set(p[x]);	return p[x]; }
void union_set(int x, int y) { link(find_set(x), find_set(y)); }

char map[1001][1001];
int v[1001][1001];
int mv[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};

int main()
{
	int w, h, n, i, s, r, c, r2, c2, gr, gc, ans;

	scanf("%d%d", &w, &h);
	for (i = 0, r = 0; r < h; r++) {
		scanf("%s", map[r]);
		for (c = 0; c < w; c++) {
			v[r][c] = i;
			make_set(i++);
			if (map[r][c] == 't') gr = r, gc = c;
		}
	}
	for (r = 0; r < h; r++) for (c = 0; c < w; c++) {
		if (map[r][c] == '#') continue;
		for (i = 0; i < 4; i++) {
			r2 = r + mv[i][0], c2 = c + mv[i][1];
			if (r2 >= 0 && r2 < h && c2 >= 0 && c2 < w && map[r2][c2] != '#')
				union_set(v[r][c], v[r2][c2]);
		}
	}
	if (find_set(v[0][0]) == find_set(v[gr][gc])){ puts("0"); return 0; }

	scanf("%d", &n);
	for (ans = -1, s = 1; s <= n; s++) {
		scanf("%d%d", &c, &r);
		if (map[r][c] == '.') continue;
		map[r][c] = '.';
		for (i = 0; i < 4; i++) {
			r2 = r + mv[i][0], c2 = c + mv[i][1];
			if (r2 >= 0 && r2 < h && c2 >= 0 && c2 < w && map[r2][c2] != '#')
				union_set(v[r][c], v[r2][c2]);
		}
		if (find_set(v[0][0]) == find_set(v[gr][gc])) { ans = s; break; }
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 14448
// C++ 14
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(ll __x = __start; __x < __end; __x++)

typedef pair<int, int> Edge;

int main() {
  int h, w; cin >> h >> w;
  const int INF = 1000000000;
  int G[10][10];
  loop(i,0,10) loop(j,0,10) 
    if (i==j) G[i][j] = G[j][i] = 0;
    else G[i][j] = G[j][i] = INF;
  loop(i,0,10) loop(j,0,10) {
    int w; cin >> w;
    if (w==0) continue;
    G[i][j] = w;
  }
  loop(k,0,10) loop(i,0,10) {
    if (G[i][k] == INF) continue;
    loop(j,0,10) {
      if (G[k][j] == INF) continue;
      G[i][j] = min(G[i][j], G[i][k] + G[k][j]);
    }
  }
  
  ll ans = 0;
  loop(y,0,h) loop(x,0,w) {
    int a; cin >> a;
    if (a == -1) continue;
    ans += G[a][1];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3644
N, D = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]

def dist(y,z):
    tmp = 0
    for k in range(D):
        tmp += (y[k] - z[k])**2
    return (tmp**0.5).is_integer()

ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        if dist(X[i], X[j]):
            ans += 1

print(ans)

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

#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...) 6;
#endif

template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typename T = decay<decltype(*begin(declval<C>()))>, typename enable_if<!is_same<C, string>::value>::type* = nullptr>
ostream& operator << (ostream &os, const C &c) {bool f = true; os << "["; for (const auto &x : c) {if (!f) os << ", "; f = false; os << x;} return os << "]";}
template<typename T> void debug(string s, T x) {cerr << s << " = " << x << "\n";}
template<typename T, typename... Args> void debug(string s, T x, Args... args) {cerr << s.substr(0, s.find(',')) << " = " << x << " | "; debug(s.substr(s.find(',') + 2), args...);}

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

    long long n, m;
    cin >> n >> m;
    if (n > m)
        swap(n, m);

    if (n == 1)
        cout << (m == 1 ? 1 : m - 2) << "\n";
    else
        cout << (n - 2) * (m - 2) << "\n";

    return 0;
}


Measured memory_bytes: 3648
#include<cstdio>
#include<cstdlib>
#include<string>
#include<iostream>
using namespace std;

struct Node
{
    int key;
    Node *right, *left, *parent;
};

Node *root, *NIL;

void insert(int k)
{
    Node *y = NIL;
    Node *x = root;
    Node *z;

    z = (Node *)malloc(sizeof(Node));
    z->key = k;
    z->left = NIL;
    z->right = NIL;

    while ( x != NIL)
    {
        y = x;
        if (z->key < x->key)
        {
            x = x->left;
        }
        else
        {
            x = x->right;
        }
    }
    z->parent = y;
    if (y == NIL)
    {
        root = z;
    }
    else
    {
        if (z->key < y->key)
        {
            y->left = z;
        }
        else
        {
            y->right = z;
        }
    }
}

void inorder(Node *u)
{
    if ( u == NIL) return;
    inorder(u->left);
    printf(" %d", u->key);
    inorder(u->right);
}

void preorder(Node *u)
{
    if ( u == NIL) return;
    printf(" %d", u->key);
    preorder(u->left);
    preorder(u->right);
}

int main()
{
    int n, i, x;
    string com;

    scanf("%d", &n);

    for ( i = 0; i < n; i++)
    {
        cin >> com;
        if ( com == "insert")
        {
            scanf("%d", &x);
            insert(x);
        }
        else if ( com == "print")
        {
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
    }
    return 0;
}


Measured memory_bytes: 26712
#include <iostream>
#include <string>

#include <cstdlib>

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

  if (*s.rbegin() == 's') {
    std::cout << s << "es\n";
  } else {
    std::cout << s << "s\n";
  }
}


Measured memory_bytes: 3160
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,k,score;
    cin>>n>>k;
    
    double ans=0.0;
    double p;
    
    for(int i=1;i<n+1;i++){
        score=i;
        p=1.0;
        while(score<k){
            p/=2;
            score*=2;
        }
        ans+=p;
    }
    ans/=n;
    
    cout<<fixed<<setprecision(12)<<ans<<endl;
}


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

int main(){
	string str;
	while(getline(cin, str)){
		while(str.find("this", 0) == string::npos && str.find("that", 0) == string::npos && str.find("the", 0) == string::npos){
			for(int i = 0; i < str.size(); ++i){
				if(str[i] >= 'a' && str[i] <= 'z'){
					if(str[i] != 'z')
						++str[i];
					else
						str[i] = 'a';
				}
			}
		}
		cout << str << endl;
	}
	return 0;
}

Measured memory_bytes: 1176
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define N 100009

int main()
{
    ll n, ans = 10000000000000000LL;
    cin >> n;
    for(ll i = 1; i * i <= n; i++)
    {
        if(n % i == 0LL)
        {
            ans = min(ans, (n / i) + i - 2);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
n, a, b = input().split()
n = int(n)
a = int(a)
b = int(b)
 
d = n // (a + b)
m = n % (a + b)
 
blue = a * d
if m >= a:
  blue = blue + a
else:
  blue = blue + m
  
print(blue)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define int long long
#define F first
#define S second
using namespace std;
int mod=1e15;


int32_t main() {
    int T;
    T=1;
    //cin>>T;
    while(T--){
        int n,W;
        cin>>n>>W;
        int w[n], v[n];
        for(int i=0;i<n;i++){
            cin>>w[i]>>v[i];
        }
        int dp[n+1][100005], ans=0;
        for(int i=0;i<n+1;i++){
            for(int j=0;j<=100000;j++){
                dp[i][j]=mod;
            }
        }
        dp[0][0]=0;
        for(int i=1;i<n+1;i++){
            for(int j=0;j<=100000;j++){
                dp[i][j]=dp[i-1][j];
                if(j-v[i-1]>=0){
                    dp[i][j]=min(dp[i][j], w[i-1] + dp[i-1][j-v[i-1]]);
                }
                if(i==n && dp[i][j]<=W)ans=j;
            }
        }
        // for(int i=0;i<n+1;i++){
        //     for(int j=0;j<=90;j++){
        //         cout<<dp[i][j]<<" ";
        //     }cout<<endl;
        // }
        
        cout<<ans;
        cout<<'\n';
    }
	return 0;
}

Measured memory_bytes: 79104
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int k = sc.nextInt();
        String s = sc.next();

        if(s.length() <= k) {
            System.out.println(s);
        } else {
            System.out.println(s.substring(0, k) + "...");
        }
    }
}

Measured memory_bytes: 38676
def main():
    s = list(input())
    flg = 'h'
    for i, a in enumerate(s):
        if a == flg:
            if flg == 'h':
                flg = 'i'
            elif flg == 'i':
                flg = 'h'
            else:
                print('No')
                return
        else:
            print('No')
            return
    if flg == 'h':
        print('Yes')
    else:
        print('No')
if __name__=='__main__':
    main()


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

int main(){
  int n;
  cin >> n;
  string ans = "No";
  int dig1 = n/100;
  int dig2 = (n-dig1*100)/10;
  int dig3= n%10;
  
  if(dig1==7){
    ans = "Yes";
  }else if(dig2==7){
    ans = "Yes";
  }else if(dig3==7){
    ans = "Yes";
  }
  cout << ans;
}


Measured memory_bytes: 3624
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)

int main() {
	string s; cin >> s;
	ll ans = 0;
	rep(i, 1, s.size()) {
		if (s[i] != s[i - 1]) ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

void solve() {
	int n;
	cin >> n;
	vector<ll> v(n);
	rep(i,n) cin >> v[i];
	ll g = v[0];
	rep(i,n) g = lcm(g, v[i]);
	cout << g << endl;
}

int main() {
	solve();
	return 0;
}

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

int main(){
  ll n;
  cin >> n;
  vector<ll> A(n);
  rep(i,n) cin >> A[i];
  cout << *max_element(A.begin(),A.end()) - *min_element(A.begin(),A.end()) << endl;
  
  return 0;
}


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

d=0
for i in range(n):
  if a[i]%2==0:
    if a[i]%3 != 0 and a[i]%5 != 0:
      print('DENIED')
      d = 1
      break
if d==0:
  print('APPROVED')

Measured memory_bytes: 3060
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;

import java.util.PriorityQueue;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main {
	
	public static final long MOD = 1000000007;
	
	public static void main(String[] args) throws IOException {
		try(final Scanner sc = new Scanner(System.in)){
			final int N = sc.nextInt();
			
			double[] ps = new double[N];
			for(int i = 0; i < N; i++) { ps[i] = sc.nextDouble(); }
			
			double[][] DP = new double[N + 1][N + 1];
			DP[0][0] = 1.0 - ps[0];
			DP[0][1] = ps[0];
			
			for(int i = 1; i < N; i++) {
				for(int cnt = 0; cnt <= N; cnt++) {
					if(cnt > 0){ DP[i][cnt] += (DP[i - 1][cnt - 1] * ps[i]);}
					           { DP[i][cnt] += (DP[i - 1][cnt - 0] * (1.0 - ps[i])); }
				}
			}
			
			//System.out.println(Arrays.deepToString(DP));
			
			double answer = 0;
			for(int i = N / 2 + 1; i <= N; i++) { 
				//System.out.println(i + " " + DP[N - 1][i]);
				answer += DP[N - 1][i];
			}
			
			System.out.printf("%.10f\n", answer);
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}

Measured memory_bytes: 130856
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <iostream>
using namespace __gnu_pbds;
using namespace std;


typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    ordered_set;
/*
ordered_set(both these operations in log)
1. find_by_order : it returns iterator to the ith largest element.
2. order_of_key  : The number of items in a set that are strictly smaller than k.
*/

//memset(dp,-1,sizeof(dp));
//fill(v.begin(), v.end(), -1);
//priority_queue< pii, vector <pii> , greater<pii>> pq;
//vector<int> dist(V, INF);


#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define lb lower_bound
#define ub upper_bound

#define pb(x)               push_back(x)
#define mp(x,y)             make_pair(x,y)
#define pii                 pair<int,int>
#define vi                  vector<int>
#define vii                 vector<pii>
#define mi                  map<int,int>
#define mii                 map<pii,int>
#define all(a)              (a).begin(),(a).end()
#define fi                  first
#define se                  second
#define sz(x)               (int)x.size()
#define endl                '\n'
#define md                  1000000007
#define rep(i,a,b)          for(int i=a;i<b;i++)
#define pcout(x)	          cout<<fixed<<setprecision(x)
#define debug(x)            cout<<#x<<"::"<<x<<endl;
#define debug2(x,y)         cout<<#x<<"::"<<x<<"\t"<<#y<<"::"<<y<<endl;
#define boost               ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)



typedef long long ll;
typedef double ld;

inline ll prodm(ll a,ll b)  {return ((a%md)*(b%md))%md;}
inline ll summ(ll a,ll b)   {return ((a%md)+(b%md))%md;}
inline bool ispow2(ll x)    {return  x && (!(x&(x-1)));}

const int N = 1e5 + 5;
const ll  infl=0x3f3f3f3f3f3f3f3fLL;
const int infi=0x3f3f3f3f;

/**************************BounceBackBolt*********************************/
ll fastexpo(ll n,ll pwr)
{
  if(pwr==0)
    return 1;
  if(pwr==1)
    return n;
  ll ans=fastexpo(n,pwr/2);
  ans=prodm(ans,ans);
  if(pwr&1)
  {
      ans=prodm(ans,n);
  }
    return ans;
}

ll modInverse(ll base)
{return fastexpo(base,md-2);}


vector < int > g[N];
int d[N];
void dfs(int v, int p, int dd){
    d[v] = dd;
    for(int to : g[v]){
        if(to == p) continue;
        dfs(to, v, dd + 1);
    }
}

/*********************************************************************/
int main()
{
  boost;
  int T=1;//cin>>T;
  while(T--)
  {
    int a,b;
    cin>>a>>b;
    if(b>=a)cout<<"unsafe";
    else
    cout<<"safe";
  }
  return 0;
}


Measured memory_bytes: 6004
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

using namespace std;
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define MOD (1000000007)
#define vi vector<int>
#define vl vector<ll>
#define vvi vector<vi>
#define vvl vector<vl>
#define pii pair<int, int>
#define pb push_back

#define mp make_pair
#define all(a) (a).begin(),(a).end()

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

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

ll keta(ll n){
  string s = to_string(n);
  ll num = s.size();
  return num;
}

const ll INF = 1LL << 60;

const int dh[4] = {1,0,-1,0};
const int dw[4] = {0,1,0,-1};

int main(){
  int n,m; cin >> n >> m;
  vector<pii> key(m);
  rep(i,m) {
    int a,b; cin >> a >> b;
    int s = 0;
    rep(j,b) {
      int c; cin >> c;
      c--;
      s |= (1 << c);
    }
    key[i] = mp(s,a);
  }

  vi dp((1<<n),1e9);
  dp[0] = 0;
  rep(bit,(1<<n)) rep(i,m) {
    int s = key[i].first;
    int cost = key[i].second;
    chmin(dp[bit|s], dp[bit] + cost);
  }

  int ans = dp.back();
  if(ans == 1e9) ans = -1;
  cout << ans << endl;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
//const ll mod=998244353;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
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; }
using PP=pair<int,pair<int,int>>;
int main(){
    set<PP> s;
    int n,m;cin>>n>>m;
    for(int i=0;i<n;i++){
       int a,b,c;
       cin>>a>>b>>c;
       s.insert(PP(a-c,P(-1,c)));
       s.insert(PP(b-c-1,P(1,c)));
    }
    V<int> ans(m,-1);
    for(int i=0;i<m;i++){
           int q;
           cin>>q;
           s.insert(PP(q,P(0,i)));
    }
    set<int> d;
    while(s.size()){
        PP p=*s.begin();
        s.erase(s.begin());
        if(p.se.fi==-1){
               d.insert(p.se.se);
        }
        else if(p.se.fi==0){
            if(d.size()){
                ans[p.se.se]=*d.begin();
            }
        }
        else{
                d.erase(p.se.se);
        }
    }
    for(int v: ans)cout<<v<<endl;
}

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

map<int, int> id;

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

    for (int i = 0; i < n; i++) {
        int tmp;
        scanf("%d", &tmp);
        id[tmp]++;
    }

    int cnt = 0;
    for (auto x : id) {
        if (x.first == x.second) continue;

        if (x.second < x.first) cnt += x.second;
        else cnt += (x.second - x.first);
    }

    cout << cnt << endl;
}


Measured memory_bytes: 4736
S = input()
K = int(input())

if all([c == '1' for c in S]):
    print(1)
    exit(0)

first_not1 = None
for i in range(len(S)):
    if S[i] != '1':
        first_not1 = i
        break

if K - 1 < first_not1:
    print(1)
else:
    print(S[first_not1])


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(n); ++i)
#define repr(i, a, b) for (int i=a; i<(b); ++i)
#define reprev(i, n) for (int i=n-1; i>=0; --i)
#define reprrev(i, a, b) for (int i=b-1; i>=(a); --i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int main() {
    cout << fixed << setprecision(10);
    
    int N; cin >> N;
    vector<int> a(N), b(N), c(N);
    rep(i, N) cin >> a[i] >> b[i] >> c[i];
    vector<vector<int>> dp(N+1, vector<int>(3));

    rep(i, N) {
        // aの更新
        dp[i+1][0] = max(dp[i][1]+a[i], dp[i][2]+a[i]);
        dp[i+1][1] = max(dp[i][0]+b[i], dp[i][2]+b[i]);
        dp[i+1][2] = max(dp[i][0]+c[i], dp[i][1]+c[i]);
    }

    int res = 0;
    rep(i, 3) {
        res = max(res, dp[N][i]);
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 6912
#include<stdio.h>

int main(){
  int a,b,c;
  scanf("%d",&a);
  scanf("%d",&b);
  scanf("%d",&c);
  
  if(a == b){
    if(b != c){
      printf("Yes");
    }
    else printf("No");
  }
  
  else if(b == c){
    if(a != c){
      printf("Yes");
    }
    else printf("No");
  }
  
  else if(a == c){
    if(b != a){
      printf("Yes");
    }
    else printf("No");
  }
  
  else printf("No");
  
}

 

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

int main(){
  int n, x;
  cin >> n >> x;
  if(x == 1 || x == 2*n-1){
    cout << "No" << endl;
    return 0;
  }
  vector<int> ans(2*n-1);
  if(x >= n){
    for(int i=0; i<2*n-1; ++i){
      ans[i] = x-n +i +1;
      if(ans[i] > 2*n-1) ans[i] -= 2*n-1;
    }
  }else{
    for(int i=0; i<2*n-1; ++i){
      ans[i] = n +x +i;
      if(ans[i] > 2*n-1) ans[i] -= 2*n-1;
    }
  }
  printf("Yes\n");
  for(int i=0; i<2*n-1; ++i){
    printf("%d\n", ans[i]);
  }
}

Measured memory_bytes: 4036
#include <stdio.h>

int main(void)
{
	int n;
	int i;
	
	int stone;
	int man;
	
	scanf("%d", &n);
	
	for (i = 0; i < n; i++){
		scanf("%d %d", &stone, &man);
		
		if (stone % man == 0){
			printf("%d\n", man);
		}
		else {
			printf("%d\n", stone % man);
		}
	}
	
	return (0);
}

Measured memory_bytes: 596
N = int(input())

ans = 0
for _ in range(N - 1):
    fr, to = map(int, input().split())
    if fr > to:
        fr, to = to, fr
    ans += fr * (N - to + 1)

for l in range(1, N + 1):
    ans -= (N * (N + 1) // 2 - l * (l - 1) // 2)
    ans += (l - 1) * (N - l + 1)
print(-ans)


Measured memory_bytes: 8964
// Aaradhya Beri
#pragma GCC optimze("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef long double f80;
#define double long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
#define w(x) int x; cin>>x; while(x--)
const ll infl=0x3f3f3f3f3f3f3f3fLL;
const int infi=0x3f3f3f3f;
//const int mod=998244353;
const int mod=1000000007;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}
 

signed main() {
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cout<<fixed<<setprecision(8);
    int n;
    cin>>n;
    int d = n%10;
    if(d == 2 || d == 4 || d == 5 || d == 7 || d == 9)
        cout<<"hon"<<endl;
    else if(d == 0 || d == 1 || d == 6 || d == 8)
        cout<<"pon"<<endl;
    else if (d == 3)
        cout<<"bon"<<endl;
    return 0;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(ll i=a;i<b;i++)
int main(){
  ll n,ans=0;
  cin>>n;
  rep(i,0,n){
    ll l,r;
    cin>>l>>r;
    ans+=r-l+1;
  }
  cout<<ans;
}



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

using namespace std;
typedef long long ll;

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define REPR(i, n) for (ll i = (n); i >= 0; i--)
#define FOR(i, m, n) for (ll i = (m); i < (n); i++)
#define FORR(i, m, n) for (ll i = (m); i >= (n); i--)
#define INF 1e9
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((ll)(x).size())
#define SORT(x) sort((x).begin(), (x).end())
#define dump(x) cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl

int main(int argc, char const *argv[])
{
    ll a;
    string s;
    cin >> a;
    cin >> s;
    if (a >= 3200)
        cout << s << endl;
    else
        cout << "red" << endl;
    return 0;
}


Measured memory_bytes: 764
#include<cstdio>

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

using namespace std;

template<class T>
struct interval{ T a,b; };

int main(){
	int n,m; scanf("%d%d",&n,&m);
	interval<int> I[100];
	rep(i,m) scanf("%d%d",&I[i].a,&I[i].b), I[i].a--, I[i].b--;

	int ans=0,pos=0;
	while(pos<n){
		int i0=-1;
		rep(i,m) if(I[i].a<=pos && pos<=I[i].b) {
			if(i0==-1 || I[i0].b<I[i].b) i0=i;
		}
		if(i0==-1){
			puts("Impossible");
			return 0;
		}
		else{
			pos=I[i0].b+1;
			ans++;
		}
	}
	printf("%d\n",ans);

	return 0;
}

Measured memory_bytes: 0
import sys

l = []
for line in sys.stdin:
    l.append([int(i) for i in line.split()])

a, b, k = l[0]
s = a if a < b else b

r = []
for i in range(1, s+1, 1):
    if a % i == 0 and b % i == 0:
        r.append(i)
print(r[-k])

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

using namespace std;

#define pii pair<int, int>
#define fi first
#define se second 
#define REP(a, b, c) for (register int a = b, _n = c; a <= _n; ++a)
#define DREP(a, b, c) for (register int a = b, _n = c; a >= _n; --a)
#define FOR(a, b, c) for (register int a = b, _n = c; a < _n; ++a)
#define DFOR(a, b, c) for (register int a = b, _n = c; a > _n; --a)
#define EREP(a, b) for (register int a = head[b]; a; a = edge[a].nxt)

int n;
int a[3005];

int C[3005][3005];

int ans[3005];

int main () {
	scanf ("%d", &n);

	REP (i, 0, n) REP (j, 0, i)
		if (i == 0 || j == 0) C[i][j] = 1;
		else C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % n;

	FOR (i, 0, n) {
		scanf ("%d", a + i);
		if (a[i]) {
			int now = 1;
			DREP (j, n - 1, 0) {
				ans[j] -= C[n - 1][j] * now;
				ans[j] %= n;
				now *= -i;
				now %= n;
			}
			++ans[0];
		}
	}

	FOR (i, 0, n)
		printf ("%d ", (ans[i] % n + n) % n);
	puts("");

	return 0;
}


Measured memory_bytes: 34304
#include <iostream>
#include <cstdio>
#include <iomanip>
using namespace std;
const int M = 100000;
const double pi = 3.141592653589;

int main()
{
	int h, w;
	while (1) {
		cin >> h >> w;
		if (h == 0 && w == 0) {
			break;
		}

		for (int j = 0; j < w; j++) {
			cout << '#';
		}
		cout << endl;

		for (int i = 1; i < h-1; i++) {
			cout << '#';
			for (int j = 1; j < w-1; j++) {
				cout << '.';
			}
			cout << '#';
			cout << endl;
		}

		for (int j = 0; j < w; j++) {
			cout << '#';
		}
		cout << endl << endl;
	}
	return 0;
}

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

string divide[4] = {"dream","dreamer","erase","eraser"};

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

  // 左右反転
  reverse(S.begin(), S.end());
  for(int i=0; i<4; i++) reverse(divide[i].begin(), divide[i].end());

  bool can = true;
  for(int i=0; i < S.size();){
    bool can2 = false;
    for(int j=0;j < 4;++j){
      string d = divide[j];
      if(S.substr(i, d.size()) == d){
	can2 = true;
	i += d.size();
      }
    }
    if(!can2){
      can = false;
      break;
    }
  }
  if(can) cout << "YES" << endl;
  else cout << "NO" << endl;
}


Measured memory_bytes: 512
#include<vector>
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<string.h>
#include<list>
#define MOD 1000000007LL
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
int main() {
    int n;
    cin>>n;
    int c[600],s[600],f[600];
    for(int i=0;i<n-1;i++){
        cin>>c[i]>>s[i]>>f[i];
    }
    for(int i=0;i<n;i++){
        int t=0;
        for(int j=i;j<n-1;j++){
            if(t<s[j]){
                t=s[j];
            }else if(t%f[j]==0){
                t=t;
            }else{
                t+=f[j]-(t%f[j]);
            }
            t+=c[j];
        }
        cout<<t<<endl;
    }
}


Measured memory_bytes: 256
n,k = map(int, input().split())
a = list(map(int, input().split()))
prod  = 1
# for i in range(k-1):
#     prod *= a[i]
j = 0
for i in range(k,n):
    
    if a[i] > a[j]:
        print("Yes")
    else:
        print("No")
    j += 1
    #print(prod, prod//a[j] * a[i+1])
    


Measured memory_bytes: 31440
#include<stdio.h>

long long int nibutan(long long int left, long long int right, long long int num) {
	long long int memo = (left + right) / 2;
	if (memo*(memo + 1) < num && (memo + 2)*(memo + 1) >= num) { return memo; }
	if (memo*(memo + 1) >= num && (memo + 2)*(memo + 1) >= num) { return nibutan(left, memo, num); }
	if (right - left == 1) { return right; }
	if (memo*(memo + 1) < num && (memo + 2)*(memo + 1) < num) { return nibutan(memo, right, num); }
}
long long int nibutan2(long long int left, long long int right, long long int num) {
	long long int memo = (left + right) / 2;
	if (memo*memo < num && (memo + 1)*(memo + 1) >= num) { return memo; }
	if (memo*memo >= num && (memo + 1)*(memo + 1) >= num) { return nibutan2(left, memo, num); }
	if (right - left == 1) { return right; }
	if (memo*memo < num && (memo + 1)*(memo + 1) < num) { return nibutan2(memo, right, num); }
}

int main() {

	long long int n, memo, r;
	long long int a[105], b[105];
	scanf("%lld", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lld%lld", &a[i], &b[i]);
		memo = a[i] * b[i];


		if (a[i] == b[i]) {
			printf("%lld\n", 2 * (a[i] - 1));
		}
		else if (a[i] >= b[i] && nibutan(0, a[i], memo) >= nibutan2(0, a[i], memo)) {


			printf("%lld\n", 2 * nibutan(0, a[i], memo) - 1);
		}
		else if (a[i] < b[i] && nibutan(0, b[i], memo) >= nibutan2(0, b[i], memo)) {
			printf("%lld\n", 2 * nibutan(0, b[i], memo) - 1);

		}
		else if (a[i] >= b[i] && nibutan(0, a[i], memo) < nibutan2(0, a[i], memo)) {
			printf("%lld\n", 2 * nibutan(0, a[i], memo));
		}
		else if (a[i] < b[i] && nibutan(0, b[i], memo) < nibutan2(0, b[i], memo)) {
			printf("%lld\n", 2 * nibutan(0, b[i], memo));
		}
	}

}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long a,b,c,x;
    cin>>a>>b>>c;
    x=c-a-b;
    if(x>0 && x*x>4*a*b)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


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

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

Measured memory_bytes: 256
#include<iostream>
#include<stack>
#include<queue>
#include<cstring>
#define INF 1 << 15
using namespace std;
struct d{
	int x;
	int y;
	int visited[12][12];
	int ic[144];
	int cnt;
};
struct b{
	int x;
	int y;
};
int main(){
	int lx,ly,i,j,nc=1,k,a,min=144,gx,gy,ex,ey;
	int maps[12][12]={0};
	int mx[4]={-1,0,1,0};
	int my[4]={0,-1,0,1};
	int ig[144]={0};
	int f[12][12];
	int mapc[13][13];
	char map[13][13];
	queue<b> q;
	b v,u;
	stack<d> s;
	d r,t;
	while(1){
		cin>>lx>>ly;
			if(lx==0&&ly==0){
				break;
			}
				memset(mapc,-1,sizeof(mapc));
			nc=1;
			memset(maps,0,sizeof(maps));
			memset(ig,0,sizeof(ig));
			min=144;
		for(i=0;i<ly;i++){
			cin>>map[i];
		}
		for(i=0;i<ly;i++){
			for(j=0;j<lx;j++){
					if(map[i][j]=='S'){
					r.x=j;
						r.y=i;
					memset(r.visited,0,sizeof(r.visited));
					memset(r.ic,0,sizeof(r.ic));
					r.cnt=0;
						mapc[i][j]=0;
					s.push(r);
				}
				if(map[i][j]=='G'){
					gx=j;
					gy=i;
				}
				if(map[i][j]=='X'&&maps[i][j]==0){
					v.x=j;
					v.y=i;
					q.push(v);
					while(!q.empty()){
						v=q.front();
						q.pop();
						maps[v.y][v.x]=nc;
						ig[nc]++;
						for(k=0;k<4;k++){
							u=v;
							u.x+=mx[k];
							u.y+=my[k];
							if(map[u.y][u.x]=='X'&&maps[u.y][u.x]==0&&u.x>=0&&u.x<lx&&u.y>=0&&u.y<ly){
								q.push(u);
								
							}
						}
					}
					if(ig[nc]==1){
						map[v.y][v.x]='#';
					}
					nc++;
					
				}
			}
		}
		v.x=gx;
		v.y=gy;
		
		memset(f,-1,sizeof(f));
		f[gy][gx]=0;
		q.push(v);
		while(!q.empty()){
			v=q.front();
			q.pop();
			for(i=0;i<4;i++){
				u=v;
				u.x+=mx[i];
				u.y+=my[i];
				if(map[u.y][u.x]!='#'&&u.x>=0&&u.x<lx&&u.y>=0&&u.y<ly&&f[u.y][u.x]==-1){
					q.push(u);
					f[u.y][u.x]=f[v.y][v.x]+1;
				}
			}
		}

		while(!s.empty()){
			r=s.top();
			s.pop();
			if(r.visited[r.y][r.x]==1){
				continue;
			}
			else{
				r.visited[r.y][r.x]=1;
			}
			if(r.cnt+f[r.y][r.x]>=min){
				continue;
			}
			
			for(i=0;i<4;i++){
				t=r;
				t.x+=mx[i];
				t.y+=my[i];
				t.cnt++;
				if(map[t.y][t.x]!='#'&&t.x>=0&&t.x<lx&&t.y>=0&&t.y<ly){
					
					
						if(mapc[t.y][t.x]>=r.cnt+1||mapc[t.y][t.x]==-1){
							if(map[t.y][t.x]=='G'){
								ex=t.x;
								ey=t.y;
								min=t.cnt;
								mapc[t.y][t.x]=r.cnt+1;
								break;
							}
							if(map[t.y][t.x]=='X'){
								a=maps[t.y][t.x];
								t.ic[a]++;
								if(t.ic[a]<=(ig[a]/2)){
									mapc[t.y][t.x]=r.cnt+1;
									s.push(t);
								}
							}

							else{
								mapc[t.y][t.x]=r.cnt+1;
								s.push(t);
							}
						}
						else{
							if(mapc[t.y][t.x]<=r.cnt){
							continue;
							}
						}
			}
		}
		}
		cout<<mapc[ey][ex]<<endl;
	}
	return 0;
}

Measured memory_bytes: 5696
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>
#include <complex>
#include <cstdint>
#include <tuple>
#include <numeric>
#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
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(); }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define MT make_tuple
#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 FILL(a, x) memset(a, x, sizeof(a))

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)

const int N = 100;

struct edge {
	int to;
	int cap;
	int rev;
	edge(int _to, int _cap, int _rev) : to(_to), cap(_cap), rev(_rev) {};
};

int level[N], del[N];
using node = vector<edge>;
using graph = vector<node>;


int bfs(graph &g, int s, int t) {
	memset(level, -1, sizeof(level));
	level[s] = 0;
	deque<int> q;
	q.push_back(s);
	while (!q.empty()) {
		auto i = q.front();
		q.pop_front();
		for (auto &e : g[i]) {
			if (e.cap > 0 && level[e.to] == -1) {
				level[e.to] = level[i] + 1;
				q.push_back(e.to);
			}
		}
	}
	return level[t];
}

int dfs(graph &g, int s, int t, int f) {
	int ret = 0;
	if (s == t)return f;
	FOR(i, del[s], g[s].size()) {
		del[s] = i;
		auto &e = g[s][i];
		if (e.cap == 0 || level[s] >= level[e.to])continue;
		auto df = dfs(g, e.to, t, min(f, e.cap));
		e.cap -= df;
		g[e.to][e.rev].cap += df;
		f -= df;
		ret += df;
		if (f == 0)return ret;
	}
	return ret;
}

int maximum_flow(graph &g, int s, int t) {
	int df;
	int flow = 0;
	do {
		if (-1 == bfs(g, s, t))break;
		memset(del, 0, sizeof(del));
		df = dfs(g, s, t, 1e9);
		flow += df;
	} while (df != 0);
	return flow;
}

void addedge(graph &g, int from, int to, int cap) {
	g[from].PB(edge(to, cap, g[to].size()));
	g[to].PB(edge(from, 0, g[from].size() - 1));
}

int main() {
	int v, e;
	scanf("%d%d", &v, &e); 
	graph g(v);
	REP(i, e) {
		int x, y, z;
		scanf("%d%d%d", &x, &y, &z);
		addedge(g, x, y, z);
	}
	cout << maximum_flow(g, 0, v-1) << endl;
	return 0;
}


Measured memory_bytes: 3268
#include <iostream>
#include <vector>
#include <queue>
#define f first
#define s second
#define pii pair<int,int>
using namespace std;
typedef queue<pii> qpii;
 
int xo[4] = {1, -1, 0, 0};
int yo[4] = {0, 0, 1, -1};
int n, m;
 
bool good(int x, int y) {
	return x >= 1 && x <= n && y >= 1 && y <= m;
}
 
void test_case() {
	int k, a, b, c, d; cin >> n >> m >> k >> a >> b >> c >> d;
	
	vector<string> grid(n+1);
	vector<vector<int> > odl(n+1, vector<int>(m+1, 1e9));
	vector<vector<bool> > odw(n+1, vector<bool>(m+1));
	for (int i = 1; i <= n; i ++) cin >> grid[i];
	qpii Q;
	Q.push({a, b});
	odl[a][b] = 0;
	odw[a][b] = true;
	
	while (!Q.empty()) {
		pii cur = Q.front(); Q.pop();
		for (int i = 0; i < 4; i ++) {
			for (int j = 1; j <= k; j ++) {
				int X = cur.f + xo[i] * j;
				int Y = cur.s + yo[i] * j;
				if (good(X, Y)) {
					if (grid[X][Y-1] == '@' || odl[X][Y] < odl[cur.f][cur.s] + 1) break;
					if (!odw[X][Y]) {
						odl[X][Y] = odl[cur.f][cur.s] + 1;
						odw[X][Y] = true;
						Q.push({X, Y});
					}
				}
			}
		}
	}
	cout << (odl[c][d] == 1e9 ? -1 : odl[c][d]) << '\n';
}
 
int main() {
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	test_case();
	return 0;
}


Measured memory_bytes: 14980