akhauriyash/Code-Regression huggingface dataset:
n = int(input())
s = []
for i in range(0,n):
    s.append(input())
s.sort()
b = [0] * (n - 1)
for i in range(0,n-1):
    if s[i] == s[i+1]:
        b[i] = 1
j = n-2
while j > 0:
    if b[j-1] != 0:
        b[j-1] += b[j]
    j-=1
max = 0
for i in range(0,n-1):
    if b[i] > max:
        max = b[i]
for i in range(0,n-1):
    if b[i] == max:
        print(s[i])
if b[n-2] == 0:
    print(s[n-1])


Measured memory_bytes: 24900
#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
#include <math.h>
#define MOD 1000000007
using namespace std;

int main(void){
    int n,ans=0;
    string a,b,c;
    cin >> n >> a >> b >> c;
    for(int i=0; i<n; i++){
        if(a[i]==b[i] && b[i]==c[i])continue;
        else if(a[i]==b[i] || b[i]==c[i] || c[i]==a[i])ans++;
        else ans+=2;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

using namespace std;

#define int long long
#define endl '\n'
#define maxn 100010
const int MOD = 1000000007;
using int32 = __uint32_t;

string num;
int a, b, d, k;
int DP[210][4][2];

int call(int pos, int cnt, int f){
    if(cnt > k) return 0;

    if(pos == num.size()){
        if(cnt == k) return 1;
        return 0;
    }

    if(DP[pos][cnt][f] != -1) return DP[pos][cnt][f];
    int res = 0;

    int LMT;

    if(f == 0){
        LMT = num[pos] - '0';
    } else {
        LMT = 9;
    }

    for(int dgt = 0; dgt<=LMT; dgt++){
        int nf = f;
        int ncnt = cnt;
        if(f == 0 && dgt < LMT) nf = 1;
        if(dgt > 0) ncnt++;
        if(ncnt <= k) res += call(pos+1, ncnt, nf);
    }

    return DP[pos][cnt][f] = res;
}

void solve() {
    cin >> num >> k;

    memset(DP, -1, sizeof(DP));
    int res = call(0, 0, 0);
    cout << res << endl;
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int t = 1;
//    cin >> t;

    while (t--)
        solve();
    return 0;
}


Measured memory_bytes: 256
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)

using ll = long long;
using ld = long double;
using ull = unsigned long long;

using namespace std;


const ll MOD = 998244353;

ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}


const ll R2 = (MOD + 1) / 2;

const int N = 1e6 + 10;


int n;

ll s[N];
ll s2[N];

void add(int d, int x) {
	s[d] += x;
	s2[d] += ll(x) * x;
}

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cout.setf(ios::fixed), cout.precision(20);
	cin >> n;
	//n = 200000;
	for (int i = 0; i < n; ++i) {
		int x;
		cin >> x;
		//x = 1e6;
		for (int i = 1; i * i <= x; ++i) {
			if (x % i == 0) {
				add(i, x);
				if (i * i != x) {
					add(x / i, x);
				}
			}
		}
	}
	for (int i = 0; i < N; ++i) {
		s[i] %= MOD;
		s2[i] %= MOD;
		s[i] = (s[i] * s[i] % MOD + MOD - s2[i]) * R2 % MOD;
	}

	ll ans = 0;

	for (int i = N - 1; i >= 1; --i) {
		for (int j = 2 * i; j < N; j += i) {
			s[i] = (s[i] + MOD - s[j]) % MOD;
		}
		ans = (ans + s[i] * pw(i, MOD - 2)) % MOD;
	}

	cout << ans << "\n";

	return 0;
}




Measured memory_bytes: 15872
#include <iostream>
using namespace std;
int main(void){
int t,n,i;
for(i=0; i<4; i++){
cin>>t>>n;
if(t==1)cout<<6000*n<<endl;
else if(t==2)cout<<4000*n<<endl;
else if(t==3)cout<<3000*n<<endl;
else if(t==4)cout<<2000*n<<endl;
}
return 0;
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
#define BIT(n) (1LL << (n))
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPB(i, n) for (int i = 0; i < BIT(n); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORA(i, n) for (auto &&i : n)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define DEBUG(x) cerr << #x <<": "<<x<<"\n"
#define ALL(v) v.begin(), v.end()
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define epb emplace_back
#define int long long
using namespace std;
template <class T> using vec = std::vector<T>;
template <class T = int> T in(){T x; cin>>x;return(x);}
template <class T > void print(T& x){cout<<x<<"\n";}
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int A=in<int>();
  int B=in<int>();
	cout <<(A*B%2==0?"No":"Yes")<<"\n";
}

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

typedef long long int ll;

int main()
{
	string s,t;
	cin>>s>>t;
	int cnt=0;
	for(ll i=0;i<s.size();i++)
		if(s[i]!=t[i])
			cnt++;
	cout<<cnt<<endl;
}



Measured memory_bytes: 3852
/*
オーダー
10**6	余裕を持って間に合う	
10**7	おそらく間に合う	余裕を持って間に合う
10**8	非常にシンプルな処理でない限り厳しい	おそらく間に合う
10**9		非常にシンプルな処理でない限り厳しい
logn	:OK
n		:10^7
nlogn	:10^6
n**2	:10^4
n**3	:300
2**n	:20
n!		:10



// 各桁の和を計算する関数
int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

sort(a, a + N, greater<int>());  // a[0:N] を大きい順にソート

int num[110] = {0};  // バケット
for (int i = 0; i < N; ++i) {
    num[d[i]]++;  // d[i] が 1 個増える
}

map<string, int> mp; // 連想配列 map<キー型, 値型> オブジェクト名
for (int i = 0; i < N; ++i) {
    auto itr = mp.find(s[i]);        // s[i] が設定されているか？
    if(itr != mp.end() ) {
         mp[s[i]] += 1;
    }
    else {
         mp[s[i]] += 1 ;
    }
}
stack<int> s;	//intをデータとするスタックを用意
s.push(1);		//{} -> {1}
printf("%d\n", s.top());	// 3
s.pop();

queue<int> que;	//intをデータとするキューを用意
que.push(1);		//{} -> {1}
printf("%d\n", que.front());	// 1
que.pop();
*/

#include <iostream>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <string.h>

using namespace std;

// #define for(i,a,b) for (int i=(a);i<(b);++i)
typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(long long i = 0; i < (long long)(n); i++)
#define pb push_back // vectorに要素追加
#define INF (ll)1e18
// int 
// // 各桁の和を計算する関数
// int findSumOfDigits(int n) {
//   int amari = 0;
//   int keta = 0;
//   while (n > 0) { // n が 0 になるまで
//     amari += n % 2;
//     if (keta%2==0)
//     n /= 10;
//   }
//   return sum;
// }
 
ll gcd(ll a, ll b) {
	if(b == 0) return a;
	return gcd(b, a % b);
}

// const ll MAX_N = 1e5;
// ll N;
// ll h[MAX_N];
// ll dp[MAX_N+1]; // メモ化テーブル
 
// // i番目以降の品物から重さの総和がj以下になるように選ぶ
// void rec(ll i){
// 	if (i==0) dp[i] = 0;
// 	else if (i==1) dp[i] = abs(h[1]-h[0]);
// 	else dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]));
// 	return;
// }
 
 
int main() {
	// 入力
	ll A,B,C;cin>>A>>B>>C;
	
	// 解法
	ll ans = 0;
	while ((A!=B | B!=C) & (A%2+B%2+C%2==0)){
		ll a,b,c;
		a = B/2 + C/2;
		b = A/2 + C/2;
		c = B/2 + A/2;
		A=a;B=b;C=c;ans++;
	}
	if (A==B & B==C & A%2==0) ans = -1;
	//出力
	cout << ans << endl;
}


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

using namespace std;

char s[100005];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    cin >> s;
    int dif = 0, mij = 0, ans1 = 0, ans2 = 0;
    for(int i = 0; i < n - 1; ++i) {
        if(i > 0 && s[i - 1] == s[i + 1] && s[i] != s[i - 1])
            ++mij;
        else
            dif += (s[i] != s[i + 1]);
        ans1 += (s[i] == s[i + 1]);
    }
    int K = k;
    ans2 = ans1;
    ans1 += min(k, mij) * 2;
    k = k - min(k, mij);
    k *= 2;
    ans1 += min(k, dif);
    bool left = (dif % 2 == 1);
    dif -= (dif % 2 == 1);
    ans2 += min(K, dif / 2) * 2;
    K -= min(K, dif / 2);
    ans2 += min(k, mij) * 2;
    k -= min(k, mij);
    if(k) ++ans2;
    cout << min(max(ans1, ans2), n - 1);
    return 0;
}


Measured memory_bytes: 384
A, B, C, D = map(str, input())

op = ['+', '-']
for op1 in op:
    for op2 in op:
        for op3 in op:
            result = A+op1+B+op2+C+op3+D
            if eval(result) == 7:
                print(result + '=7')
                exit()

Measured memory_bytes: 3064
# coding:utf-8

import sys
from collections import deque, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n, m = LI()

    G = defaultdict(list)
    S = defaultdict(set)
    for _ in range(m):
        a, b = LI_()
        G[a].append(b)
        G[b].append(a)
        S[a].add(b)
        S[b].add(a)

    res = deque([0, G[0][0]])
    visited = set(res)
    needs = S[res[0]] | S[res[-1]] - visited
    while needs:
        v = needs.pop()
        if v in visited:
            continue
        visited.add(v)
        if v in S[res[0]]:
            res.appendleft(v)
        else:
            res.append(v)
        needs = (S[res[0]] | S[res[-1]]) - visited

    print(len(res))
    print(*[v + 1 for v in res])


main()


Measured memory_bytes: 62844
N,M=map(int,input().split())

h_list=list(map(int,input().split()))

good=[1]*N

for i in range(M):
    a,b=map(int,input().split())
    if h_list[a-1]==h_list[b-1]:
        good[b-1]=0
        good[a-1]=0
    elif h_list[a-1]>h_list[b-1]:
        good[b-1]=0
    else:
        good[a-1]=0

print(sum(good))


Measured memory_bytes: 20108
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x;
    cin >> x;
    if (x == 1)
    {
        cout << 0 << endl;
    }
    else
    {
        cout << 1 << endl;
    }
}

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

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


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

import sys
import math

def main():
    n = int(input())
    root_n=math.ceil(math.sqrt(n))
    ans=[0]*n
    count=0

    for x in range(1,root_n):
        for y in range(1,root_n):
            for z in range(1,root_n):
                tmp=x**2+y**2+z**2+x*y+y*z+z*x
                if tmp<n+1:
                    ans[tmp-1]+=1
    for i in ans:
        print(i)

if __name__ == "__main__":
    main()

Measured memory_bytes: 9292
#include <bits/stdc++.h>
#define rep(i,a) for(int i=0;i<int(a);++i)
using ll = long long;
using namespace std;
int main(){
    ll n;
    cin>>n;
    vector<ll> a(n);
    rep(i,n) cin>>a[i];
    ll sum=0;
    ll mod=1e9+7;
    rep(i,63){
        ll z=0,o=0;
        ll bitsum=0;
        rep(j,n){
            if(a[j]%2==0) z++;
            else o++;
            a[j]/=2;
        }
        bitsum=z*o;
        bitsum%=mod;
        bitsum*=(1LL<<i)%mod;
        bitsum%=mod;
        sum+=bitsum;
        sum%=mod;
    }
    cout<<sum<<endl;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define rep(i, N)  for (int (i) = 0; (i) < (N); (i)++)

int main(){

    int S, W;
    cin >> S >> W;

    if (S <= W) cout << "unsafe" << endl;
    else cout << "safe" << endl;

    return 0;
}

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

int main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if ((a + b) == (c + d))
    {
        cout << "Balanced" << endl;
    }
    else if ((a + b) > (c + d))
    {
        cout << "Left" << endl;
    }
    else
    {
        cout << "Right" << endl;
    }
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        Integer[] l = new Integer[n];
        for(int i=0; i<n; i++) {
            l[i] = Integer.parseInt(sc.next());
        }

        Arrays.sort(l,Comparator.reverseOrder());

        //l[i] >= l[j] >= l[k]
        int cnt = 0;
        for(int i=0; i<n-2; i++) {
            for(int j=i+1; j<n-1; j++) {
                for(int k=j+1; k<n; k++) {
                    if(l[j]-l[k]<l[i] && l[i]<l[j]+l[k]) cnt++;
                }
            }
        }
        System.out.println(cnt);
    }
}

Measured memory_bytes: 24772
#include <bits/stdc++.h>
#include <cstdlib>  // abs() for integer 絶対値求めやつ
#include <cmath>    // abs() for float, and fabs()
#include <algorithm>
#include <vector>
#include <string>
#include<iomanip>//浮動小数点数を出力する制度の指定
//使い方　数値をnumとして　cout<<setprecision(n)<<num ;nは桁数
#define rep(i,n) for(int i = 0; i < (n);i++)
#define SORT(a) sort((a).begin(),(a).end())
#define REV(a) reverse((a).begin(),(a).end())
using namespace std;
using ll =long long;
#define INF 2000000000
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; }
#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
/*覚えてないことメモ
数値型から文字列に変換　to_string(number);これは簡単
文字列から数値型に変換　stoi(number)
文字列からllに変換　stoll(number)*/

//ここから書き始める

int main(){
    //sortは市名、点数の順番に行う
    int n ;cin>>n; //how many
    vector<tuple<string,int,int>> T(n);
    rep(i,n){
        string s;cin>>s;//市の名前
        int p;cin>>p;//点数
        p*=-1;
        T[i] = make_tuple(s,p,i+1);
    }
    SORT(T);
    rep(i,n){
        int ans;string s;
        tie(s,ignore,ans) = T[i];
        cout<<ans<<endl;
      //  cout<<s<<" "<<ans<<endl;
    }
}



Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        int k=sc.nextInt();
        System.out.println(Math.min(Math.min(n+m,n+k),m+k));
    }
}


Measured memory_bytes: 23764
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CompProgLib;

namespace ALDS1_14_A
{
    public class Program

    {
        public static void Main(string[] args)
        {
            string target = ReadSt();
            string pattern = ReadSt();
            StringSearch ss = new StringSearch();

            var ans = ss.BMSearch(target, pattern);

            if (ans.Count != 0)
            {
                foreach (int item in ans) Console.WriteLine(item.ToString());
            }
            
        }

        static string ReadSt() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Console.ReadLine()); }
        static long ReadLong() { return long.Parse(Console.ReadLine()); }
        static double ReadDouble() { return double.Parse(Console.ReadLine()); }
        static string[] ReadStAr(char sep = ' ') { return Console.ReadLine().Split(sep); }
        static int[] ReadIntAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => int.Parse(e)); }
        static long[] ReadLongAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => long.Parse(e)); }
        static double[] ReadDoubleAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => double.Parse(e)); }

    }

}

namespace CompProgLib
{
    public class StringSearch
    {

        // BM法
        public HashSet<int> BMSearch(string target, string pattern)
        {

            HashSet<int> hs = new HashSet<int>();
            Dictionary<char, int> table = CreateTable(pattern);

            // 開始位置をパターン末尾に合わせる
            int i = pattern.Length - 1;
            int p = 0;

            while (i < target.Length)
            {
                // パターン末尾に位置を合わせる
                p = pattern.Length - 1;

                while (p >= 0 && i < target.Length)
                {
                    if (target[i] == pattern[p])
                    {
                        i--; p--;
                    }
                    else
                    {
                        break;
                    }
                }
                // 一致判定
                if (p < 0)
                {
                    // 一致した場合はハッシュに追加
                    hs.Add(i + 1);
                    i += pattern.Length - p;
                }
                else
                {
                    // 不一致の場合、ずらし表を参照し i を進める
                    // ただし、今比較した位置より後の位置とする
                    var shift1 = table.ContainsKey(pattern[p]) ? table[pattern[p]] : pattern.Length;
                    var shift2 = pattern.Length - p;    // 比較を開始した地点の1つ後ろの文字
                    i += Math.Max(shift1, shift2);
                }
            }

            return hs;
        }

        // ずらし表の作成
        private Dictionary<char, int> CreateTable(string pattern)
        {
            // パターン末尾からの距離(小さい幅を優先)
            var table = new Dictionary<char, int>();
            for (int i = 0 ; i < pattern.Length ; i++)
            {
                table[pattern[i]] = pattern.Length - i - 1;
            }
            return table;
        }
    }
}


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

int main(){
    int n,x,i,j,k,count = 0;
    do{
        cin >> n >> x;
        for (i = 1; i <= n-2; i++){
            for(j = i+1; j <= n-1; j++){
                for(k = j+1; k <= n; k++){
                    if(i + j + k == x){
                        count++;
                    }
                }
            }
        }
        if(n != 0 || x != 0){
            cout << count << endl;
        }
        count = 0;
    }while(n != 0 || x != 0); 
}


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

int main() {
    ll N, K; cin >> N >> K;
    ll cnt = 0;
    if(K == 0){
        cout << N*N << endl;
        return 0;
    }
    for(ll i = K+1; i <= N; i++){
        ll tmp=N%i-(K-1);
        if(tmp<0)tmp=0;
        if(N%i==0)tmp=0;
        cnt+= (N/i)*(i-K)+tmp;
        //cout << (N/i)*(i-K)+tmp << endl;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	if n%2 == 0 {
		fmt.Println("0.5000000000")
	} else {
		f := float64(n)
		result := ((f + 1) / 2) / f
		fmt.Println(result)
	}
}


Measured memory_bytes: 512
#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>

using namespace std;

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

    vector <int> arr(2 * n);
    for(int i = 0; i < 2 * n; i++){
        cin >> arr[i];
    }

    sort(arr.begin(), arr.end());

    int ans = 0;
    for (int i = 0; i < 2 * n; i += 2){
        ans += arr[i];
    }
    cout << ans << endl;
}


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

int main(void){
  long double n,a,b; cin >> a >> b >> n;
  long double x = 1;
  if(n >= b){
    cout << floor(a*(b-1)/b) << endl;
  }
  else{
    cout << floor(a*n/b) << endl; 
  }
  return 0;
}


Measured memory_bytes: 3748
n,k=map(int,input().split())
x=list(map(int,input().split()))
#cx=0
ans=10**9
for i in range(0,n-k+1):
    x_l=x[i]
    x_r=x[i+k-1]
    #abs(x[i])
    ans=min(ans,abs(x_r-x_l)+abs(x_l),abs(x_r-x_l)+abs(x_r))
print(ans)


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

int main(){

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

    int k;
    cin >> k;
    int a,b;
    cin >> a >> b;
    if( (a%k) == 0 || (b%k == 0)){
        cout << "OK\n";
    }
    else if(b/k - a/k > 0){
        cout << "OK\n";
    }
    else{
        cout << "NG\n";
    }
    

    return 0;
}

Measured memory_bytes: 3652
#include<cstdio>
#include<cstring>
int main()
{
	char str[20];
	scanf("%s",str);
	if(str[0] == 'Y' && str[1] == 'A' && str[2] == 'K' && str[3] == 'I')
		printf("Yes\n");
	else
		printf("No\n");
	
}

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

int main() {
	int xa, ya, xb, yb;
	cin >> xa >> ya >> xb >> yb;
	int s=xb-xa, t=yb-ya;
	printf("%d %d %d %d", xb-t, yb+s, xa-t, ya+s);
}


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

int main()
{
    long long l, r;
    cin >> l >> r;
    long long ans = l * (l + 1);
    for(long long x = l; x < r; ++x)
    {
        for(long long y = x + 1; y <= r; ++y)
        {
            ans = min(ans, x * y % 2019);
            if(x * y % 2019 == 0)
            {
                cout << 0 << endl;
                return 0;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <math.h>
#include <list>
#include <stack>
#include <queue>
#include <utility>

using namespace std;

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

bool compare_by_seond(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

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

    vector<pair<int,int> > pairs;
    int a,b;
    rep(i,n)
    {
        pair<int,int> mypair;
        cin >> a >> b;
        mypair = make_pair(a,b);
        pairs.push_back(mypair);
    }

    priority_queue<int> q;

    sort(pairs.begin(),pairs.end());


    ll sum = 0;
    int range;
    int index = 0;
    for (int i = 1; i < m+1; i++)
    {
        
        range = pairs.size();
        for (int j = index; j < range; j++)
        {
            if (pairs[j].first == i)
            {
                q.push(pairs[j].second);
            }else
            {
                index = j;
                break;
            }
            
        }
        
        if(q.empty()==false)
        {
            sum+=q.top();
            q.pop();
        }
        
    }

    cout << sum << endl;
    

    

    
}

Measured memory_bytes: 1908
from heapq import *
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
que=[]
heapify(que)
ans=0
heappush(que,-A[0])
for i in range(1,N):
    p=-heappop(que)
    ans+=p
    heappush(que,-A[i])
    heappush(que,-A[i])
print(ans)

Measured memory_bytes: 31552
let XKD: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
let (X, K, D) = (abs(XKD[0]), XKD[1], XKD[2])

let posiMaxNum: Int = X / D
if posiMaxNum > K {
    print(X - K*D)
} else {
    let posiMin: Int = X - D * posiMaxNum
    let negaMin: Int = posiMin - D
    if (K - posiMaxNum) % 2 == 0 {
        print(posiMin)
    } else {
        print(abs(negaMin))
    }
}

Measured memory_bytes: 8220
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+5;
const int mod=1e9+7;
inline int read()
{
	char c=getchar();int t=0,f=1;
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){t=(t<<3)+(t<<1)+c-'0';c=getchar();}
	return t*f;
}
int n;
char s[maxn],t[maxn],cnt;
int vis[30];
int ksm(int a,int b){
	int ans=1;
	while(b>0){
		if(b&1)ans=1ll*ans*a%mod;
		a=1ll*a*a%mod;b>>=1;
	}
	return ans;
}
int st[maxn];
int main()
{
	n=read();
	scanf("%s",s+1);
	int ans=0;
	int cnt=0;
	int inv2=ksm(2,mod-2);
	for(int i=1;i<=n;i++){
		vis[s[i]-'a'+1]++;
	}
	for(int i=1;i<=26;i++)
	if(vis[i]!=0)st[++cnt]=vis[i];
	int tmp=1,sum=0;
	for(int i=1;i<=cnt;i++){
		ans=(ans+1ll*ans*st[i]%mod+st[i])%mod;
	}
	printf("%d\n",ans%mod);
	return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <cmath>
#include <numeric>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <algorithm>
using namespace std;

using ll = long long;

#define FOR(i, m, n) for (ll i = m; i <= n; i++)
#define FORR(i, m, n) for (ll i = m; i >= n; i--)

int gcd(int a, int b) { if (a < b) { a ^= b; b ^= a; a ^= b; } return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }

#define M 1000000007

ll C(ll n, ll x) {
    if (x > n - x) x = n - x;
    ll p = 1;
    FOR (i, n - x + 1, n) p = (p * i) % M;
    ll q = 1;
    FOR (i, 2, x) q = (q * i) % M;
    ll r4 = 1, r9 = 1, r5 = 1;
    FOR (i, 1, 10000)  r4 = (r4 * q)  % M;
    FOR (i, 1, 100000) r9 = (r9 * r4) % M;
    FOR (i, 1, 5)      r5 = (r5 * q)  % M;
    ll r = (r9 * r5) % M;
    return (p * r) % M;
}

int main() {
    ll n, a, b;
    cin >> n >> a >> b;

    ll A = C(n, a);
    ll B = C(n, b);
    
    ll N10 = 1, N100 = 1, Nr = 1;
    FOR (i, 1, 100000) N10 = (N10 * 2) % M;
    FOR (i, 1, n / 100000) N100 = (N100 * N10) % M;
    FOR (i, 1, n % 100000) Nr = (Nr * 2) % M;
    ll N = (N100 * Nr) % M;

    ll ans = N;
    ans = (ans - A + M) % M;
    ans = (ans - B + M) % M;
    ans = (ans - 1 + M) % M;

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll MOD = 1e9+7;
void add(ll &a, ll b)
{
    a = (a + b) % MOD;
}
int main()
{
    ll n, m;
    cin >> n >> m;
    vector<ll> x(n);
    vector<ll> y(m);
    for(int i = 0; i < n; i++)
    {
        cin >> x[i];
    }
    for(int i = 0; i < m; i++)
    {
        cin >> y[i];
    }

    ll xsum = 0;
    ll ex = 0;
    for(int i = 1; i < n; i++)
    {
        ll cand = x[i] - x[i-1];
        add(ex, i * cand);
        add(xsum, ex);
    }
    ll ysum = 0;
    ll ey = 0;
    for(int i = 1; i < m; i++)
    {
        ll cand = y[i] - y[i-1];
        add(ey, i * cand);
        add(ysum, ey);
    }

    cout << xsum * ysum % MOD << endl;
}


Measured memory_bytes: 1792
#素因数分解
def prime_factor(n):#nは引数
    factors = []
    for i in range(2,int(n**0.5)+1):
        while n%i==0:
            factors.append(i)
            n = n//i
    if n!=1:
        factors.append(n)
    return factors #list化されたものを返すsetにすれば含まれる素数を列挙できる

N = int(input())
li = prime_factor(N)
tmp = list(set(li))
ans = 0

for i in tmp:
    count = 0
    p = n = 1
    while(li.count(i)>=p):
        count += 1
        n += 1
        p += n
    ans += count

print(ans)


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

#define rep(i,a,n) for (int i = a;i<=n;++i)
#define per(i,a,n) for (int i = n;i>=a;--i)
#define all(x) (x).begin(), (x).end()     
#define SZ(x) ((int)x.size())

typedef vector<int> VI;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef long double ld;

mt19937 mrand(random_device{}());
ll rnd(ll a, ll b) { return a + mrand() % (b - a + 1); }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

int main() {
      ios::sync_with_stdio(false); cin.tie(0);
#ifdef arrias
      freopen("a.txt", "r", stdin);
#endif
      int k;
      cin >> k;
      ll res = 0;
      rep(i, 1, k) {
            rep(j, 1, k) {
                  rep(c, 1, k) {
                        res += gcd(gcd(i, j), c);
                  }
            }
      }
      cout << res << "\n";
      return 0;
}

Measured memory_bytes: 3620
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int[] l = new int[n];

		for (int i = 0; i < n; i++) {
			l[i] = sc.nextInt();
		}

		Arrays.sort(l);

		int sum = 0;
		for (int i = 0; i < n - 1; i++) {
			sum += l[i];
		}

		if (l[n - 1] < sum) {
			System.out.print("Yes");
		} else {
			System.out.print("No");
		}
	}
}

Measured memory_bytes: 21844
package main

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

var sc = bufio.NewScanner(os.Stdin)

type Stack struct {
	number []int
}

func (s *Stack) push(num int) {
	s.number = append(s.number, num)
}

func (s *Stack) pop() int {
	poped := s.number[len(s.number)-1]
	s.number = s.number[0 : len(s.number)-1]
	return poped
}


func (s *Stack) calc(operand string) {
	first := s.pop()
	second := s.pop()
	if operand == "+" {
		s.push(first + second)
	} else if operand == "-" {
		s.push(second - first)
	} else {
		s.push(first * second)
	}
}

func main() {
	sc.Scan()
	line := sc.Text()
	lineSplit := strings.Split(line, " ")
	var empty []int
	stack := Stack{empty}
	for i := 0; i < len(lineSplit); i++ {
		if num, err := strconv.Atoi(lineSplit[i]); err == nil {
			stack.push(num)
		} else {
			stack.calc(lineSplit[i])
		}
	}
	fmt.Println(stack.number[0])
}



Measured memory_bytes: 1108
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int main(){
  int  A,B,C;
  cin >> A >> B >> C;
  
  if(A + B >= C) cout << "Yes" << endl;
  else cout << "No" << endl;
  
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

class LightList
{
private:
	const static int INVALID = -1;
	int front, back;
	int *allocate_array;

public:
	LightList(int size) : 
		front(0), back(0)
	{
		allocate_array = new int[size];
	}
	~LightList()
	{
		delete[] allocate_array;
	}
	void insert(int x)
	{
		allocate_array[front] = x;
		front++;
	}
	void remove(int x)
	{
		for (int i = front - 1; i >= back; i--) {
			if (allocate_array[i] == x) {
				allocate_array[i] = INVALID;
				if (i == front - 1)
					front--;
				if (i == back)
					back++;
				break;
			}
		}
	}
	void deleteFirst()
	{
		front--;
	}
	void deleteLast()
	{
		back++;
	}
	void print()
	{
		int i = front - 1;
		while (i >= back && allocate_array[i] == INVALID) i--;
		cout << allocate_array[i];
		i--;
		for (; i >= back; i--) {
			if (allocate_array[i] != INVALID)
				cout << ' ' << allocate_array[i];
		}
		cout << endl;
	}
};

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

	int n, size = 1000020;
	cin >> n;
	if (n < 1000020) size = n;
	LightList number_list(size);

	for (int i = 0; i < n; i++) {
		char command[12];
		int x;
		cin >> command;
		if (command[0] == 'i') { // insert x
			cin >> x;
			number_list.insert(x);
		}
		else { // delete???
			switch (command[6]) {
			case '\0': // delete x
				cin >> x;
				number_list.remove(x);
				break;
			case 'F': // deleteFirst
				number_list.deleteFirst();
				break;
			case 'L': // deleteLast
				number_list.deleteLast();
				break;
			}
		}
	}
	number_list.print();
	return 0;
}

Measured memory_bytes: 6812
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <cstdarg>
#include <sys/time.h>
#include <fstream>
//#include "cout.h"

using namespace std;

#define SZ(x) ((int)x.size())
#define MSET(x,a) memset(x, a, (int)sizeof(x))
#define PB push_back
#define VI vector < int >
#define PII pair < int, int >
#define LL long long
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define FIT(it,v) for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OUT(A) cout << #A << " = "<< (A) << endl
#define OUT2(A, B) cout << "(" << #A << ", " << #B << ") = (" << (A) << ", "<< (B) << ")" << endl
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }

#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(ALL(c), (e)) != (c).end())


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

void init() {

}

void input() {

}

LL a[100010];

void solve() {
  int n;
  cin >> n;
  REP(i, n) cin >> a[i];
  LL p = a[0];
  FOR(i, 1, n) p = gcd(p, a[i]);
  cout << p << endl;
}

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


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

int main(){

  int H, W;
  cin >> H >> W;
  char a[H+2][W+2];
  for(int i=1; i<H+1; i++){
    for(int j=1; j<W+1; j++){
      cin >> a[i][j];
    }
  }
  for(int i=0; i<H+2; i++){
    for(int j=0; j<W+2; j++){
      if(i==0 || j==0 || i==H+1 || j==W+1){
        cout << "#" << flush;
      }else{
        cout << a[i][j] << flush;
      }
    }
    cout << endl;
  }

  return 0;
}


Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)

	n := nextInt()

	if n > 81 {

		fmt.Println("No")
		return
	}

	// 表作成
	m := map[int]int{}
	for i := 1; i < 10; i++ {
		for j := 1; j < 10; j++ {
			m[i*j] = i * j
		}
	}

	_, ok := m[n]
	if ok == true {
		fmt.Println("Yes")
		return
	}
	fmt.Println("No")
}

// ---- readfunc
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 1788
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <cfloat>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>

using namespace std;

typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define EACH( v, c ) for ( auto &v : c )

#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

typedef vector<double> VD;
typedef vector< VD > VVD;
typedef vector< VVD > VVVD;

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

	cout.precision( 4 );
	cout << fixed;

	while ( true )
	{
		int n;
		cin >> n;

		if ( !n )
		{
			break;
		}

		VVD dp( n + 1, VD( 11, 0. ) );
		dp[0][0] = 1;

		double res = 0;

		REP( i, 0, dp.size() - 1 )
		{
			REP( j, 0, dp[i].size() - 1 )
			{
				double p = 1 / pow( 2, j );

				res += dp[i][j] * p;

				dp[ i + 1 ][ j + 1 ] += dp[i][j] * p;
				dp[ i + 1 ][0] += dp[i][j] * ( 1 - p );
			}
		}

		cout << res << endl;
	}

	return 0;
}

Measured memory_bytes: 13008
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int MOD = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%MOD+MOD)%MOD){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += MOD-a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= MOD; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime MOD
  mint inv() const { return pow(MOD-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
// combination MOD prime
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < MOD);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
  mint p(int n, int k) {
    return fact[n]*ifact[n-k];
  }
};
// comb(5, 2) → 10, comb.p(5, 2) → 20, comb.fact[4] → 24

int N;

mint power(int x) {
  // 2のx乗をmintで返す
  if (x == 0) return 1;
  mint res = power(x / 2);
  res *= res;
  if (x&1) res *= 2;
  return res;
}

mint choose(int x) {
  // nCxをmintで返す
  mint res = 1;
  rep(i, x) {
    res *= (N-i);
    res /= (x-i);
  }
  return res;
}
int main() {
  int A, B;
  cin >> N >> A >> B;
  mint ans = power(N);
  ans -= (choose(A) + choose(B) + 1);
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pp pop_back
#define in insert
#define ff first
#define ss second
#define e endl
#define MAXN 200005
#define MOD 998244353
int main()
{
     set<string> s;
     string st;
     int n;
     cin>>n;
     for(int i=0;i<n;i++)
          {cin>>st;
     s.in(st);}
     cout<<s.size();

}


Measured memory_bytes: 19204
import math

def yogen(a, b, angle):
    return math.sqrt(a*a+b*b-2.0*a*b*math.cos(math.pi * angle/180.0))

d = [float(i) for i in input().split()]

h_angle = 360.0/12.0 * d[2] + 360.0/12.0/60.0*d[3]
m_angle = 360.0/60.0 * d[3]
diff_angle = min(math.fabs(h_angle-m_angle), 360.0-math.fabs(h_angle-m_angle))

print(yogen(d[0], d[1], diff_angle))


Measured memory_bytes: 9448
package main

import "fmt"

func main() {

	pTaro := 0
	pHanako := 0
	var n int
	fmt.Scan(&n)

	for i:=0; i<n; i++ {
		var cTaro, cHanako string
		fmt.Scan(&cTaro, &cHanako)
		if cTaro > cHanako {
			pTaro += 3
		} else if cTaro < cHanako {
			pHanako += 3
		} else {
			pTaro += 1
			pHanako += 1
		}
	}
	fmt.Println(pTaro, pHanako)
}


Measured memory_bytes: 1208
from math import *

def cin(): # To take limited number of inputs
    return map(int,input().split())

def cins(): # To take space sepreated strings
    return input.split()

def cino(test=False): # To take individual int input (test = False)
    if not test:
        return int(input())
    else: # To take string input (test = True)
        return input()

def cina(): # array input
  return list(map(int,input().split()))

def ssplit(): # multiple string input
    return list(input().split())

def printlist(l): # To print space seperated array
    for i in l:
        print(i,end=" ")

def main():
   n = int(input())
   print((2*(n//11)) + (n%11>0 and n%11<=6) + 2*(n%11>6))



if __name__ == '__main__':
    main()


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

const long long MOD = 1000000007LL;
const long long INF = 1e18;

int GCD(int a, int b){return b == 0 ? a : GCD(b, a % b);}
long long fast_exp(long long base, long long exp, long long mod = MOD) {
    long long tot = 1;
    for(;exp > 0;exp >>= 1) {
       if((exp & 1) == 1) tot = tot * base % mod;
       base = base * base % mod;
    }
    return tot;
}
long long mult_mod(long long base, long long exp, long long mod = MOD) {
    long long tot = 0;
    for(;exp > 0;exp >>= 1){
       if((exp & 1) == 1) tot = (tot + base) % mod;
       base = base * 2 % mod;
    }
    return tot;
}

struct chash {
    static uint64_t splitmix64(uint64_t x) {x += 0x8e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf54876d1ce4e5b9; x = (x ^ (x >> 27)) * 0x94d049bb133111eb; return x ^ (x >> 31);}
    size_t operator()(uint64_t x) const { static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count(); return splitmix64(x + FIXED_RANDOM);}
    size_t operator()(pair<uint64_t,uint64_t> x) const { static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count(); return splitmix64(x.first + FIXED_RANDOM)^(splitmix64(x.second + FIXED_RANDOM) >> 1);}
};

int main(){

    cin.sync_with_stdio(0); cin.tie(0); cout.tie(0);

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int a, b, c, d, e, k; cin >> a >> b >> c >> d >> e >> k;

    if(e - a > k)
      cout <<" :(";
    else
      cout << "Yay!";

    return 0;
}


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

using namespace std;

using ll = long long;

int main() {
    ll N, X;
    cin >> N >> X;


    std::vector<ll> x(N);
    cin >> x[0];
    x[0] = std::abs(x[0] - X);

    ll ans = x[0];

    for (ll i = 1; i < N; ++i) {
        cin >> x[i];
        x[i] = std::abs(x[i] - X);
        ans = std::__gcd(ans, x[i]);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1024
#pragma GCC optimize("Ofast", "unroll-loops")

#include <bits/stdc++.h>

using namespace std;

struct graph {
	struct edge {
		int a, b;
		bool isDirected = true; // 向きが決定されたか
		bool dir = true; // trueならa -> b
	};

	int n, m;
	vector<edge> e;
	vector<vector<edge*>> g;
	vector<int> cnt;

	graph(int n, int m) {
		this->n = n; this->m = m;
		g.resize(n); e.resize(m);
		cnt.resize(n, 0);
		for (int i = 0; i < m; ++i) {
			int ai, bi; scanf("%d %d", &ai, &bi);
			--ai, --bi;
			e[i].a = ai; e[i].b = bi;
			e[i].isDirected = true; e[i].dir = true;
			g[ai].push_back(&e[i]);
			g[bi].push_back(&e[i]);
		}
	}

	// 0を根とする根付き木の辺の向きを不定にする
	void dfs(int s = 0) {
		static vector<bool> visited(n, false);
		visited[s] = true;
		for (edge* ed : g[s]) {
			int nx = (*ed).a == s ? (*ed).b : (*ed).a;
			if (!visited[nx]) {
				(*ed).isDirected = false;
				dfs(nx);
			}
		}
	}

	// 各頂点について、何本辺が(今のところ)出ているか調べる
	void count() {
		for (edge ei : e) {
			if (ei.isDirected) {
				if (ei.dir) ++cnt[ei.a];
				else ++cnt[ei.b];
			}
		}
	}

	// 根付き木の辺の向きを決定していく
	void solve(int s = 0) {
		static vector<bool> visited(n, false);
		visited[s] = true;
		for (edge* ed : g[s]) {
			int nx = (*ed).a == s ? (*ed).b : (*ed).a;
			if ((!(*ed).isDirected) && (!visited[nx])) solve(nx);
		}
		for (edge* ed : g[s]) {
			if ((*ed).isDirected) continue;
			if (cnt[s] & 1) { // 自分から生やす
				if ((*ed).a != s) (*ed).dir = false;
				++cnt[s];
			}
			else { // 自分に向ける
				if ((*ed).a == s) (*ed).dir = false;
				++cnt[(*ed).b != s ? (*ed).b : (*ed).a];
			}
			(*ed).isDirected = true;
		}
	}

	// 出力する
	void show() {
		for (auto ed : e) {
			if (ed.dir)
				cout << (ed.a + 1) << " " << (ed.b + 1) << endl;
			else
				cout << (ed.b + 1) << " " << (ed.a + 1) << endl;
		}
	}
};

int main() {
	int n, m; scanf("%d %d", &n, &m);
	if (m & 1) { // mが奇数の時は不可
		cout << -1 << endl;
	}
	else { // mが偶数の時は構築可
		graph g(n, m);
		g.dfs();
		g.count();
		g.solve();
		g.show();
	}
	return 0;
}


Measured memory_bytes: 13696
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(void){
  string m[1010];
  int n,ans,dp[1010][1010];
  while(cin >> n,n){
    for(int i=0;i<n;i++) cin >> m[i];
    ans=0;
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
	if(m[i][j]=='.') dp[i][j]=1;
	else dp[i][j]=0;
      }
    }
    for(int i=1;i<n;i++){
      for(int j=1;j<n;j++){
        if(m[i][j]=='.'){
	  dp[i][j]=min(dp[i-1][j],min(dp[i][j-1],dp[i-1][j-1]))+1;
	  ans=max(ans,dp[i][j]);
	}
      }
    }
    cout << ans << endl;
  }
}


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

int main() {
  int k;
  string s;
  cin >> k >> k >> s;
  if (s.at(k-1) == 'A') s.at(k-1) = 'a';
  if (s.at(k-1) == 'B') s.at(k-1) = 'b';
  if (s.at(k-1) == 'C') s.at(k-1) = 'c';
  cout << s << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define Fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Freed freopen ("0in.txt","r",stdin);
#define Fout freopen ("0out.txt","w",stdout);
#define pi acos(-1.0)
#define ll long long
#define pb push_back
#define Mod 1000000007
#define limit 1000008
using namespace std;

void solve(int t)
{
    int a,k,i,j,n,sum=1,mx=0,ind,ct=1;
    cin >> n >> k;
    int D[n+5];
    for(i=0; i<n; i++)
        cin >> D[i];
    for(i=k ; i<n; i++)
    {
        if(D[i]>D[i-k])
            cout <<"Yes\n";
        else
            cout <<"No\n";
    }
}
int  main()
{
//    Fast
//    Freed
//    Fout
    int t,tt=1;
 //   cin >> tt;
    for(t=1; t<=tt; t++)
        solve(t);
  return 0;
}




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

typedef long long ll;

int main()
{
    int h,w,n,i;
    cin >> h >> w >> n;
    vector<int> a(n);
    for(i = 0;i < n;++i){
        cin >> a.at(i);
    }
    vector<vector<int>> c(h,vector<int>(w));
    int j = 0,k = 0,l;
    for(i = 0;i < n;++i){
        for(l = 0;l < a.at(i);++l){
            c.at(j).at(k) = i+1;
            if(j%2 == 0){
                ++k;
            }else{
                --k;
            }
            if(j%2 == 0 && k == w){
                --k;
                ++j;
            }
            if(j%2 == 1 && k== -1){
                ++k;
                ++j;
            }
        }
    }
    for(i = 0;i < h;++i){
        for(j = 0;j < w;++j){
            cout << c.at(i).at(j) << " ";
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 384
N, M, X = map(int, input().split())
book = []
cost = []
for i in range(N):
    c, *a, = list(map(int, input().split()))
    book.append(a)
    cost.append(c)
ans = float('inf')
for bit in range(1 << N):
    know = [0] * M
    costbit = 0
    flag = True
    for i in range(N):
        if bit & (1 << i):
            for j in range(M):
                know[j] += book[i][j]
            costbit += cost[i]
    for l in range(M):
        if know[l] < X:
            flag = False
    if flag:
        ans = min(ans, costbit)
if ans <= 1000000000:
    print(ans)
else:
    print(-1)

Measured memory_bytes: 73856
c = [list(map(int, input().split())) for i in range(3)]

for i in range(2):
    dist = c[i+1][0] - c[i][0]
    if c[i+1][1] - c[i][1] == dist and c[i+1][2] - c[i][2] == dist:
        continue
    else:
        print('No')
        exit()

for i in range(2):
    dist = c[0][i+1] - c[0][i]
    if c[1][i+1] - c[1][i] == dist and c[2][i+1] - c[2][i] == dist:
        continue
    else:
        print('No')
        exit()

print('Yes')


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

#define newline '\n'
#define IOS ios_base::sync_with_stdio(false); cin.tie(0)
using ll = long long;
using ull = unsigned long long;

int main() {
    IOS;

    int n;
    cin >> n;

    int m = n % 10;
    if (m == 3) {
        cout << "bon" << newline;
    } else if (m == 0 || m == 1 || m == 6 || m == 8) {
        cout << "pon\n";
    } else {
        cout << "hon\n";
    }

    return 0;
}

Measured memory_bytes: 3620
#include<iostream>
#include<cmath>

using namespace std;
int main(){
  long long n, w;
  cin>>n>>w;
  long long int peso[n], valor[n];

  for(long long i=0;i<n;i++){
    cin>>peso[i]>>valor[i];
  }
  long long int matriz[n+1][w+1];
  for(long long i=0;i<=n;i++){
    matriz[i][0]=0;
  }
  for(long long i=0;i<=w;i++){
    matriz[0][i]=0;
  }
  for(long long i=1;i<=n;i++){
    for(long long j=1; j<=w;j++){
      if(peso[i-1]<=j){
        matriz[i][j]= max(valor[i-1]+ matriz[i-1][j-peso[i-1]], matriz[i-1][j]);
      }
      else{
        matriz[i][j]=matriz[i-1][j];
      }
    }
  }
  cout<<matriz[n][w]<<endl;
}

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

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
// cout << fixed << setprecision(10);

int main() {
    int N;
    cin >> N;
    int res = N % 1000;
    if (res > 0) {
        cout << 1000 - res << endl;
    }
    else {
        cout << res << endl;
    }
}


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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int s, w;
    cin >> s >> w;
    if (w >= s) 
	    cout << "unsafe" << endl;
    else
	    cout << "safe" << endl;
    return 0;
}

Measured memory_bytes: 3660