akhauriyash/Code-Regression huggingface dataset:
//	Totally unrelated and not AT ALL stolen from hohohaha's, generic_placeholder_name's or katoriyuu's template
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
#include <ext/rope>

using namespace std;

#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define gcd __gcd
#define rep(i,s,end) for(int i = (s); i <  (end); ++i)
#define rep1(i, end) for(int i =   1; i <= (end); ++i)
#define lb lower_bound
#define ub upper_bound

#define vt vector
#define endl "\n"

#define fileopen(filename, in_type, out_type) if (fopen(filename in_type, "r")) {freopen(filename in_type, "r", stdin);freopen(filename out_type, "w", stdout);}
#define local_input(x) if (x && fopen("input.txt","r")) freopen("input.txt","r",stdin);
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)

#define fscan(x)   scanf("%d",  &x)
#define fscandb(x) scanf("%lf", &x)
#define fscanll(x) scanf("%lld",&x)
//	Until next time, remember:
//			You are closer than you think.
//						_Dan Lok_

#define int ll
typedef double db;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
#define pi 3.1415926535897932	//faster than pi = acos(-1); but sometimes doesn't work?
//	srand(chrono::steady_clock::now().time_since_epoch().count());
//	freopen("input.txt","r",stdin);

#define mn 100002
int n,m,st;
map<pii,int> dist;
vi adjlist[mn];
int pos[mn];
bool met[mn];

void dfs(const int& u){
	for(int& i : adjlist[u]){
		if(met[i]){
			if(pos[u]-pos[i] != dist[{i,u}]){
				cout << "No"; exit(0);
			}
		}
		else {
			met[i] = true, pos[i] = pos[u]+dist[{u,i}]; dfs(i);
		}
	}
}

signed main()
{
	fastio;
//	fileopen("",".inp",".out");
//	local_input(true);
	cin >> n >> m; if(m){
		while(m--){
			int x,y,z; cin >> x >> y >> z;
			dist[{y,x}] = -z, dist[{x,y}] = z;
			adjlist[x].pb(y), adjlist[y].pb(x);
			st = x;
		}
		rep1(i,n) if(!met[i]){
			met[i] = true; dfs(i);
		}
	}
	cout << "Yes\n";
	return 0;
}
// with the aura of Dora, AC!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Why is there a one in my row of exclamation marks?


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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)


void func(long long x){
    lli cnt=0;
    if(x>=11){
        cnt += (x/11)*2;
        x %=11;
    }
    if(x>=1 && x<=10){
        cnt++;
        x-=6;
    }
    if(x>=1 && x<=4){
        cnt++;
        x=0;
    }

    cout<<cnt<<endl;
}

int main(){
    // cout << fixed << setprecision(5);

    long long x;
    scanf("%lld",&x);
    func(x);
    return 0;
}


Measured memory_bytes: 256
from fractions import gcd
import sys

n, m = map(int, input().split())
a = list(map(int, input().split()))
a = [i // 2 for i in a]

cnt = 1
min_a = min(a)
while min_a % 2 == 0:
    cnt *= 2
    min_a = min_a // 2

ans = 1
for i in a:
    if (i // cnt) % 2 == 0:
        print(0)
        sys.exit()
    ans = (ans * i) // gcd(ans, i)

print((m//ans+1)//2)


Measured memory_bytes: 89580
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define repr(i, a, b) for(ll i = (a); i < (b); i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; }
inline ll powint(unsigned long long x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; }
inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; }
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; }
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif

ll n, a, b;
vll h;
bool valid(ll mid){
    ll c = a - b;
    ll p = 0;
    rep(i, n){
        ll hx = h[i] - b*mid;
        if(hx > 0){
            p += (hx+c-1)/c;
        }
        if(p > mid) return false;
    }
    return true;
}

ll BinarySearch(){
    ll lb = 0, ub = h[0];
    while(lb < ub){
        ll mid = (lb + ub) / 2;
        if(valid(mid)){
            ub = mid;
        }else{
            lb = mid + 1;
        }
    }
    return ub;
}


int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    cin >> n >> a >> b;
    h.resize(n);
    rep(i, n){
        cin >> h[i];
    }
    sort(ALL(h), greater<ll>());
    cout << BinarySearch() << endl;
    return 0;
}

Measured memory_bytes: 1024
while 1:
   try:
       h = 0
       b = 0
       que=input().split(" ")
       ans=input().split(" ")
       for i in range(4):
             for j in range(4):
                    if que[i] == ans[j] and i != j:
                         b = b + 1
                    if que[i] == ans[j] and i == j:
                         h = h + 1
       print(str(h) + " " + str(b))
   except:break


Measured memory_bytes: 5556
from itertools import combinations

n = int(input())
r = range(n)
a = [(set(), set()) for _ in r]
for i in r:
  for _ in range(int(input())):
    x, y = map(int, input().split())
    a[i][y].add(x - 1)

fail = lambda x: (not all(a[i][0].isdisjoint(x) and a[i][1] < x for i in x))

while n and all(map(fail, map(set, combinations(r, n)))):
  n -= 1
print(n)


Measured memory_bytes: 3064
#include <cstring>
#include <string>
#include <iostream>
using namespace std;
#define MOD 10007
int dp[1050][10];
int m[1050];
int main()
{
	int n;
	cin >> n;
	memset(dp,0,sizeof(dp));
	string s;
	cin >> s;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='J')m[i+1]=0;
		else if(s[i]=='O')m[i+1]=1;
		else m[i+1]=2;
	}
	for(int i=0;i<8;i++)
	{
		if(((i>>m[1])&1)&&(i&1))dp[1][i]=1;
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=0;j<8;j++)
		{
			if(!((j>>m[i])&1))continue;
			for(int k=0;k<8;k++)
			{
				if(j&k)
				{
					dp[i][j]+=dp[i-1][k];
					dp[i][j]%=MOD;
				}
			}
		}
	}
	int ans=0;
	for(int i=0;i<8;i++)
	{
		ans+=dp[n][i];
		ans%=MOD;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1256
#[allow(unused_macros)]
macro_rules! input {
    ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } };
    ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } };
}
#[allow(unused_macros)]
macro_rules! input_inner {
    ( $ next : expr ) => { };
    ( $ next : expr , ) => { };
    ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } };
}
#[allow(unused_macros)]
macro_rules! read_value {
    ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) };
    ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) };
    ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) };
    ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 };
    ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) };
}

#[allow(unused_macros)]
macro_rules! vec_md {
    ( $ init : expr ; $ ( $ dim : expr ) ;* ) => { vec_md ! ( $ ( $ dim ) ;* => $ init ) };
    ( $ head : expr ; $ ( $ tail : expr ) ;* => $ init : expr ) => { vec ! [ vec_md ! ( $ ( $ tail ) ;* => $ init ) ; $ head ] };
    ( $ head : expr => $ init : expr ) => { vec ! [ $ init ; $ head ] };
}

fn main() {
    input! {
        n: usize,
        a: [i64; n]
    }

    let mut dp = vec_md![0i64; n+1; n+1];
    for len in 1..n+1 {
        for i in (0..).take_while(|&i| i + len <= n) {
            let j = i + len;
            if (n - len) % 2 == 0 {
                dp[i][j] = std::cmp::max(
                    dp[i+1][j] + a[i],
                    dp[i][j-1] + a[j-1]
                );
            } else {
                dp[i][j] = std::cmp::min(
                    dp[i+1][j] - a[i],
                    dp[i][j-1] - a[j-1]
                );
            }
        }
    }

    println!("{}", dp[0][n]);
}

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

int main() {
double n;
cin>>n;
  double count=0;
for(int i=0;i<n;i++){
  if((i+1)%2==1){
    count++;
  }
}
double ans=0;
ans+=(count/n);
   cout << fixed << setprecision(10);
  cout<<ans;



}


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

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var l = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int a = l[0], b = l[1], c = l[2];
            Console.WriteLine(a + b + c <= 21 ? "win" : "bust");
        }
    }
}


Measured memory_bytes: 13396
using System;
class Program
{
    static void Main(string[] args)
    {
        var input = Console.ReadLine().Split(' ');
        var a = int.Parse(input[0]);
        var b = int.Parse(input[1]);
        for(var i=1;i<=3;i++)
        {
            if((a*b*i)%2==1)
            {
                Console.WriteLine("Yes");
                return;
            }
        }
        Console.WriteLine("No");
    }   
}

Measured memory_bytes: 11092
#include <iostream>
#define ll long long
using namespace std;

int main()
{
    ll l , r;
    ll Min = 1e5;
    cin >> l >> r;
    r = min(r, l + 2019);

    for(ll i = l; i < r; i++)
    {
        for(ll j = i + 1; j <= r; j++)
        {
            Min = min(Min,(i * j) % 2019);
        }
    }
    cout << Min << endl;
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define ins insert
#define Pq priority_queue
#define u_set unordered_set
#define MOD 1000000007
#define MAXN 100001
#define set_val(arr,v) memset(arr, v, sizeof(arr))
#define FOR(i,from,to) for(int i=from; i<to; i++)
#define FOL(i,from,to) for(int i=from; i>=to; i--)
#define B() begin()
#define E() end()
#define F first
#define S second


int main() {
	ios::sync_with_stdio(0);  cin.tie(0); cout.tie(0);
	ll h,n;
	cin >> h >> n;
	vector<ll> v(n);
	for(auto& x : v) cin >> x;
	ll sum = 0;
	for(auto x : v) sum += x;
	if(sum >= h) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0; 
}

Measured memory_bytes: 1024
import sys
from itertools import accumulate
from collections import Counter
from bisect import bisect as br, bisect_left as bl
from operator import itemgetter
class DammyMap:
    #1-indexed
    def __init__(self, A, B):
        #Aに初期状態の要素をすべて入れる,Bは値域のリスト
        self.X, self.comp = self.compress(B)
        self.size = len(self.X)
        self.tree = [0] * (self.size + 1)
        self.p = 2**(self.size.bit_length() - 1)
        self.dep = self.size.bit_length()
        
        CA = Counter(A)
        S = [0] + list(accumulate([CA[self.X[i]] for i in range(self.size)]))
        for i in range(1, 1+self.size):
            self.tree[i] = S[i] - S[i - (i&-i)]
        
    def compress(self, L):
        #座圧
        L2 = list(set(L))
        L2.sort()
        C = {v : k for k, v in enumerate(L2, 1)}
        # 1-indexed
        return L2, C
    
    def leng(self):
        #今入っている個数を取得
        return self.count(self.size)
    
    def count(self, i):
        #i(Bの元)以下の個数を取得
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s
    
    def less(self, v):
        #v(Bの元である必要はない)未満の個数を取得
        i = bl(self.X, v)
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s
    
    def leq(self, v):
        #v(Bの元である必要はない)以下の個数を取得
        i = br(self.X, v)
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s
 
    def add(self, i, x):
        #iをx個入れる,負のxで取り出す,iの個数以上取り出すとエラーを出さずにバグる
        i = self.comp[i]
        while i <= self.size:
            self.tree[i] += x
            i += i & -i
        
        
    def get(self, v):
        # v番目の値を取得
        if v <= 0:
            return -1
        s = 0
        k = self.p
        for _ in range(self.dep):
            if s + k <= self.size and self.tree[s+k] < v:
                s += k
                v -= self.tree[s]
            k //= 2
        return self.X[s]

def compress(L):
    #座圧
    L2 = list(set(L))
    L2.sort()
    C = {v : k for k, v in enumerate(L2)}
    return L2, C

N, Q = map(int, input().split())
stx = [tuple(map(int, sys.stdin.readline().split())) for _ in range(N)]
stx.sort(key = itemgetter(2))
D = [int(sys.stdin.readline()) for _ in range(Q)] 
_, comp = compress(D)

T = DammyMap(D, D)

ans = [-1]*Q

for s, t, x in stx:
    tl = T.less(s - x)
    tr = T.less(t - x)
    d = tr - tl
    for _ in range(d):
        i = T.get(tl + 1)
        T.add(i, -1)
        ans[comp[i]] = x
for a in ans:
    print(a)


Measured memory_bytes: 141560
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int H,W;
        while(true){
            H = sc.nextInt();
            W = sc.nextInt();
            if(H == 0 && W == 0){
                break;
            }
            else{
                for(int i = 1; i <= H; i++){
                    for(int n = 1; n <= W; n++){
                        if(i % 2 == 1){
                            if(n == W && n % 2 == 1 && i == H){
                                System.out.println("#\n");
                            }
                            else if(n == W && n % 2 == 0 && i == H){
                                System.out.println(".\n");
                            }
                            else if(n == W && n % 2 == 1){
                                System.out.print("#\n");
                            }
                            else if(n == W && n % 2 == 0){
                                System.out.print(".\n");
                            }
                            else if(n % 2 == 1){
                                System.out.print("#");
                            }
                            else{
                                System.out.print(".");
                            }
                        }
                        else{
                            if(n == W && n % 2 == 1 && i == H){
                                System.out.println(".\n");
                            }
                            else if(n == W && n % 2 == 0 && i == H){
                                System.out.println("#\n");
                            }
                            else if(n == W && n % 2 == 1){
                                System.out.print(".\n");
                            }
                            else if(n == W && n % 2 == 0){
                                System.out.print("#\n");
                            }
                            else if(n % 2 == 1){
                                System.out.print(".");
                            }
                            else{
                                System.out.print("#");
                            }
                        }
                    }
                }
            }
        }
    }
}



Measured memory_bytes: 35396
s = gets.chomp
a = Hash.new(false)
ans = 100
s.size.times do |i|
    a[s[i]] = true
end
a.keys.each do |b|
    t = s.split("")
    while !t.all?{|c|c == b}
        (t.size-1).times do |i|
            t[i] = b if t[i+1] == b
        end
        t.pop
    end
    ans = [ans,s.size-t.size].min
end
puts ans

Measured memory_bytes: 1788
#include <bits/stdc++.h>
#include <iostream>
#include<map>
#include <algorithm>
#include <vector>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int main(){
    int k;
   cin >> k;
    cout <<  (k / 2) * ((k + 1) / 2) << endl;
}





Measured memory_bytes: 256
program Project1;
     
{$APPTYPE CONSOLE}
     
uses
  SysUtils;
var
  g,l,r,a,h,w,i,j,count,x,y,sw,m,n,b,c,soeji,sum,max,k,t:Integer;
  //l:array of Integer;
  s,s123,s1,s2,s3:string;
  tf:Boolean;
  //nyu:TStringList;
begin
  try
    { TODO -oUser -cConsole Main : ここにコードを記述してください }
    Readln(r);
    Readln(g);

    Writeln(2*g-r);
    Readln;
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.

Measured memory_bytes: 128
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>

//#define P 1000000007

int comp(const void *a, const void *b){return *(int*)a-*(int*)b;}
int compw(const void *a, const void *b){return (*(int*)a>*(int*)b)-(*(int*)a<*(int*)b);}
int compr(const void *a, const void *b){return *(int*)b-*(int*)a;}
int compl(const void *a, const void *b){return (*(long*)a>*(long*)b)-(*(long*)a<*(long*)b);}

uint32_t nextpint(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint_fast32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }

inline int min2(const int a, const int b){return a>b?b:a;}
inline int dif2(const int a, const int b){return a>b?a-b:b-a;}

int p[1230]; int s;
int main(void){
	long n=nextpint();
	for(int i=1; i<=3500; i++){
		for(int j=i; j<=3500; j++){
			long a=i*j*n;
			long b=i*j*4-(i+j)*n;
			if(b>0&&a%b==0){
				long k=a/b;
				//printf("%lf %lf\n", (double)4/n, (double)1/i+(double)1/j+(double)1/k);
				printf("%d %d %ld\n", i, j, k);
				return 0;
			}
		}
	}
}


Measured memory_bytes: 128
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
using namespace std;

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



const int BIG_NUM = 1e9;
const ll INF = 1000000000000000000;
//const ll MOD = 1e9 + 7;
const ll MOD = 998244353;

ll power(ll a, ll b) {
	ll p = 1;
	for (int i = 0; i < 64; i++) {
		if (((b >> i) & 1) == 1) {
			p = (p * a)%MOD;
		}
		a = (a * a) % MOD;
	}
	return p;
}

int main() {
	ll n, m, k;
	cin >> n >> m >> k;


	ll sum = 0;

	vector<ll> facto(n + m);
	facto[0] = 1;
	for (int i = 1; i < n + m; i++) {
		facto[i] = (facto[i - 1] * i) % MOD;
		//cout << facto[i] << endl;
	}
	

	

	for (int i = 0; i <= k; i++) {
		ll p = m;

		ll c = facto[n - 1];
		c = (c * power(facto[i], MOD - 2)) % MOD;
		c = (c * power(facto[n - 1 - i], MOD - 2)) % MOD;

		//cout << c << endl;

		p = (p * c) % MOD;
		//cout << p << endl;
		p = (p * power(m - 1, n - 1 - i)) % MOD;


		//cout << p << endl;
		sum = (sum + p) % MOD;
	}

	cout << sum << endl;
	
}


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

int main(){
  int N;
  cin >> N;
  vector<vector<vector<int>>> said(N, vector<vector<int>>(0, vector<int>(2)));
  for(int i=0; i<N; ++i){
    int A;
    cin >> A;
    for(int j=0; j<A; ++j){
      int x, y;
      cin >> x >> y;
      said.at(i).push_back({x, y});
    }
  }
  vector<bool> tof(N);
  int ans=0;
  for(int i=0; i<(1<<N); ++i){
    int kari=0;
    bool han=true;
    for(int j=0; j<N; ++j){
      tof.at(j) = (i>>j)%2;
      if((i>>j)%2 == 1) ++kari;
      //cout << tof.at(j);
    }
    for(int j=0; j<N; ++j){
      if(tof.at(j)==0) continue;
      for(int k=0; k<said.at(j).size(); ++k){
        if( tof.at(said.at(j).at(k).at(0)-1) != said.at(j).at(k).at(1)){
          han= false;
        }
      }
    }
    //cout << " " << han << endl;
    if(han) ans= max(ans,kari);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <cmath>
#include <stack>
#include <map>
#include <functional>
#include <queue>
using namespace std;

int64_t min(int64_t a,int64_t b) {
    if (a > b)
    {
        return b ;
    }else
    {
        return a ;
    }
}


int main(){
    int n,k ;
    cin >> n >> k ;
    vector<int> a(n) ;
    for (int i = 0; i < n; i++)
    {
        cin >> a.at(i) ;
    }
    int l = 1 ;
    int L = 1000000000 ;
    while (l != L)
    {
        int med = (l+L) / 2 ;
        int64_t temp = 0 ;
        for (int i = 0; i < n; i++)
        {
            temp += (a.at(i) / med) - (a.at(i)%med == 0) ;
        }
        if (temp <= k)
        {
            L = med ;
        }else
        {
            l = med + 1 ;
        }
        
        
    }
    cout << l << endl ;
    
}

Measured memory_bytes: 3960
// 101010... 010101... との相違の数のうち少ない方を出力.
#include<iostream>
using namespace std;
int main(){
  string s; cin >> s;
  int cnt1=0,cnt2=0;
  for(int i=0;i<s.size();++i){
    if(i%2==0){
      if(s[i]!='1') cnt1++;
    }else{
      if(s[i]!='0') cnt1++;
    }
  }
  for(int i=0;i<s.size();++i){
    if(i%2==1){
      if(s[i]!='1') cnt2++;
    }else{
      if(s[i]!='0') cnt2++;
    }
  }
  cout << min(cnt1,cnt2) << endl;
  return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define repm(i,a,b) for(ll i=(ll)(a);i>(ll)(b);i--)
#define all(v) v.begin(), v.end()
#define rall(x) (x).rbegin(),(x).rend()
#define pll pair<long long,long long>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define vc vector<char>
#define vvc vector<vc>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<long long>;
using vvll = vector<vll>;
using vb =vector<bool>;
using vvb=vector<vb>;
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; }
//snippets:tmp,cl,cvl,cs,co,coy,con,cov,setp

int main(){
    ll x;
    cin >> x;
    ll y;
    cin >> y;
    if(y%2==1||x*4<y||x*2>y) cout << "No" << endl;
    else cout << "Yes" << endl;
}

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

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

#define INF 1 << 30
#define REP(i,n) for(ll i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(ll i=(k);i<(int)(n);i++)

int a,b,k;

int main(){
  cin >> a>> b>>k;
  for(int i =100;i>0;i--){
    if(a%i==0 && b%i==0) k--;
    if(k==0){
      cout << i << endl;
      return 0;
    }
  }
}


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

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

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

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

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

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

  int N;
  cin >> N;
  string S;
  cin >> S;
  string ABC;
  ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ";

  for(int i = 0; i < S.length(); i++){
    int num = int(S[i] - 'A');
    S[i] = ABC[num + N];  
  }

  cout << S << endl;

  return 0;
}


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

int main(void){
    ll K, A, B;
    cin >> K >> A >> B;
    
    ll coins = 0;
    if( K < A - 1){
        coins = 1 + K;
    } else if(B - A >= 2){
        coins = B + ((K-(A-1))/2-1) * (B-A) + (K-(A-1))%2;
    } else {
        coins = 1 + K;
    }

    cout << coins << endl;

    return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define ll long long int
#define FASTIO std::ios::sync_with_stdio(false);
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define inf 1e18
#define g(x) cout<<x<<" "<<endl;
#define gg(x,y) cout<<x<<" & "<<y<<" "<<endl
#define jam(t) cout<<"Case #"<<t<<": "
#define ggg(x,y,z) cout<<x<<" & "<<y<<" & "<<z<<" "<<endl
#define all(x) x.begin(),x.end()
#define input_from_file  freopen("input.txt", "r", stdin);
#define mod 1000000007ll
#define sz 400005
#define bitcnt(x) __builtin_popcountll(x)
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}


double a[sz];
double s;
void solve(){
    ll n,m;
    cin >> n >> m;
    for(ll i=1;i<=n;i++){
        cin >> a[i];
        s+=a[i];
    }
    ll cnt = 0;
    for(ll i=1;i<=n;i++){
        if(a[i] >= (s/(4*m)) )
            cnt++;
    }
    if(cnt >= m ){
        g("Yes");
    }
    else
    {
        g("No");
    }
}
int main()
{
#ifndef ONLINE_JUDGE
input_from_file
#endif
 
    FASTIO
    cin.tie(NULL);
    fflush(stdout);
    ll t = 1;
   // cin >> t;
    for(ll tcase = 1;tcase <= t;tcase++){
        solve();
        
    }
return 0;
}

Measured memory_bytes: 3716
#include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int n;
	
	while(cin >> n){
		while(n > 39){
			n -= 39;
		}
		
		if(n < 10){
			cout << "3C0" << n << endl;
		} else {
			cout << "3C" << n << endl;
		}
	}
	
	return 0;
}

Measured memory_bytes: 0
#![allow(dead_code)]
use std::io;

fn main() {
    solve_a();
}

fn solve_d() {
    let mut n = String::new();
    io::stdin().read_line(&mut n).unwrap();
    let n = n.trim().parse::<usize>().unwrap();

    let mut min = i64::max_value();
    let mut diff = i64::min_value();
    for i in 0..n {
        let mut v = String::new();
        io::stdin().read_line(&mut v).unwrap();
        let v = v.trim().parse::<i64>().unwrap();
        if i == 0 {
            min = v;
        }

        if 0 < i {
            let tmp = v - min;
            if diff < tmp {
                diff = tmp
            }
            if v < min {
                min = v;
            }
        }
    }
    println!("{}", diff);
}

fn solve_a() {
    let mut n = String::new();
    io::stdin().read_line(&mut n).unwrap();
    let n = n.trim().parse::<i32>().unwrap();

    let mut line = String::new();
    io::stdin().read_line(&mut line).unwrap();
    let mut line: Vec<_> = line.trim()
        .split_whitespace()
        .map(|s| s.parse::<i32>().unwrap())
        .collect();

    for (i, x) in line.iter().enumerate() {
        if i < n as usize - 1 {
            print!("{} ", x);
        } else {
            print!("{}\n", x);
        }
    }
    for i in 0..(n as usize - 1) {
        let mut k: i32 = i as i32 + 1 as i32;
        let v = line[k as usize];
        while 0 <= k - 1 && v < line[k as usize - 1] {
            line[k as usize] = line[k as usize - 1];
            k -= 1;
        }
        line[k as usize] = v;
        for (i, x) in line.iter().enumerate() {
            if i < n as usize - 1 {
                print!("{} ", x);
            } else {
                print!("{}\n", x);
            }
        }
    }
}



Measured memory_bytes: 5040
#include<iostream>
#include<vector>
using namespace std;
void merge(vector<int> &v1,int left ,int mid,int right);
void divide(vector<int> &v1,int left,int right);
int cnt=0;
int main(){
    int n;
    cin>>n;
    vector<int> v;
    for(int i=0;i<n;i++){
        int tmp;
        cin>>tmp;
        v.push_back(tmp);
    }
    divide(v,0,n-1);
    for(int i=0;i<n;i++){
        cout<<v[i];
        if(i!=n-1)cout<<" ";
    }
    cout<<"\n";
    cout<<cnt<<"\n";

}
void merge(vector<int> &v1,int left,int mid,int right){
    int i,j,k;
    int n1=mid+1-left;
    int n2=right-mid;
    // int cnt=0;
    vector<int> vl,vr;
    for(int i=0;i<n1;i++){
        vl.push_back(v1[left+i]);
    }
    for(int j=0;j<n2;j++){
        vr.push_back(v1[mid+1+j]);
    }

    i=0;j=0;k=left;
    while(i<n1&&j<n2){
        if(vl[i]<=vr[j]){
            v1[k]=vl[i];
            i++;
            cnt++;
        }
        else{
            v1[k]=vr[j];
            j++;
            cnt++;
        }
        k++;
    }
    while(i<n1){
        v1[k]=vl[i];
        i++;
        k++;
        cnt++;
    }
    while(j<n2){
        v1[k]=vr[j];
        j++;
        k++;cnt++;
    }
}
void divide(vector<int> &v1,int left,int right){
    if(left<right){
        int mid=(left+right)/2;
        divide(v1,left,mid);
        divide(v1,mid+1,right);
        merge(v1,left,mid,right);
    }
}


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


int main(){
  int n,m,i;
  cin >> n >> m;

  vector<int> a(n),b(n);
  for(i=0;i<n;++i){
    cin >> a[i] >> b[i];
  }
  vector<pair<int,int>>ab(n);
  for(i=0;i<n;++i){
    ab[i]=make_pair(a[i],b[i]);
  }
  sort(ab.begin(),ab.end());
  long long sum;
  sum=0;
  for(i=0;i<n;++i){
    int mi=min(m,ab[i].second);
    sum+=(long long)ab[i].first*mi;
    m=m-mi;
  }
  cout << sum << endl;
  return 0;


}


Measured memory_bytes: 1792
#include<iostream>
using namespace std;
int a[4] = { -1,-1,-1,-1 };
int main() {
	int n, m;

	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		int s, c;
		cin >> s >> c;
		if (a[s] != -1 && a[s] != c) {
			cout << -1;
			return 0;
		}
		a[s] = c;
	}
	if (a[1] == 0 && n > 1) {
		cout << -1;
		return 0;
	}

	for (int i = 1; i <= n; i++) {
		if (a[i] == -1) {
			a[i] = 0;
		}
	}
	if (a[1] == 0 && n > 1) {
		a[1] = 1;
	}
	for (int i = 1; i <= n; i++) {
		cout << a[i];
	}

}

Measured memory_bytes: 256
import math
a,b,x=map(float, input().split())

#print(a,b,x)

theta=math.atan( (b-x/(a*a))*(2/a) )

if x/(a*a)>a*math.tan(theta)/2:
 print(math.degrees(theta))
else:
 theta=math.atan( a*b*b/(2*x) )
 print(math.degrees(theta))
  

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

int N, M, dp[1010][1010];
char grid[1010][1010];

int main() {
	cin >> N >> M;
	for(int i=1; i<=N; i++)
		for(int j=1; j<=M; j++) {
			cin >> grid[i][j];
			if (grid[i][j] == '.') {
				if (i==1 && j==1) dp[i][j] = 1;
				else if (i==1) dp[i][j] = dp[i][j-1];
				else if (j==1) dp[i][j] = dp[i-1][j];
				else dp[i][j] = (dp[i][j-1]  + dp[i-1][j])%1000000007;
			}
		}
	cout << dp[N][M] << endl;
	return 0;
}

Measured memory_bytes: 5120
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder.Abc
{
    class A_166_A_C
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            // 回答
            Console.WriteLine(Console.ReadLine() == "ABC" ? "ARC" : "ABC");

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 25700
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        int cnt = 0;
        Character crr = s.charAt(0);
        Character nxt;
        for (int i = 1; i < n; i++) {
            nxt = s.charAt(i);
            if (crr != nxt) {
                cnt++;
            }
            crr = nxt;
        }
        System.out.println(cnt);
    }
}

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

using namespace std;

int main() {

    string str, str2, str3, rev, rev2, rev3;
    cin >> str; 

    long int N = (long int)(str.length()), f=0;
    reverse_copy(str.begin(), str.end(), back_inserter(rev));
    if (str==rev) f += 1;

    str2 = str.substr(0, (N-1)/2);

    reverse_copy(str2.begin(), str2.end(), back_inserter(rev2));
    if (str2==rev2) f += 1;

    str3 = str.substr((N+3)/2-1, N);

    reverse_copy(str3.begin(), str3.end(), back_inserter(rev3));
    if (str3==rev3) f += 1;

    if (f==3) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}

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

int main() {
	while (1) {
		int a;
		cin >> a;
		if (cin.fail())break;
		cout << "3C";
		if (a % 39 == 0) { cout << 39 << endl; continue; }
		cout.width(2);
		cout.fill('0');
		cout << a % 39 << endl;
	}
}

Measured memory_bytes: 3168
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a , b;
	cin >> a >> b;
  	int j = 0;
  	for(int i = 1; i <=1009 ; i++){
      if(floor(i*0.08)==a && floor(i*0.1)==b){
     	j = 1;
        cout<<i;
        break;
      }
    }
  	if(j==0){
      cout<<-1;
    }
}

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

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

    vector<int> order(n);
    for(int i = 0; i < n; i++){
        order[i] = i;
    }

    double ans = 0;
    double cnt = 0;

    do{
        for(int i = 1; i < n; i++){
            ans += sqrt((x[order[i-1]]-x[order[i]])*(x[order[i-1]]-x[order[i]])+(y[order[i-1]]-y[order[i]])*(y[order[i-1]]-y[order[i]]));
        }
        cnt++;
    } while(next_permutation(order.begin(), order.end()));
    ans /= cnt;
    printf("%.10f\n", ans);
}

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

using namespace std;

int main() 
{
	int n,num;
cin>>n;
vector<int>arr;
int xo=0;

for(int i=0;i<n;i++)
{
	cin>>num;
	arr.push_back(num);
}

for(int i=0;i<n;i++)
{
	xo = xo^arr[i];
}

if(xo==0)
{
	cout<<"Yes";
}
else
{
	cout<<"No";
}


}

Measured memory_bytes: 1020
N = int(input())
D, X = map(int, input().split())
A = [int(input()) for _ in range(N)]
count = 0
for i in range(1, D+1):
    for j in range(N):
        if i % A[j] == 1 or A[j] == 1:
            count += 1
print(count + X)

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

int main() {
    int L, R, d;
    cin >> L >> R >> d;
    cout << R/d - (L-1)/d << endl;
}


Measured memory_bytes: 3560
// finish date: 2018/01/21
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <map>
#include <climits>

using namespace std;

#define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++)
#define rep(i, n)  FOR(i,0,n)
#define ll long long
#define bigmod 1000000007
#define INF 500000000


int main() {
    int N;
    cin >> N;
    vector<ll> lucas(N + 1);
    lucas[0] = 2;
    lucas[1] = 1;
    FOR(i, 2, N + 1) lucas[i] = lucas[i - 1] + lucas[i - 2];
    cout << lucas[N] << endl;

    return 0;
}


Measured memory_bytes: 256
from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10


def main():
    N = int(input())
    p_list = list(map(int, input().split()))
    a_list = list(range(1, N + 1))
    ans = 0
    i = 0
    while i < N:
        if i + 1 < N and p_list[i] == a_list[i] and p_list[i + 1] == a_list[i + 1]:
            ans += 1
            i += 2
        elif p_list[i] == a_list[i]:
            ans += 1
            i += 2
        else:
            i += 1
    print(ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 14196
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define rep2(i,j,n) for(int j=i;j<n;j++)
#define rep3(i,j,n) for(int j=i;j<=n;j++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define sp(n) cout << fixed << setprecision(n)
typedef long long ll;
using namespace std;
int main(void){
    ll n,c;cin>>n>>c;
    vector<ll> x(n),v(n),sv(n),isv(n),sx(n),isx(n);
    rep(i,n) cin>>x[i]>>v[i];
    
    ll tmp=0;
    rep(i,n){
        if(i==0){
            tmp+=v[i];
            sv[i]=max(tmp-x[i],(ll)0);
            sx[i]=(sv[i]==tmp-x[i])? x[i]:0;
        }
        else{
            tmp+=v[i];
            sv[i]=max(sv[i-1],tmp-x[i]);
            sx[i]=(sv[i]==tmp-x[i])? x[i]:sx[i-1];
        }
    }
    reverse(x.begin(),x.end());
    reverse(v.begin(),v.end());
    tmp=0;
    
    rep(i,n){
        x[i]=c-x[i];
        if(i==0){
            tmp+=v[i];
            isv[i]=max(tmp-x[i],(ll)0);
            isx[i]=(isv[i]==tmp-x[i])? x[i]:0;
        }
        else{
            tmp+=v[i];
            isv[i]=max(isv[i-1],tmp-x[i]);
            isx[i]=(isv[i]==tmp-x[i])? x[i]:isx[i-1];
        }
    }
    
    
    reverse(isv.begin(),isv.end());
    reverse(isx.begin(),isx.end());
    ll res=0;
    
    rep(i,n){
        //cout<<i<<endl;
        if(i==n-1){
            ll now=sv[i];
            res=max(res,now);
        }
        else{
            ll left=sv[i],right=isv[i+1];
            //cout<<left<<" "<<right<<endl;
            ll now=right+left;
            now-=min(sx[i],isx[i+1]);
            res=max(res,now);
        }
        if(i==0){
            ll now=isv[i];
            res=max(res,now);
        }
        else{
            ll left=sv[i-1],right=isv[i];
            //cout<<left<<" "<<right<<endl;
            ll now=right+left;
            now-=min(sx[i-1],isx[i]);
            res=max(res,now);
        }
    }
    cout<<res<<endl;
}

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

int main() {
  vector<int> x(10001);
  int idx = 0;
  while(true) {
    cin >> x.at(idx);
    if (x.at(idx) == 0) break;
    idx++;
  }
  idx = 0;
  while(x.at(idx) != 0) {
    cout << "Case " << idx + 1 << ": " << x.at(idx) << endl;
    idx++;
  }
}


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

using namespace std;
 
 


//c++ templte for help............................................................................................................................................

typedef long long ll;

template<typename... T>
void print1(T... t){
	((cout<<t<<" "),...);
}

template<typename... T>
void print2(T... t){
		vector<vector<ll>> ans={t...};
		for(ll i=0;i<(ll)ans.size();i++){
			if(i!=0) cout<<"\t\t";
			else cout<<"\t";
			for(ll j=0;j<(ll)ans[i].size();j++){
				cout<<ans[i][j]<<" ";
			}
			if(i!=(ll)ans.size()-1)
			cout<<endl;
		}
}	
#define deb(...) {cout<<" [ "#__VA_ARGS__<<" : "; print1(__VA_ARGS__); cout<<"]"<<endl; }
#define vdeb(...) {cout<<" [ "#__VA_ARGS__<<" : "; print2(__VA_ARGS__); cout<<"]"<<endl;}

// to return everything in string
#define ret(...) {stringstream returnn;returnn<<__VA_ARGS__;return returnn.str();}

stringstream retvec;
template<typename... T>
void returnvector(T... t){
		vector<vector<ll>> ans={t...};
		for(ll i=0;i<(ll)ans.size();i++){
			for(ll j=0;j<(ll)ans[i].size();j++){
				retvec<<ans[i][j];
				if(j!=(ll)ans[i].size()-1)
					retvec<<" ";
			}
			if(i!=(ll)ans.size()-1)
				retvec<<endl;
		}
}
#define vret(...) {returnvector(__VA_ARGS__);return retvec.str();}
	


//for loop
#define fo(i,n) for(int i=0;i<(ll)n;i++)
#define Fo(i,k,n) for(int i=k;i<n;i++)
 
 
//to print vector element 
template<typename T>
void printV(T vec){
	fo(i,vec.size()) cout<<vec[i]<<" "<<flush;
	cout<<endl;
	}
	
 
#define M ll(1000000007)
const ll INF=ll(1e9+5);
 
//iterate map
template<typename T>
void itR(T map){
	 for(auto itr=map.begin();itr!=map.end();itr++){
				deb(itr->first,itr->second);
			}
	cout<<endl;
}

//c++ template for help...........................................................................................................................................

string solve(){
	ll a;
	cin>>a;
	ret(!a);
}

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

	//ll testCase;
	//cin>>testCase;
	//for(ll tt=0;tt<testCase;tt++){
		string ans1=solve();
		if(ans1!="")
			cout<<ans1<<endl;
	//}
	return 0;
}


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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

std::string S, T;

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

  std::cin >> S >> T;

  std::cout << T << S << std::endl;
}


Measured memory_bytes: 256
/*  TAHMID RAHMAN
    DAMIAN FOREVER
     MATH LOVER
    NEVER GIVE UP
*/
#include<bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long
#define pb push_back
#define fi first
#define se second
#define in insert
#define mp make_pair
#define GCD(a,b) __gcd(a,b);
#define endl "\n"
#define FRU freopen("out.txt","w",stdout)
#define FRO freopen("in.txt","r",stdin)
#define INFLL 9223372036854775807
#define debug 0
#define MAXN   100001
#define ar array
const int mxN=2e5;
const int MOD=1e9+7;
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){return (a.second < b.second);}
//Don't hesitate to ask me if you don't understand my code.......Happy coding,Tahmid...;

int main()
{
    fastio;
    ll d,t,s;
    cin>>d>>t>>s;
    if(t*s>=d)
    {
        cout<<"Yes"<<endl;
    }
    else
        cout<<"No"<<endl;
}


Measured memory_bytes: 3652
#include<stdio.h>
#include<math.h>

int main(){
	
	double h, m;
	double k;
	double ans;
	double a, b;
	
	scanf("%lf%lf%lf%lf", &a,  &b, &h, &m);
	
	k = h * 30 - (m * 5.5);
	
	if(k < 0)
		k = k * (-1);
	
	if(k > 180)
		k = 360 - k;
	k = k * M_PI / 180;
	ans = (a * a) + (b * b) - (2 * a * b * cos(k));
	
	printf("%.15lf", sqrt(ans));
	
	return 0;
}

Measured memory_bytes: 2520
#ifdef Prateek
  #include "Prateek.h"
#else
  #include <bits/stdc++.h>
  using namespace std;
  #define debug(...) 42
#endif
#define F first
#define S second
#define pb push_back
#define f(i,x,n) for(int i=x;i<n;i++)
#define all(c) c.begin(),c.end()
#define int ll
using ll = long long;
const int MOD = 1e9+7, N = 2e5 + 10; 

vector<int> G[N];
int vis[N];
int c;

void dfs(int u){
   c++;
   vis[u] = 1;
   for(auto v : G[u]){
      if(!vis[v]){
         dfs(v);
      }
   }
}

int32_t main(){
   ios::sync_with_stdio(false);
   cin.tie(NULL);
   int n,m;
   cin >> n >> m;
   for(int i = 0; i < m; ++i){
      int u,v;
      cin >> u >> v;
      G[u].push_back(v);
      G[v].push_back(u);
   }
   int ans = 0;
   for(int i = 1; i <= n; ++i){
      if(!vis[i]){
         c = 0;
         dfs(i);
         ans = max(ans,c);
      }
   }
   cout << ans << '\n';
   return 0;
} 

Measured memory_bytes: 22360
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N,M,D;
ll A[10];
ll INF = 1e18;

ll lcm(ll a,ll b){
  ll res= a/__gcd(a,b);
  if( res > INF / b )return INF;
  return res * b;
}

ll solve(){

  ll ans=N;
  for(int i=0;i<D;i++){
    ll a=0,b=1;
    for(int j=0;j<M;j++){
      ll k;
      cin>>k;
      if(k==-1)continue;
      if(k>=A[j])return -1;

      if(a==0 && b==1){
        a=k;
        b=A[j];
        continue;
      }

      while( a%A[j]!=k ){
        if(a+b > N)return -1;
        a+=b;
      }
      b=lcm(b,A[j]);
    }

    
    if(ans<a)return -1;
    ll d=ans-a;
    ll c=d/b;
    ans=a+b*c;
  }
  return ans;
}

int main(){
  cin>>N>>M>>D;
  for(int i=0;i<M;i++)cin>>A[i];
  cout<<solve()<<endl;
  return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <set>
#include <stdio.h>
#include <math.h>
#include <queue>
using namespace std;
typedef long long int lli;
const long long int MaxN=500005;
const lli mod=1e9+7;
#define fst first
#define snd second
#define mp make_pair
const float pi=3.1415926535897932384626433832795028;
	lli mcd(lli a,lli b){
		if(a==0)return b;
		return mcd(b%a,a);
	}
	lli arr[MaxN];
	char inicio[3]={'r','s','p'};
	map <char,char> counter;	
	map <char,lli> indice;
	lli precio[3];
	void solve(){
		lli N,K,A,B,C,i,j,tot=0,ind,res=0,c,candidato;
		char ant;
		cin>>N>>K;
		cin>>A>>B>>C;
		precio[0]=A,precio[1]=B,precio[2]=C;
		string s;
		counter['s']='r',counter['p']='s',counter['r']='p';
		indice['r']=0,indice['s']=1,indice['p']=2;
		cin>>s;
		for(i=0;i<K;i++){	
			candidato=0;
			for(c=0;c<3;c++){
				tot=0;
				ant=inicio[c];
				if(counter[s[i]]==ant)tot+=precio[c];
				for(j=i+K;j<N;j+=K){
					if(ant==counter[s[j]]){
						ant='a';
					}
					else {
						ant=counter[s[j]];
						tot+=precio[indice[ant]];
					}
				}
				candidato=max(tot,candidato);
				//cout<<tot<<" "<<inicio[c]<<" ";
			}	
			//cout<<"\ncandidato fue "<<candidato<<" "<<i<<"\n";
			res+=candidato;
		}
		cout<<res;
	}
int main(){
	//cin.tie(0),ios_base::sync_with_stdio(0);
	lli i,t;
	t=1;
	for(i=1;i<=t;i++){
		solve();
	}
}


Measured memory_bytes: 512
from sys import exit
# A,B,C = [int(n) for n in input().split()]
a = int(input())
b = int(input())
h = int(input())
print((a+b)*h//2)
# N = int(input())
# a = [int(input()) for _ in range(N)]
# S = str(input())
# L = len(S)
# T = str(input())
exit()


Measured memory_bytes: 2940
#include <stdio.h>

int
main()
{
	int a, b, c;
	scanf("%d %d %d", &a, &b, &c);

	int n;
	int n_divisor = 0;
	for (n = a; n <= b; n++)
	{
		if (c % n == 0)
		{
			n_divisor++;
		}
	}
	printf("%d\n", n_divisor);

	return 0;
}

Measured memory_bytes: 596
#include <iostream>

int main() {
	int a, b;
	char op;

	do{
		std::cin >> a >> op >> b;
		if (op == '+') {
			std::cout << a + b << std::endl;
		}
		else if (op == '-') {
			std::cout << a - b << std::endl;
		}
		else if (op == '*') {
			std::cout << a * b << std::endl;
		}
		else if (op == '/') {
			std::cout << a / b << std::endl;
		}
	} while (op != '?');
}


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


int main() {
  static const double pi = 3.14159265358979323846264338327950L;

  long long a,b,h,m;
  

  cin >> a >> b >> h >> m;
  
  long double jisin = (h*60 + m)*0.5;
  long double funsin = 6 * m;
  
  /*
  degreeをラジアン角に直さなければならない
  */
  
  long double jisin_rad = jisin*pi/180;
  long double funsin_rad = funsin*pi/180;
  
  long double jisin_x = a * cos(jisin_rad);
  long double jisin_y = a * sin(jisin_rad);
  
  long double funsin_x = b * cos(funsin_rad);
  long double funsin_y = b * sin(funsin_rad);
  
  //cout << jisin_x << endl << jisin_y << endl;
  //cout << funsin_x << endl << funsin_y << endl;
  
  long double dx = abs(jisin_x - funsin_x);
  long double dy = abs(jisin_y - funsin_y);
  
  long double distance = sqrt(dx*dx+dy*dy);
  
  cout << fixed << setprecision(20) << distance ;
  
}

Measured memory_bytes: 4112
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
    int n;
    cin >> n;
    vector<ll> a(n); 
    map<ll,ll> b;
    set<ll> c;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        b[a[i]]++;
        c.insert(a[i]);
    }
    ll sum = 0;
    map<ll,ll> summinone;
    for(auto v : c){
        sum += b[v] * (b[v] - 1) / 2;
        summinone[v - 1] = (b[v] - 1) * (b[v] - 2) / 2;
    }
    for(int i = 0; i < n; i++){
        cout << sum - b[a[i]] * (b[a[i]] - 1) / 2 + summinone[a[i] - 1] << endl;
    }
}

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

int main() {
  int n,b,c;
  b = 0;
  c = 0;
  cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  for(int i = 0; i < n; i++) {
    if(i % 2 == 0) {
      b = b + a.at(i);
    }
    else {
      c = c + a.at(i);
    }
  }
  cout << b - c << endl;
}


Measured memory_bytes: 3592