akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cmath>
#include<vector>

using namespace std;
void elem_swap(int &a,int &b){
  int temp=a;
  a=b;
  b=temp;
}

int partition(vector<int> &vec,int left,int right){
  int pivot=vec.at(right);
  int partition=left;
  int index=left;
  while(index<right){
    if(vec.at(index)>pivot) index++;
    else {
      if(partition<index) elem_swap(vec.at(partition),vec.at(index));
      index++;
      partition++;
    }
  }
  if(partition<index) elem_swap(vec.at(partition),vec.at(right));
  return partition;
}

int main(void){

  int size,idx;
  cin>>size;
  vector<int> vec(size);
  for(int i=0;i<size;i++) cin>>vec.at(i);

  idx=partition(vec,0,vec.size()-1);
  for(int i=0;i<size-1;i++){
    if(idx==i){
      cout<<"["<<vec.at(i)<<"]"<<" ";
      continue;
    }
    cout<<vec.at(i)<<" ";
  }
  if(idx==size-1){
    cout<<"["<<vec.at(size-1)<<"]"<<" ";
  }
  else{
  cout<<vec.at(size-1)<<endl;
}
return 0;
}



Measured memory_bytes: 3104
# _*_ coding:utf-8 _*_
#  Atcoder_Beginners_Contest102-B
#  https://beta.atcoder.jp/contests/abc102/tasks/abc102_b

def maxDiff(str) :
	numList = list(map(int, str.split()))
	numList.sort()
	maxdiffint = numList[-1]-numList[0]
	ans = maxdiffint
	return ans


if __name__ == '__main__':
	_ = input()
	inputStr = input()
	ans=maxDiff(inputStr)
	print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = (int)1e3 +10;

int main()
{
    int n;
    cin>>n;
    int arr[60];
    arr[0] = 0;
    int b[60][2];
    int pos = 0;
    for(int i = 1; i <= n; i++)
    {
        cin>>arr[i];
        if(arr[i] != i)
        {
            b[pos][0] = arr[i];
            b[pos][1] = i;
            pos++;
        }
    }
    if(pos == 0) cout<<"YES"<<endl;
    else if(pos == 2 &&b[0][0] == b[1][1] && b[0][1] == b[1][0])
            cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;

    return 0;
}





Measured memory_bytes: 256
#!/usr/bin/env ruby

n = gets.chomp.to_i
ary = gets.chomp.split(' ').map(&:to_i)

right_gcd = [ary.first]
ary.slice(1..-1).each { |num| right_gcd << right_gcd.last.gcd(num) }

left_gcd = [ary.last]
ary.reverse.slice(1..-1).each { |num| left_gcd << left_gcd.last.gcd(num) }
left_gcd = left_gcd.reverse

ans = 0

0.step(n - 1) do |i|
  case i
  when 0           then left_gcd[i + 1]
  when 0...(n - 1) then right_gcd[i - 1].gcd(left_gcd[i + 1])
  when n - 1       then right_gcd[i - 1]
  end.tap { |gcd| ans = (gcd > ans ? gcd : ans) }
end

puts ans


Measured memory_bytes: 15372
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <cstdlib>

using namespace std;

int main()
{
    int a,b,c,x,y;
    scanf("%d%d%d%d%d",&a,&b,&c,&x,&y);
    int sum1,sum2,sum3;
    sum1=a*x+b*y;
    if (x>y) sum2=c*2*y+(x-y)*a;
    else sum2=c*2*x+(y-x)*b;
    sum3=max(x,y)*2*c;
    printf("%d\n",min(sum3,min(sum1,sum2)));
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
template<typename T> using rev_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<class S, class T> void map_init(map<S, T> &m, S k, T v){if(!m.count(k)) m[k] = v;}
void R_YESNO(bool p) { cout << (p ? "YES" : "NO") << endl; }
void R_YesNo(bool p) { cout << (p ? "Yes" : "No") << endl; }
int main() {
    int N, C;
    cin >> N >> C;
    set<tuple<int, int, int>> v;
    for(int i = 0; i < N; i++) {
        int s, t, c;
        cin >> s >> t >> c;
        v.insert(make_tuple(s, 0, c));
        v.insert(make_tuple(t, 1, c));
    }
    int ans = 0;
    map<int, int> rec;
    for(auto x : v) {
        int t, b, c;
        tie(t, b, c) = x;
        if(b) {
            rec[c]--;
            if(rec[c] == 0) rec.erase(c);
        } else {
            map_init(rec, c, 0);
            rec[c]++;
        }
        ans = max<int>(ans, rec.size());
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 12800
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    void input() {

    }

    ll pw(ll num, ll p) {
        return (ll) round(pow(num, p));
    }

    void solve() {
        input();
        ll N, P;
        cin >> N >> P;

        if (N == 1) {
            cout << P << endl;
            return;
        }

        ll ans = 1ll;

        if (N > 60 || 1ll << N > P) {
            cout << 1 << endl;
            return;
        }

        for (ll i = 2; pw(i, N) <= P;) {
            ll tmp = pw(i, N);
            if (P % tmp == 0) {
                ans *= i;
                P /= tmp;
            } else {
                i++;
            }
        }

        cout << ans << endl;


    }
};


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

    Solve().solve();


    return 0;
}


Measured memory_bytes: 888
#include<iostream>
#include<vector>
int main(){
  int r,c,total=0;
  std::cin >> r >> c;
  std::vector<int> sumr,sumc;
  std::vector<std::vector<int> > M;
  sumr.resize(r),sumc.resize(c),M.resize(r);
  for(int i=0; i<r; i++) M[i].resize(c);
  for(int i=0; (r<c ? i<c : i<r) ; i++){
    if(i < r) sumr[i] = 0;
    if(i < c) sumc[i] = 0;
  }
  for(int i=0; i<r; i++){
    for(int j=0; j<c; j++){
      std::cin >> M[i][j];
      sumr[i] += M[i][j];
      sumc[j] += M[i][j];
      total += M[i][j];
    }
  }
  for(int i=0; i<r; i++){
    for(int j=0; j<c; j++) std::cout << M[i][j] << " ";
    std::cout << sumr[i] << "\n";
  }
  for(int i=0; i<c; i++) std::cout << sumc[i] << " ";
  std::cout << total << std::endl;
  return 0;
}

Measured memory_bytes: 3132
import java.util.Scanner;

public class Main {
    public int multiple(int l,int r,int d){
        int count=0;
        for (int i = l; i <= r; i++) {
            if (i%d==0){
                count++;
            }
        }
        return count;
    }
    public static void main(String[] args) {
        Scanner tan = new Scanner(System.in);
        Main obj=new Main();
        while (tan.hasNext()){
            int l,r,d;
            l=tan.nextInt();
            r=tan.nextInt();
            d=tan.nextInt();
            int result=obj.multiple(l,r,d);
            System.out.println(result);
        }
    }
}


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

int main() {
  int N;
  cin >> N;
  while(N!=0){
    if(N%10==7){
      cout << "Yes";
      return 0;
    }else{
      N/=10;
    }
  }
  cout << "No";

  return 0;
}

Measured memory_bytes: 3644
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <list>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
template<class T> inline T sqr(T x) { return x*x; }
typedef pair<int, int> P;
typedef long long ll;
typedef unsigned long long ull;

#define For(i,a,b)	for(int (i) = (a);i < (b);(i)++)
#define rep(i,n)	For(i,0,n)
#define clr(a)		memset((a), 0 ,sizeof(a))
#define mclr(a)		memset((a), -1 ,sizeof(a))
#define all(a)		(a).begin(),(a).end()
#define rall(a)		(a).rbegin(), (a).rend()
#define sz(a)		(sizeof(a))
#define Fill(a,v)	fill((int*)a,(int*)(a+(sz(a)/sz(*(a)))),v)

bool cheak(int x, int y, int xMax, int yMax){ return x >= 0 && y >= 0 && xMax > x && yMax > y; }
const int dx[4] = { -1, 0, 1, 0 }, dy[4] = { 0, 1, 0, -1 };
const int mod = 1000000007;
const int INF = 1e9;

const int M = 500000;
bool es[M];

int main()
{
	For(i, 2, M)es[i] = 1;
	For(i,2, M){
		if (es[i]){
			for (int j = i * 2; j < M; j += i)
				es[j] = 0;
		}
	}

	int n, m;
	while (cin >> n >> m && n != -1 && m != -1){

		vector<int> v;
		int i = n;
		while (v.size() < m){
			i++;
			if (es[i])v.push_back(i);
		}

		vector<int> ans;
		rep(j, v.size())For(k,j, v.size()){
			ans.push_back(v[j] + v[k]);
		}
		sort(all(ans));
		cout << ans[m-1] << endl;
	}

	return 0;
}

Measured memory_bytes: 1764
N,M=map(int,input().split())
A=[]
B=[]
ans="Yes"
for _ in range(N):
  A.append(input().split())
for __ in range(M):
  B.append(input().split())
for i in range(N):
  for k in range(M):
    if B[k][0] not in A[i][0]:
       ans ="No"
      
print(ans)

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

typedef long long ll;

#define int ll
#define all(v) v.begin(), v.end()
#define reps(__i, a, b) for (int __i = a; i < b; i++)
#define rep(__i, n) reps(__i, 0, n)

const ll INF = (1ll << 60);
const ll MOD = (ll)1e9 + 7;

signed main()
{
    int r, d;
    int arr[100];
    cin >> r >> d;
    cin >> arr[0];

    for (int i = 1; i <= 10; i++)
    {
        arr[i] = r * arr[i - 1] - d;
        cout << arr[i] << endl;
    }
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main
{
  public static void main(String[] args) throws NumberFormatException, IOException
  {
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    ArrayList<Integer> inputList = new ArrayList<>(50);

    while (input.ready())
    {
      inputList.add(Integer.valueOf(input.readLine()));
    }

    for (int num : inputList)
    {
      System.out.println(getLowerPrimeNumber(num) + " " + getHigherPrimeNumber(num));
    }
  }

  private static int getLowerPrimeNumber(int number)
  {
    for (int i = number - 1; i > 3; i--)
    {
      if (isPrimeNumber(i))
      {
        return i;
      }
    }
    return 2;
  }

  private static int getHigherPrimeNumber(int number)
  {
    for (int i = number + 1; i < Integer.MAX_VALUE; i++)
    {
      if (isPrimeNumber(i))
      {
        return i;
      }
    }
    return Integer.MAX_VALUE;
  }

  private static boolean isPrimeNumber(int number)
  {
    if (number % 2 == 0)
    {
      return false;
    }

    final int limit = (int) Math.sqrt(number);
    for (int i = 3; i <= limit; i++)
    {
      if (number % i == 0)
        return false;
    }
    return true;
  }
}

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

using namespace std;

#define allof(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define pb push_back
#define exists(s, e) (s.find(e)!=s.end())
#define INF 0x3f3f3f3f
#define endl '\n'
#define mp make_pair
#define watch(x) cout << (#x) << " is " << (x) << endl;

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

ll gcd(ll a, ll b) {return b == 0 ? a : gcd(b, a % b);}
ll fpow(ll  b, ll exp, ll mod){if(exp == 0) return 1;ll t = fpow(b,exp/2,mod);if(exp&1) return t*t%mod*b%mod;return t*t%mod;}
ll divmod(ll i, ll j, ll mod){i%=mod,j%=mod;return i*fpow(j,mod-2,mod)%mod;}

void solve() {
    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    for(int i=0; i<n; i++) { cin >> v[i]; }
    sort(allof(v));
    
    int minans = INT_MAX;
    for(int i=0; i+k-1<n; i++) {
        int calc = abs(v[i+k-1] - v[i]);
        minans = min(minans, calc);
    }
    cout << minans << endl;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    solve();
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include<string>
using namespace std;
int  main() {
	int N;
	string S;
	cin >> N >> S;
	int a=0;
	int b=0;

	for (int i = 0; i < N; i++) {
		if (S[i] == 'I') {
			a += 1;
		}
		else if (S[i] == 'D') {
			a -= 1;
		}

		if (a > b) {
			b = a;
		}
	}
	cout << b << endl;

	return 0;
}

Measured memory_bytes: 256
def main():
  s=int(input())
  max=pow(10,9)
  if s<=max:
    x1,y1,x2,y2,x3,y3=0,0,s,0,s,1
  elif s%max==0:
    x1,y1,x2,y2,x3,y3=0,0,max,0,max,s//max
  else:
    a=s%max
    b=s//max
    x1,y1,x2,y2,x3,y3=0,0,max, 1,max-a,b+1
  print(x1,y1,x2,y2,x3,y3)
  #print(ss(x2,y2,x3,y3))
def ss(x2,y2,x3,y3):
  return x2*y3-x3*y2
if __name__=='__main__':
  main()


Measured memory_bytes: 3064
//Author:: Pham Ngoc Minh- Chuyen Thai Binh
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ll long long
#define fl float
#define db double
#define ii pair<ll,ll>
#define pii pair<ii,ii>
#define ford(i,a,b) for(int i=a;i<=b;i++)
#define foru(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,a,b) for(int i=a;i<b;i++)
#define oo 10000000000001
#define ooo -1000000000001
#define bost  ios_base::sync_with_stdio(false); cin.tie(0);
int const maxn=1005;
int const mod=1e9+7;
int m,n,dp[maxn][maxn];
char a[maxn][maxn];
int main()
{
    bost
    cin>>m>>n;
    ford(i,1,m)
    {
        ford(j,1,n)
        cin>>a[i][j];
    }
    dp[1][1]=1;
    for(int i=1; i<=m; i++)
    {
        for(int j=1; j<=n; j++)
        {
            if(a[i][j]=='.')
            {
                if(j-1>0)
                {
                    dp[i][j]=((dp[i][j]%mod)+(dp[i][j-1]%mod))%mod;
                }
                if(i-1>0)
                {
                    if(a[i-1][j]=='.')
                    dp[i][j]=((dp[i][j]%mod)+(dp[i-1][j]%mod))%mod;
                }
            }
            else dp[i][j]=0;
        }
    }
    cout<<dp[m][n];
    return 0;
}
// I love Chuyen Thai Binh Verry much ! Now, you alaways in my code of me <3
// Chuyen Thai Binh La Nha :>>


Measured memory_bytes: 5120
n, m = gets.split.map(&:to_i)
x = gets.split.map(&:to_i)
sorted = x.sort

diffs = []
(0...m-1).each do |i|
  diffs << [sorted[i+1]-sorted[i], i]
end

diffs = diffs.sort_by{|t| -t[0]}.take(n-1)

result = 0
i = 0
diffs.each do |(d, j)|
  result += sorted[j] - sorted[i]
  i = j + 1
end
result += sorted[-1] - sorted[i]
puts result


Measured memory_bytes: 16752
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a; i<b; i++)
#define dep(i,a,b) for(int i=a; i>=b; i--)
#define sq(a) (a)*(a)
#define ms(a,v)	memset(a,v,sizeof a)
using namespace std;
const long long INF = 1e18 , MAXN =1e5, MOD = 1e9 + 7;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<vector<int> > vvi;
typedef map<int, int> mii;
typedef map<string, int> msi;
typedef map<int, string> mis;
typedef map<string, string> mss;

int main()
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int k;  cin>>k;
  k++;
  ll sum=0;
  rep(i,1,k){
    rep(j,1,k){
      int x=__gcd(i,j);
      rep(k1,1,k){
        sum+=__gcd(x,k1);
      }
    }
  }
  cout<<sum<<"\n";
    return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define f(i,j,k) for(int i=j;i<k;i++)
#define f2(i,j,k) for(int i=j;i>k;i--)
using namespace std;
int main(){
    long long n;
    cin>>n;
    long double ans=0,x[n],y[n],d;
    d=n;
    f(i,0,n){
        cin>>x[i]>>y[i];
    }
    f(i,0,n-1){
        f(j,i+1,n){
            ans+=2*sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2));
        }
    }
    cout<<fixed<<setprecision(7)<<ans/d<<endl;
    return 0;
}


Measured memory_bytes: 3824
n = int(input())
a = []
s = [0]*n
x = 1
for i in range(n):
  a.append(int(input()))
if 2 not in a:
  print(-1)
else:
  while True:
    if a[x-1] == 2:
      print(sum(s)+1)
      exit()
    else:
      s[x-1] += 1
      if s[x-1] == 2:
        print(-1)
        exit()
      x = a[x-1]

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

using ll = long long;
const int mod = 1e9 + 7;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll N, A, B;
    cin >> N >> A >> B;
    A--;
    B--;
    if ((B - A) % 2 == 0) {
        cout << (B - A) / 2 << endl;
    } else {
        cout << min(A + 1 + (B - A - 1) / 2, N - B + (B - A - 1) / 2) << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <limits.h>


using namespace std;
int value;
int v[4]={500,100,50,10};
int c[4];
//k~o·ÌÅ¬Ì
int change(int k){
	int res=0;
	for(int i=0;i<4;i++)
	{
		res += k / v[i];
		k %= v[i];
	}
	return res;
}
int mincount,minsum;
int r[4];
int t[4];
//aÔÚÌRCðp¢éBpµ½ªbB
void dfs(int a,int b,int sum){
	if(a==4){
		if(sum<value)return;
		int count=change(sum-value)-b;
		if(count<mincount||(count==mincount&&minsum>sum)){
			minsum=sum;
			mincount=count;
			for(int i=0;i<4;i++)
				r[i]=t[i];
		}
	}else{
		for(int i=0;i<=c[a];i++){
			t[a]=i;
			dfs(a+1,b+i,sum+v[a]*i);
		}
	}
}
int main(){
	int s=0;
	for(;;){
		cin>>value;
		if(value==0)break;
		if((s++)>0)cout<<endl;
		for(int i=3;i>=0;i--)
			cin>>c[i];
		mincount=minsum=INT_MAX;
		dfs(0,0,0);
		for(int i=3;i>=0;i--){
			if(r[i]>0){
				cout << v[i] << " " << r[i] << endl;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 868
import sys
input = sys.stdin.readline

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
    n = int(input())
    cache = set()
    a = prime_factorize(n)
    tmp = 1
    ans = 0
    while a:
        x = a.pop()
        if tmp % x == 0:
            tmp *= x
        else:
            tmp = x
        if tmp in cache:
            continue
        cache.add(tmp)
        ans += 1
        tmp = 1


    print(ans)


main()


Measured memory_bytes: 9220
#include <bits/stdc++.h>
#include <math.h>
#define uint unsigned long long
#define ll long long
#define db double
#define ls rt << 1
#define rs rt << 1 | 1
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define X first
#define Y second
#define pcc pair<char, char>
#define vi vector<int>
#define vl vector<ll>
#define rep(i, x, y) for(int i = x; i <= y; i ++)
#define rrep(i, x, y) for(int i = x; i >= y; i --)
#define eps 1e-9

using namespace std;
inline int read()
{
    int x = 0, f = 1; char ch = getchar();
    while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
    while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
    return x * f;
}
string s;
bool vis[256];
int main()
{
	cin >> s;
	int nn = s.size();
	rep(i, 0, nn - 1) vis[s[i]] = 1;
	if(vis['N'] != vis['S'] || vis['W'] != vis['E']) puts("No");
	else puts("Yes");
	return 0;
} 


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vv vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define INF 100000000000
#define eps 1e-7
#define mod 1000000007
#define int ll
using namespace std;

signed main(void) {
    int N, X; cin >> N >> X;
    int ans=0;
//    vi x;
    rep(i, N) {
        int tmp; cin >> tmp;
        if (ans == 0) ans = abs(X - tmp);
        else ans = __gcd(ans, abs(X - tmp));
//        x.pb(abs(X - tmp));
    }
    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()

int main(void){
    string s;
    cin >> s;


    ll sum = 0;
    ll count = 0;
    rep(i, 0, s.size()){
        if(s[i] == 'W'){
            sum += i - count;
            count++;
        }
    }

    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
constexpr int mod = 1e9 + 7;

long long mod_pow(long long x, long long n){
  if(n == 0) return 1;
  long long res = mod_pow(x*x % mod, n / 2);
  if(n & 1) res = res*x % mod;
  return res;
}

signed main(){
  int n;
  cin >> n;
  int ans = (mod_pow(10, n) - 2 * mod_pow(9, n) % mod + mod_pow(8, n) + mod) % mod;
  cout << ans << endl;
}

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

int main(){
    int n;
    cin >> n;
    vector<int> array(n);
    for(int i=0; i<n; i++){
        cin >> array.at(i);
    } 
    int count = 0;
    for(int i=0; i<n; i++){
        if(i % 2 == 0 && array.at(i) % 2 == 1){
            count++;
        }
    }
    cout << count << endl;
}

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

int main(){
	int n; cin>>n;
	vector<int> a(n);
	for(int i = 0; i < n; i++) cin>>a[i];
	sort(a.begin(), a.end());
	cout<<a[n-1] - a[0]<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mk make_pair
#define PII pair<ll,int>
#define PB push_back
const int maxn=4e3+9;
const int mod=998244353;
int main()
{
	int n,a=0,w=0,t=0,r=0;
	char s[10];
	scanf("%d",&n);
	while(n--)
	{
		scanf("%s",s);
		if(s[0]=='A')a++;
		if(s[0]=='W')w++;
		if(s[0]=='T')t++;
		if(s[0]=='R')r++;
	}
	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n",a,w,t,r);
}

Measured memory_bytes: 3788
# coding:utf-8

from operator import itemgetter

n, t = map(int, raw_input().split())
ans = 0
i=0
# l = [[0], [0]]*n
l = [[0 for i in range(2)] for j in range(n)]

# print l

for i in range(0, n):
    a, b = map(int, raw_input().split())
    l[i][0] = a
    l[i][1] = b
    
# print l
l.sort(key=itemgetter(1))
# print l

if t < l[0][1]:
    print "TLE"
else:
    ans = l[0][0]
    for i in range(n):
        if l[i][1] > t:
            break
        if l[i][0] < ans:
            ans = l[i][0]
    print ans





Measured memory_bytes: 2692
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll h,n,i,j,k,l,sum=0;
    cin>>h>>n;
    for(i=1; i<=n; i++)
    {
        cin>>k;
        sum=sum+k;
    }
    if(sum>=h)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
    return 0;


}


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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
  for (auto val : array)
    std::cout << val << ", ";
  std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

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

  ll h, w; std::cin >> h >> w;
  ll ans = ll((w+1)/2) * ll((h+1)/2);
  ans += ll(w/2) * ll(h/2);
  if (w == 1 || h == 1) ans = 1;
  std::cout << ans << "\n";
}


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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

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

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

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

	const int limit = 3500;
	rep(h,1,limit+1)rep(w,1,limit+1){
		ll coef = 4LL * h * w - 1LL * N * w - 1LL * N * h;
		ll val = 1LL * N * h * w;
		if(coef != 0 and val % coef == 0 and val/coef > 0){
			ll n = val / coef;
			cout << h << " " << n << " " << w << endl;
			return 0;
		}
	}

	return 0;
}

Measured memory_bytes: 256
/*Hey, What's 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)
vector<long long>v;
int main()
{
    fastio;
    long long a=0,b=0,c,d,e,f=0,l,g,m,n,k,i,j,t,p,q;
    cin>>n>>d;
    d=2*d+1;
    n=ceil(1.0*n/d);
    cout<<n;
    return 0;
}


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

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

int n;
int dx, dy;
int cx[21], cy[21];
double dist[21][21];
double limit[20];

bool dfs(int pos, int visited, double sum) {
	if(visited == (1 << n) - 1)
		return true;

	for(int i = 0; i < n; ++i) {
		if(visited & (1 << i))
			continue;

		const double next = sum + dist[pos][i];
		for(int j = 0; j < n; ++j)
			if(!(visited & (1 << j)) && next + dist[i][j] >= limit[j])
				goto next;

		if(dfs(i, (visited | (1 << i)), next))
			return true;

	next:;
	}

	return false;
}

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

	const int INF = 0xfffffff;

	while(cin >> n, cin >> cx[n] >> cy[n] >> dx >> dy, n) {
		for(int i = 0; i < n; ++i)
			cin >> cx[i] >> cy[i];

		for(int i = 0; i <= n; ++i)
			for(int j = i + 1; j <= n; ++j)
				dist[i][j] = dist[j][i] = hypot(cx[i] - cx[j], cy[i] - cy[j]);

		for(int i = 0; i < n; ++i)
			limit[i] = hypot(cx[i] - dx, cy[i] - dy);

		cout << (dfs(n, 0, 0.0) ? "YES" : "NO") << endl;
	}

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1204
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
// Welcome to my source code!

int n;

void dfs(string s, char mx) {
    if (s.size() == n) {
        cout << s << endl;
        return;
    }
    for (char c = 'a'; c <= mx; c++) {
        dfs(s + c, (c == mx ? mx + 1 : mx));
    }
}

int main() {
    cin >> n;
    dfs("", 'a');
}

Measured memory_bytes: 1536
//
//  main.cpp
//  atcoder
//
//  Created by Hisaki Kobayashi on 2020/04/14.
//  Copyright © 2020 Hisaki Kobayashi. All rights reserved.
//

#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
typedef long long ll;
using namespace std;

int main(int argc, const char * argv[]) {
    
//    // input from txt （提出時にこの箇所は削除すること）
//    std::ifstream in("input.txt");
//    std::cin.rdbuf(in.rdbuf());
//
//
//    ll N,M;
//    cin >> N >> M;
//
//    vector<ll> A(M);
//    ll sum=0;
//    for(ll i=0;i<M;i++){
//        cin >> A[i];
//        sum += A[i];
//    }
//
//    if(sum <= N){
//        cout << N - sum << endl;
//    }
//    else{
//        cout << -1 << endl;
//    }
//
//
////    cout << fixed << setprecision(20) << R*2.0*M_PI << endl;
//
//    return 0;
    
    
      double R;
       cin >> R;
       
       cout << fixed << setprecision(20) << R*2.0*M_PI << endl;
    
       return 0;
    
}




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

using namespace std;

#define intt long long
#define FAST ios_base::sync_with_stdio(0); cin.tie(0);

const int N = 1005;

int n;

int main() {

	FAST;

	int a, b, k;
	cin >> k >> a >> b;
	for (int i = a; i <= b; i ++) {
		if (i % k == 0) {
			cout << "OK\n";
			return 0;
		}
	}
	cout << "NG\n";
	return 0;
}

Measured memory_bytes: 3636
//QWsin
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rep(i,x,y) for(int i=x;i<=y;++i)
#define out(i,u) for(int i=first[u];i!=-1;i=next[i])
#define repvc(i,vc) for(int i=0,_sz=vc.size();i<_sz;++i)
using namespace std;

const int INF=1<<30;
typedef long long ll;

inline int read()
{
	int ret=0,f=1;char ch=getchar();
	while(ch<'0' || ch>'9') {if(ch=='-')f=-1;ch=getchar();}
	for(;ch>='0'&&ch<='9';ch=getchar()) ret=ret*10+ch-'0';
	return ret*f;
}

const int maxn=2000+10;

char s[maxn][maxn];
int up[maxn][maxn],dn[maxn][maxn],l[maxn][maxn],r[maxn][maxn];

int main()
{
	int n,m;cin>>n>>m;
	rep(i,1,n) scanf("%s",s[i]+1);
	rep(i,1,n)
	{
		rep(j,1,m) 
			if(s[i][j]=='.') l[i][j]=l[i][j-1]+1;
			else l[i][j]=0;
		for(int j=m;j>=1;--j)
			if(s[i][j]=='.') r[i][j]=r[i][j+1]+1;
			else r[i][j]=0;
	}
	rep(j,1,m)
	{
		rep(i,1,n) 
			if(s[i][j]=='.') up[i][j]=up[i-1][j]+1;
			else up[i][j]=0;
		for(int i=n;i>=1;--i)
			if(s[i][j]=='.') dn[i][j]=dn[i+1][j]+1;
			else dn[i][j]=0;
	}

	int ans=0;
	rep(i,1,n) rep(j,1,m) ans=max(ans,up[i][j]-1+dn[i][j]-1+l[i][j]-1+r[i][j]-1+1);
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 67328
#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <utility>
#include <functional>
#include <queue>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/math/common_factor_ct.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/icl/interval_map.hpp>
#include <boost/pending/disjoint_sets.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/kruskal_min_spanning_tree.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/io.hpp>

#define REP(i, N) for(int i=0; i<(N); i++)
using namespace std;
using namespace boost::math;
using namespace boost::numeric;
using namespace boost::icl;

int main() {
	int N;

	cin >> N;
    vector<int> H(N);
  
  for (auto& i : H)
    cin >> i;
  
  for (int i = H.size() - 2; i >= 0; i--) {
    if (H[i] - H[i+1] >= 2) {
      cout << "No" << endl;
      return 0;
    }
    else if (H[i] > H[i+1])
      H[i]--;
  }

	cout << "Yes" << endl;

	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int x,ch;
inline int read(){
	while(isspace(ch=getchar()));x=ch&15;
	while(isdigit(ch=getchar()))x=x*10+(ch&15);
	return x;
}
bitset<2000*2000+8> s;

int main(){
	int n=read();
	s[0]=1;
	while(n--)s|=s<<read();
	int p=s.count(),i=0;
	if(p&1)(p>>=1)++;
	else (p>>=1)++;
	for(i=0;p&&i<=2000*2000;++i)
		p-=s[i];
	printf("%d",i-1);
}

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

int main(void) {
    int N;
    cin >> N;
    vector<int> a(N);
    int A = 0, B = 0;
    for (int i = 0; i < N; ++i) {
        cin >> a[i];
    }
    sort(a.rbegin(), a.rend());
    for (int i = 0; i < N; ++i) {
        if (i % 2 == 0) {
            A += a[i];
        }
        else {
            B += a[i];
        }
    }
    cout << A - B;
    return 0;
}

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

using namespace std;

#define ALL(x) (x).begin(), (x).end()
#define AND(x,y,z) 
#define DUMP(xs) for (auto x:xs) cout<<x<<' ';cout<<endl
#define DUMPP(xs) for (auto x:xs) cout<<'('<<x.first<<','<<x.second<<')';cout<<endl
#define FOR(i,a,b) for (ll i=(ll)(a);i<(ll)(b);++i)
#define OUT(x) cout<<x<<endl
#define REP(i,n) FOR(i,0,n)
#define YES(cond) cond ? OUT("YES") : OUT("NO")
#define Yes(cond) cond ? OUT("Yes") : OUT("No")

template<class T> T gcd(const T x,const T y){if(!y){return x;}return gcd(y,x%y);}
template<class T> T lcm(const T x,const T y){return x/gcd(x,y)*y;};
template<class T> T modpow(const T x,const T n,const T mod) {
  T res=1;while(n>0){if(n%2)res=res*x%mod;x=x*x%mod;n/=2;};return res;
}
template<class T> bool alltrue(const T &a){return all_of(ALL(a),[](bool x){return x;});}
template<class T> bool anytrue(const T &a){return any_of(ALL(a),[](bool x){return x;});}
template<class T> bool contain(const T &a,const T &b){for(auto x:b){if (a.find(x)==a.end()){return false;}}return true;}
template<class T> bool mmax(T &m,const T q){ if (m < q) {m = q; return true;} else return false; }
template<class T> bool mmin(T &m,const T q){ if (m > q) {m = q; return true;} else return false; }
template<class T> int siz(const T &a) {return (int)a.size();}
template<class T> set<T> devisers(T n) {
  set<T> res;for(T i=1;i<(T)sqrt(n)+1;i++){if(n%i==0){res.insert(i);res.insert(n/i);}}return res;
}
template<class T> void concat(T &a, const T &b){a.insert(a.end(),b.begin(),b.end());}
template<class T> void getand(const T &a,const T &b,T &c) {
  set_intersection(a.begin(),a.end(),b.begin(),b.end(),inserter(c,c.end()));
}
template<class T> void getor(const T &a,const T &b,T &c) {
  set_union(a.begin(),a.end(),b.begin(),b.end(),inserter(c,c.end()));
}

typedef long long ll;
typedef pair<ll, ll> P;

const ll MOD=1e9+7;
const int MAX=1e5+100;

int main() {
  string S,T;cin>>S>>T;
  OUT(T+S);

  return 0;
}

Measured memory_bytes: 256
#include <cstdio>

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

  int num[N];
  for (int i = 0; i < N; ++i)
    scanf("%d", &num[i]);

  int count = 0;
  for (int i = 0; i < N; ++i)
    count += num[i] - 1;

  printf("%d\n", count);

  return 0;
}


Measured memory_bytes: 128
#include <stdio.h>

int main(int argc, const char * argv[]) {
    
    int h, w;
    
    while (1) {
        scanf("%d %d", &h, &w);
        
        if (h == 0 && w == 0) {
            break;
        }
        
        for (int j=0; j<h; j++) {
            for (int i=0; i<w; i++) {
                if ((i+j)%2 == 0) {
                    printf("#");
                }else{
                    printf(".");
                }
            }
            printf("\n");
        }
        printf("\n");
    }
    
    return 0;
}


Measured memory_bytes: 2048
#include<bits/stdc++.h>
#include<time.h>
#include<stdlib.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse4")
#define pb push_back
#define mp make_pair
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define pll pair<ll,ll>
#define vll vector<ll,ll>
#define all(a) (a).begin(),(a).end()
#define ff first
#define ss second
#define sz(x) (ll)x.size()
#define hell 1000000007
#define repf(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>b;i--)
#define lbnd lower_bound
#define ubnd upper_bound
#define bs binary_search
#define gcd(a,b) __gcd((a),(b))
#define EPS 1e-12
#define lcm(a,b) ((a)*(b))/__gcd((a),(b))
#define sqrt sqrtl
#define cbrt cbrtl
using namespace std;
ll a[100005];
ll dp[100005];
int main()
{
  IOS
  ll n,m;
  cin>>n>>m;
  ll i,x;
  for(i=1;i<=m;i++)
  {
    cin>>x;
    a[x]=1;
  }
  dp[0]=1;
  for(i=1;i<=n;i++)
    if(!a[i])
    {
      dp[i]=dp[i-1]%hell;
      if(i-2>=0)
        dp[i]=(dp[i]%hell + dp[i-2]%hell)%hell;
    }
    cout<<dp[n];
  return 0;
}

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

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

//for loop関係
#define rep(i,a,n) for(int i=(a);i<(n);++i)
#define repe(i,a,n) for(int i=(a);i<=(n);++i)
#define rrep(i,n,a) for(int i=(n);n>(a);--i)
#define rrepe(i,n,a) for(int i=(n);n>=(a);--i)

//略記
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define ENDL << "\n"

using ll = long long;
using P = pair<int,int>;
using itn = int;

//定数
const int INF = 1<<30;
const ll MOD = 1000000007;
const long double PI =(acos(-1));

//Degree <-> Radian
double toRad(double d){ double rad; rad=d*PI/180; return rad; }
double toDegree(double rad){ double d; d=rad*180/PI; return d; }
//The least common multiple : lcm
ll lcm(int a,int b){ return a*b/__gcd(a,b); }
//素数判定
bool isPrime(int n){
    int i; 
    if(n<2) return 0;
    else if(n==2) return 1;
    if(n%2==0) return 0;
    for(i=3;i*i<=n;i+=2) if(n%i==0) return 0;
    return 1;
}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int a,b;
    cin >> a >> b;
    if(a<2*b) cout << 0 ENDL;
    else cout << a-2*b ENDL;
    
    return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
using LL = long long int;
#define incID(i, l, r) for(int i = (l)    ; i <  (r); ++i)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); --i)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); ++i)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); --i)
#define inc(i, n)  incID(i, 0, n)
#define dec(i, n)  decID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec1(i, n) decII(i, 1, n)
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))
#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define FI first
#define SE second
#define FR front()
#define BA back()
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
auto setmin   = [](auto & a, auto b) { return (b <  a ? a = b, true : false); };
auto setmax   = [](auto & a, auto b) { return (b >  a ? a = b, true : false); };
auto setmineq = [](auto & a, auto b) { return (b <= a ? a = b, true : false); };
auto setmaxeq = [](auto & a, auto b) { return (b >= a ? a = b, true : false); };
#define SI(v) static_cast<int>(v.size())
#define RF(e, v) for(auto & e: v)
#define until(e) while(! (e))
#define if_not(e) if(! (e))
#define ef else if
#define UR assert(false)
#define IN(T, ...) T __VA_ARGS__; IN_(__VA_ARGS__);
void IN_() { };
template<typename T, typename ... U> void IN_(T &  a, U &  ... b) { cin >> a; IN_(b ...); };
template<typename T                > void OUT(T && a            ) { cout << a << endl; }
template<typename T, typename ... U> void OUT(T && a, U && ... b) { cout << a << " "; OUT(b ...); }

// ---- ----

int main() {
	vector<vector<int>> v = {
		{ 2, 4, 5, 7, 9 },
		{ 0, 1, 6, 8 },
		{ 3 }
	};
	vector<string> s = { "h", "p", "b" };
	map<int, string> mp;
	inc(i, 3) {
		RF(e, v[i]) { mp[e] = s[i] + "on"; }
	}
	
	IN(int, n);
	OUT(mp[n % 10]);
}


Measured memory_bytes: 3632
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;
 
 
 
class Solve
{
    public Solve() { }
    public static int Main()
    {
        new Solve().calc();
        return 0;
    }
 
 
    Scanner cin;
 
    void calc()
    {
        cin = new Scanner();
        int N = cin.nextInt();
        int D = cin.nextInt();
        int X = cin.nextInt();
        int[] A = new int[N];

        for (int i = 0; i < N; i++){
            A[i] = cin.nextInt();
        }
        int result = X;
        //Console.WriteLine(result);
        for (int i = 0; i < N; i++){
            //Console.WriteLine(D / A[i]);
            result += (D / A[i]);
            if (D % A[i] != 0)
                result++;
            //Console.WriteLine(i + ": " + result);
        }

        Console.WriteLine(result.ToString());
    }
}
public class Point
{
    public int Color;
    public int X;
    public int Y;
    public Point(int color, int x, int y)
    {
        Color = color;
        X = x;
        Y = y;
    }
}
 
class Scanner
{
    string[] s;
    int i;
 
    char[] cs = new char[] { ' ' };
 
    public Scanner()
    {
        s = new string[0];
        i = 0;
    }
 
    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }
 
    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }
 
    public long nextLong()
    {
        return long.Parse(next());
    }
 
    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }
 
    public double nextDouble()
    {
        return double.Parse(next());
    }
 
 
    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

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

int main() {
  int n;
  string s;
  cin >> n >> s;
  
  int w_num=0,b_num=0;
  vector<int> w_l(n+1),b_l(n+1);
  
  w_l[0]=0;
  b_l[0]=0;
  
  for (int i; i<n; i++){
    if (s.at(i)=='.'){
      w_num+=1;
    }
    else {
      b_num+=1;
    }
    w_l[i+1]=w_num;
    b_l[i+1]=b_num;
  }
  
  int ans=100000;
  for (int j; j<n+1; j++){
    ans=min(ans,b_l[j]+w_num-w_l[j]);
  }
  cout << ans << endl;
}

Measured memory_bytes: 2180
N,K = map(int,input().split())
Hs = list(map(int,input().split()))
outs = [1] * N
for _ in range(K):
    a,b = map(int,input().split())
    if Hs[a-1] == Hs[b-1]:
        outs[a-1] = 0 
        outs[b-1] = 0 
    elif Hs[a-1] > Hs[b-1]:
        outs[b-1] = 0 
    else:
        outs[a-1] = 0 
print(sum(outs))

Measured memory_bytes: 20116
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        final int N = 5;
        Scanner sc = new Scanner(System.in);
        int[] times = new int[N];
        for (int i = 0; i < N; i++) {
            times[i] = sc.nextInt();
        }

        int loss = 0;
        int maxLoss = 0;
        int ans = 0;
        for (int i = 0; i < N; i++) {
            if (times[i]%10 == 0) {
                loss = 0;
            }
            else {
                loss = 10 - times[i] % 10;
                maxLoss = Math.max(loss, maxLoss);
            }
            ans += (times[i] + loss);
        }
        System.out.println(ans - maxLoss);
    }
}


Measured memory_bytes: 21844
import sys

#+++++

def ic(dd):
	if dd == 0:
		return True
	if dd == 1:
		return True
	
	for i in range(dd):
		if i ** 2 == dd:
			return True
			
		if i ** 2 > dd:
			return False
			
	return False

def main():
	b , c = map(int, input().split())
	dd = int(str(b)+str(c))
	r=ic(dd)
	ret = 'Yes' if r else 'No'

	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Measured memory_bytes: 3064
from itertools import combinations

N = int(input())
L = [int(_) for _ in input().split()]

count = 0
for li, lj, lk in combinations(L, 3):
  if li == lj or lj == lk or lk == li:
    continue
  tmp = sorted([li, lj, lk],reverse=True)
  if tmp[1] + tmp[2] >tmp[0]:
    count += 1
print(count)

Measured memory_bytes: 9188
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <unordered_map>
#include <cmath>
using namespace std;

typedef unsigned int uint;
typedef long long llong;
typedef unsigned long long ullong;
// -2.1e-9 <= int <= 2.1e9
// -9.2e-18 <= long long <= 9.2e18
// 0 <= unsigned int <= 4.2e9
// 0 <= unsigned long long <= 18.4e18

int gcd(int a, int b) {
    int i, c;
    if (a < b) c = a;
    else c = b;
    for (i = c; i>0; i--) {
        if (a%i == 0 && b%i==0)
            break;
    }
    return i;
}


int main()
{
    int K;
    cin >> K;
    vector<vector<int>> result(K+1, vector<int>(K+1, -1));
    llong sum = 0;
    for (int a=1; a<=K; a++) {
        for (int b=1; b<=K; b++) {
            if (result[a][b] < 0) {
                int d = gcd(a, b);
                result[a][b] = result[b][a] = d;
            }
            //sum += result[a][b];
            for (int c=1; c<=K; c++) {
                int e = result[a][b];
                if (result[e][c] < 0) {
                    int f = gcd(e, c);
                    result[e][c] = result[c][e] = f;
                }
                sum += result[e][c];
            }
        }
    }
    cout << sum << endl;
}


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

#define pb push_back
#define mp make_pair
#define all(n) (n).begin(),(n).end()
#define fi first
#define se second

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

const int MOD = 1e9+7;

int main() {

	ios::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n;
	int a[100];
	for (int i = 0; i < n; i++) {cin >> a[i];
	}
	int cnt = 0;
	sort(a,a+n);
	for (int i = 0; i < n; i++) {
		for (int j=i+1; j < n; j++) {
			for (int k=j+1;k<n;k++) {
				if (a[k]==a[j]||a[j]==a[i]||a[i]==a[k]) continue;
				if (a[k]-a[j]<a[i]) cnt++;
			}
		}
	}
	cout << cnt << "\n";
}

Measured memory_bytes: 3656
void main() {
	(rs.to!(dchar[]).sort().uniq.array.length == 3 ? "Yes" : "No").writeln;
}

// ===================================

import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

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


int main()
{
	int n, x;
	cin >> n;
	for (int i = 1; i <= n; i++){
		x = i;
		if (x % 3 == 0){
			cout << " " << i;
		}
		else{
			while (true){
				if (x % 10 == 3){
					cout << " " << i;
					break;
				}
				x /= 10;
				if (x){

				}
				else{
					break;
				}
			}
		}
	}
	cout << endl;
	return 0;
}

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

int main() {
  int N, M;
  cin >> N;
  vector<string> a(N);  
  
  for (int i=0; i<N; i++){
    cin >> a[i];
  }
  
  cin >> M;
  vector<string> b(M); 
  for (int i=0; i<M; i++){
    cin >> b[i];
  }
  
  vector<int> c(N);
  for (int i=0; i<N; i++){
    for (int j=0; j<N; j++){
      if(a[i]==a[j]){
        c[i]++;
      }
    }
    for (int j=0; j<M; j++){
      if(a[i]==b[j]){
        c[i]--;
      }
    }
  }
    sort (c.begin(), c.end());
    if (c[N-1]>0){
    cout << c[N-1] << endl;
    }
  else {
    cout << 0 << endl;
  }
      
       
}


Measured memory_bytes: 256