akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
#define erep(i,n) for(int i = 0;i<=n;i++)
#define rep1(i,n) for(int i = 1;i<n;i++)
#define erep1(i,n) for(int i = 1;i<=n;i++)
typedef long long ll;
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstring vector<string>
#define vdouble vector<double>
#define vll vector<ll>:
#define vbool vector<bool>
#define INF 1101010101010101010
#define MOD 1000000007
#define int long long
using P = pair<int,int>;

signed main(){
  int n;
  cin >> n;
  vint L(n);
  rep(i,n) cin >> L[i];
  sort(L.begin(),L.end());
  int ans = 0;
  for(int i = 0;i < n-2;i++){
    for(int j = 2;j < n;j++){
      for(int s = i+1;s < j;s++){
        if(L[j]-L[i] < L[s] && L[s] < L[j]+L[i]){
          ans++;
        }
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const unsigned int MOD = 1000000007;
#define ll long long
#define PI 3.1416
string day[]={"SUN","MON","TUE","WED","THU","FRI","SAT"};
int main() {
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int a;
    while(cin>>a){
        cout<<3*a*a<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <numeric>
#include <regex>
#include <tuple>
#include<iomanip>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007 // 10^9 + 7
#define INF 1000000000 // 10^9
#define LLINF 1LL<<60

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

	int N, K; cin >> N >> K;
	string S; cin >> S;
	int cnt = 0;
	for (int i = 0; i < N - 1; i++) if (S[i] != S[i + 1])cnt++;

	cout << N - 1 - max(0, (cnt - 2 * K)) << endl;

	return 0;
}

Measured memory_bytes: 512
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
//#include <unordered_map>
//#include <unordered_set>
#include <vector>

#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")

using namespace std;

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

//typedef tuple<int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <db, db> pdd;

int in[205];
int main() {
	int N, i;
	scanf("%d", &N);
	for (i = 1; i <= 2 * N; i++) scanf("%d", &in[i]);
	sort(in + 1, in + 2 * N + 1);

	int ans = 0;
	for (i = 1; i <= 2 * N; i += 2) ans += in[i];
	return !printf("%d\n", ans);
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    long long n;
    cin>>n;
    int flag = 0;
    while(n > 0) {
        if(n%10 == 7) {
            flag = 1;
            break;
        }
         n = n/10;
    }
    if(flag == 0) {
        cout<<"No";
    }
    else {
        cout<<"Yes";
    }
}


Measured memory_bytes: 3624
package main

import "fmt"

func main() {
	var a, b, n int
	fmt.Scan(&a, &b, &n)

	x := min(n, b-1)
	v := f(a, b, x)
	fmt.Println(v)
}

func f(a, b, x int) int {
	return (a * x / b) - a*(x/b)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}


Measured memory_bytes: 1752
// B.cpp
#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 2e5 + 200;

int n, suf[MAX_N];
char S[MAX_N];

int main()
{
	scanf("%s", S + 1), n = strlen(S + 1);
	long long ans = 0;
	for (int i = n - 1; i >= 1; i--)
	{
		if (i <= n - 2 && S[i] == 'A' && S[i + 1] == 'B' && S[i + 2] == 'C')
			suf[i] = suf[i + 3] + 1, ans += suf[i];
		else if (S[i] == 'B' && S[i + 1] == 'C')
			suf[i] = suf[i + 2] + 1;
		else if (S[i] == 'A')
			suf[i] = suf[i + 1], ans += suf[i];
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 4752
#include <bits/stdc++.h>
#define FIN         ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ii          pair<int,int>
#define F           first
#define S           second
#define pb          push_back
#define all(x)      (x).begin(),(x).end()
#define rall(x)     (x).rbegin(),(x).rend()
#define fore(i,a,b) for(int i = a;i < b; i+= 1)
#define forr(i,a)   for(int i = a; i >= 0; i--)
#define fori(i,m)   for(auto i = m.begin(); i != m.end(); i++) 
#define w(t)        while(t--)
#define sz(s)       int(s.size())
#define cls(a,car)  memset(a,car,sizeof (a))
#define db(x)       cerr << #x << " is " << x << '\n'
#define FL          freopen("input.txt", "r", stdin),freopen("output.txt", "w", stdout);
#define EjecuteTime cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"
#define angle(x)    double(x * acos(-1) / 180.0)
using namespace std;
typedef long long   ll;
typedef vector<int> vi;
typedef vector<ii>  vii;
const int N = 1 * 1e5 + 5;
const ll mod = 1e9 + 7;
const double EPS = 1e-9;
int dx[] = {1, 0}, dy[] = {0, 1};
//int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
//int dx[] = {2, 1, -1, -2, -2, -1, 1, 2}, dy[] = {1, 2, 2, 1, -1, -2, -2, -1};
//int dx[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy[] = {0 ,1, 1, 1, 0, -1, -1, -1};
// fflush(stdout)
// cout << flush
// a + b = a ^ b + 2 * (a & b)
int sumMod(int a, int b){return 0LL + a + b > mod ? a + b - mod : a + b;}
int n;
double v[3010];
double dp[3010][3010];
double f(int i, int tail){
    if(i == n){
        return 1;
    }
    double &ans = dp[i][tail];
    if(ans < 0){
        ans = 0;
        int head = n - tail;
        if(head > tail + 1)
            ans += f(i + 1, tail + 1) * (1.0 - v[i]);
    
        ans += f(i + 1, tail) * v[i];
    }
    return ans;
}
int main(){
    //FL;
    FIN;
    cin >> n;
    for(int i = 0; i < n; i++)
        cin >> v[i];
    for(int i = n; i >= 0; i--){
        for(int tail = 0; tail < n; tail++){
            double &ans = dp[i][tail];    
            if(i == n){
                ans = 1;
                continue;
            }
            ans = 0;
            ans += dp[i + 1][tail] * v[i];
            int head = n - tail;
            if(head > tail + 1)
                ans += dp[i + 1][tail + 1] * (1.0 - v[i]);
        }
    }
    
    cout << fixed << setprecision(9) << dp[0][0] << '\n';
    EjecuteTime;
    return 0;
}       

Measured memory_bytes: 74372
#include<string>
#include<sstream>
#include<stdio.h>
#include<iostream>
#include<iomanip>
#include<ios>
#include<algorithm>
#include<stack>
#include<queue>
#include<cmath>
#include<type_traits>
#include<random>
#include<vector>
#include<map>

using namespace std;

int main()
{
	int A,B,K;
	cin >> A >> B >> K;
	vector<int> v;
	for(int i=1;i<=max(A,B);i++)
	{
		if(A%i==0 && B%i==0)
		{
			v.push_back(i);
		}
	}
	cout << v[v.size()-K] << endl;
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int water1Weight = sc.nextInt();
		final int water2Weight = sc.nextInt();
		final int sugar1Weight = sc.nextInt();
		final int sugar2Weight = sc.nextInt();
		final int sugarLimit = sc.nextInt();
		final int beakerLimit = sc.nextInt();

		int waterTotal = 0;
		int sugarTotal = 0;
		int tempSugarLimit = 0;

		double maxConcentration = 0;
		int maxWaterTotal = 0;
		int maxSugarTotal = 0;

		for (int water1Count = 0;
			 water1Count * 100 * water1Weight <= beakerLimit;
			 water1Count++) {

			for (int water2Count = 0;
				 water1Count * 100 * water1Weight + water2Count * 100 * water2Weight <= beakerLimit;
				 water2Count++) {

				waterTotal = water1Count * 100 * water1Weight + water2Count * 100 * water2Weight;
				tempSugarLimit = (water1Count * water1Weight + water2Count * water2Weight) * sugarLimit;

				for (int sugar1Count = 0;
					 sugar1Count * sugar1Weight + waterTotal <= beakerLimit && sugar1Count * sugar1Weight <= tempSugarLimit;
					 sugar1Count++) {

					for (int sugar2Count = 0;
						 sugar1Count * sugar1Weight + sugar2Count * sugar2Weight + waterTotal <= beakerLimit && sugar1Count * sugar1Weight + sugar2Count * sugar2Weight <= tempSugarLimit;
						 sugar2Count++) {

						sugarTotal = sugar1Count * sugar1Weight + sugar2Count * sugar2Weight;
						double concentration = (double)sugarTotal / (waterTotal + sugarTotal);
						if (concentration > maxConcentration) {
							maxConcentration = concentration;
							maxWaterTotal = waterTotal;
							maxSugarTotal = sugarTotal;
						}
					}
				}
			}
		}
		if (maxSugarTotal == 0) {
			System.out.println(water1Weight * 100 + " " + maxSugarTotal);
		} else {
			System.out.println((maxWaterTotal + maxSugarTotal) + " " + maxSugarTotal);
		}
	}

}


Measured memory_bytes: 21972
public class Main {
public static void main(String[] args){
	
	String[] input = new java.util.Scanner ( System.in ). nextLine().split(" ");
	int w = Integer.parseInt(input[0]);
	int h = Integer.parseInt(input[1]);
	int x = Integer.parseInt(input[2]);
	int y = Integer.parseInt(input[3]);
	int r = Integer.parseInt(input[4]);
	
	if (x > 0 && y > 0)
	{
		if ((x + r <= w) && (x >= r))
		{
			if ((y + r <= h) && (y >= r))
				System.out.println("Yes");
			else
				System.out.println("No");
		}
		else
			System.out.println("No");
	}
	else
		System.out.println("No");


}
}

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

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORTASC(c) sort((c).begin(),(c).end())
#define SORTDESC(c,t) sort((c).begin(),(c).end(), std::greater<t>());
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define VMAX(a) *max_element(ALL(a))
#define VMIN(a) *min_element(ALL(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double PI  = acos(-1.0);

using ll = long long;
using namespace std;

bool compare_second(pair<ll, ll> a, pair<ll, ll> b){
    return a.second > b.second;
}

int main() {
    ll n;

    cin >> n;

    string cities[n];
    ll points[n];
    set<string> order;

    REP(i, n){
        cin >> cities[i] >> points[i];
        order.insert(cities[i]);
    }

    for(auto c : order){
        vector<pair<ll, ll>> v;
        REP(i, n){
            if (cities[i] == c){
                v.PB(make_pair(i, points[i]));
            }
        }
        sort(ALL(v), compare_second);
        REP(i, v.size()){
            cout << v[i].first+1 << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 256
use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn input_tuple() -> (u64, u64) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<u64> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1])
}

fn main() {
    let n: usize = input();
    let mut a_vec: Vec<u64> = Vec::new();
    let mut b_vec : Vec<u64> = Vec::new();
    for _ in 0..n {
        let (a, b) = input_tuple();
        a_vec.push(a);
        b_vec.push(b);
    }
    a_vec.sort();
    b_vec.sort();
    // println!("{:?}", a_vec);
    // println!("{:?}", b_vec);
    if n % 2 == 1 {
        // println!("{}", a_vec[n / 2]);
        // println!("{}", b_vec[n / 2]);
        println!("{}", b_vec[n/2] - a_vec[n/2] + 1);
    } else {
        let low_lim_0 = a_vec[n / 2 - 1];
        let up_lim_0 = b_vec[n / 2 - 1];
        let low_lim_1 = a_vec[n - n / 2];
        let up_lim_1 = b_vec[n - n / 2];
        // if up_lim_0 <= low_lim_1 {
            println!("{}", up_lim_1 + up_lim_0 - (low_lim_1 + low_lim_0) + 1);
        // } else {

        // }
    }
}


Measured memory_bytes: 5824
#include<iostream>
using namespace std;
 
int main(){
  int n,i,j,v,A[1001];
  // 値の入力
  cin >> n;
  for(i = 0; i < n; i++){
    cin >> A[i];
  }
  for(i = 1; i < n; i++){
    for(int k = 0; k < n; k++){
      //途中結果の出力
      if(k == n-1)cout << A[k];
      else cout << A[k] << " ";
    }
    cout << endl;
    v = A[i]; // 挿入する値
    j = i - 1; // 一つ前の値
    while(j >=0 && A[j] > v){
      A[j+1] = A[j]; // 値をずらす
      j--; // デクリメント
      A[j+1] = v; // 値を挿入
     
    }
  }
  //結果の出力
    for(int k = 0; k < n; k++){
      if(k == n-1)cout << A[k];
      else cout << A[k] << " ";
    }
    cout << endl;
  return 0;
}

Measured memory_bytes: 1164
#include<stdio.h>
#include<algorithm>
using namespace std; 
long long a,b;
int main(){
	while(scanf("%lld%lld",&a,&b)!=EOF){
		if(abs(a-b)<=1)
			printf("Brown\n");
		else
			printf("Alice\n");
	}
	return 0;
}

Measured memory_bytes: 256
class PriorityQueue
    def initialize
        @queue = []
        @size = 0
    end

    def push(element)
        @size += 1
        last_index = @size - 1
        @queue[last_index] = element
        up_heap(last_index)
    end

    def pop
        return if @size == 0
        max = @queue[0]
        last_index = @size - 1
        @queue[0] = @queue[last_index]
        @queue[last_index] = nil
        @size -= 1
        down_heap(0)
        max
    end

    def sum
        @queue.take(@size).inject(:+)
    end

    def print
        p @queue
    end

    private

    def up_heap(index)
        return if index == 0

        parent_index = (index - 1) / 2
        if @queue[parent_index] < @queue[index]
            swap(index, parent_index)
            up_heap(parent_index)
        end
    end

    def down_heap(index)
        return if is_leaf(index)

        target_index = if l_leaf(index).nil?
            r_leaf_index(index)
        elsif r_leaf(index).nil?
            l_leaf_index(index)
        else
            l_leaf(index) > r_leaf(index) ? l_leaf_index(index) : r_leaf_index(index)
        end

        if @queue[target_index] > @queue[index]
            swap(target_index, index)
            down_heap(target_index)
        end
    end

    def is_leaf(index)
        l_leaf(index).nil? && r_leaf(index).nil?
    end

    def l_leaf_index(index)
        2 * index + 1
    end

    def r_leaf_index(index)
        2 * (index + 1)
    end

    def l_leaf(index)
        @queue[l_leaf_index(index)]
    end

    def r_leaf(index)
        @queue[r_leaf_index(index)]
    end

    def swap(index_a, index_b)
        tmp = @queue[index_a]
        @queue[index_a] = @queue[index_b]
        @queue[index_b] = tmp
    end
end

q = PriorityQueue.new

n, m = gets.chomp.split.map(&:to_i)
gets.chomp.split.map(&:to_i).each do |a|
    q.push(a)
end

m.times do |t|
    max = q.pop
    q.push(max / 2)
end

puts q.sum


Measured memory_bytes: 12404
N,T = map(int, input().split())
abl = []
for _ in range(N):
    a,b = map(int, input().split())
    abl.append((a,b))

abl.sort()
dp = [ [0]*6001 for _ in range(N+1) ]

for i in range(N):
    a,b = abl[i]
    for t in range(6001):
        dp[i+1][t] = max(dp[i+1][t], dp[i][t])
        if t < T: dp[i+1][t+a] = max(dp[i][t]+b, dp[i][t+a])


ans = max(dp[N])
print(ans)

Measured memory_bytes: 211484
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;

#define ll long long
using vt = int; //ここで数値の型を変えられる
#define rep(i, n) for (vt i = 0; i < (vt)(n); i++)
#define reps(i, s, n) for(vt i = (vt) (s); i < (vt) (n); i++) 
#define MOD 1000000007

int main() {
	int n, ans = 1;
	cin >> n;
	vector<int> vec(n + 1, 0);
	rep(i, n) cin >> vec.at(i);
	if (n == 1) {
		if (vec.at(0) == 1) {
			cout << 0;
		}
		else {
			cout << -1;
		}
		return 0;
	}
	auto k = find(vec.begin(), vec.end(), 1);
	if (k == vec.end()) {
		cout << -1;
		return 0;
	}
	auto b = vec.begin();
	reps(i, 1, n) {
		auto a = find(b, vec.end(), i);
		b = find(a, vec.end(), i + 1);
		if (a < b && *a < *b) {
			ans++;
		}
		else break;
	}
	cout << n - ans;
	return 0;
}

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
int gcd(int a,int b)
{
    if(a==0)return b;
    return gcd(b%a,a);
}
int lcm(int x,int y)
{
    return (x*1ll*y/gcd(x,y));
}
int32_t main()
{
	IOS;
    int a,b;
    cin>>a>>b;
    int t;
    for(int i=1;i<4;i++)
    {
        if(a==i)
        continue;
        else if(b==i)
        continue;
        else
        t=i;
        
    }
    cout<<t<<endl;

	return 0;
}

Measured memory_bytes: 256
function main(input) {
   input = input.trim();
  const a = input.split(" ").map(Number);

  console.log(Math.min((a[0]+a[1]),Math.min((a[1]+a[2]),(a[0]+a[2]))));
  
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 29532
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		double[] firstLine = {35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0};
		double[] secondLine = {71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0};
		int[] rank;
		double time;
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()) {
			rank = new int[3];
			time = sc.nextDouble();
			for(int i=7; i>=1; i--) {
				if(time >= firstLine[i-1]) {
					rank[0] = i;
					break;
				}
			}
			time = sc.nextDouble();
			for(int i=7; i>=1; i--) {
				if(time >= secondLine[i-1]) {
					rank[1] = i;
					break;
				}
			}
			
			rank[2] = Math.max(rank[0],rank[1]);
			switch(rank[2]) {
			case 0:
				System.out.println("AAA");
				break;
			case 1:
				System.out.println("AA");
				break;
			case 2:
				System.out.println("A");
				break;
			case 3:
				System.out.println("B");
				break;
			case 4:
				System.out.println("C");
				break;
			case 5:
				System.out.println("D");
				break;
			case 6:
				System.out.println("E");
				break;
			case 7:
				System.out.println("NA");
				break;
			}
		}
		
	}
}

Measured memory_bytes: 20568
#include <bits/stdc++.h>
#define MOD 1000000007 
#define MOD1 998244353
#define ll long long int
#define db double
#define endl "\n"
#define INF 1000000000000000000
#define INF1 1000000000
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define mp make_pair
#define debx cout<<" X "<<endl;
#define deby cout<<" Y "<<endl;
#define debz cout<<" Z "<<endl;
#define deb(x) cout << '>' << #x << ':' << x << endl;
using namespace std;
 
ll mpow(ll a, ll b){
    if(!b)
        return 1;
    ll temp=mpow(a,b/2);
    temp=(temp*temp)%MOD;
    if(b%2)
        return (a*temp)%MOD;
    return temp;
}
ll mod_in(ll n){
    return mpow(n,MOD-2);
}
ll cl(ll a, ll b){
    if(a%b)
        return 1+a/b;
    return a/b;
}
ll dig(ll n){
    if(!n)
        return 0;
    return 1 + dig(n/10);
}
int main(){
    // fastio
    ll n;
    cin>>n;
    ll i, a[n+5], ct = 0;
    for(i=0 ; i<n ; i++)
        cin>>a[i];
    ll prev = 0;
    for(i=0 ; i<n ; i++){
        if(a[i]==1+prev){
            prev++;
        }
        else{
            ct++;
        }
    }
    if(prev==0)
        ct = -1;
    cout<<ct<<endl;
}
    

Measured memory_bytes: 1920
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll n;
    cin>>n;
    ll dp[3][n];
    ll a,b,c;
    cin>>a>>b>>c;
    dp[0][0]=a;
    dp[1][0]=b;
    dp[2][0]=c;
    for(ll i=1;i<n;++i)
    {
        cin>>a>>b>>c;
        dp[0][i]=max(dp[1][i-1],dp[2][i-1])+a;
        dp[1][i]=max(dp[0][i-1],dp[2][i-1])+b;
        dp[2][i]=max(dp[1][i-1],dp[0][i-1])+c;
    }
    cout<<max(dp[0][n-1],max(dp[1][n-1],dp[2][n-1]));
}


Measured memory_bytes: 5976
unittest
{
	assert( [ "apple" ].solve == "apples" );
	assert( [ "bus" ].solve == "buses" );
	assert( [ "box" ].solve == "boxs" );
}



import std.conv;
import std.range;
import std.stdio;

void main()
{
	stdin.byLineCopy.solve.writeln;
}

auto solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto s = input.front;
	
	return s ~ ( ( s.back == 's' ) ? "es" : "s" );
}


Measured memory_bytes: 2644
#ifdef __unix__
#include <bits/stdc++.h>
#else
#include <iostream>
#include <algorithm>
#include <math.h>
#include <functional>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <unordered_set>
#include <stack>
#endif


#define fastIO ios_base::sync_with_stdio(0), cin.tie(NULL)
#define pb push_back
#define all(x) x.begin(), x.end()
#define endl '\n'
#define mkp make_pair
/*#define NUMTOSTR(x)  (unsigned char)((x) + 48);*/
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long  ull;
using namespace std;
int main(){
	int n;
	cin >> n;
	for (int i = 1; i <= 9; i++)
	{
		for (int j = 1; j <= 9; j++) {
			if (i * j == n) {
				cout << "Yes";
				return 0;
			}
		}
	}
	cout << "No";
	return 0;
}


Measured memory_bytes: 3552
s = gets.chomp!
if s[6] == "4" || s[6] == "3"
  puts "Heisei"
elsif  s[6] == "2"  || s[6] == "1"
  if s[5] == "0"
    puts "Heisei"
  else
    puts"TBD"
  end
else
  puts "TBD"
end


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

using namespace std;

#define F first
#define S second

string world[8] = {"U", "D", "R", "L", "UL", "UR", "DR", "DL"};
const int rx[8] = { -1,  1,  0,  0,  -1,  -1,   1,   1};
const int ry[8] = { 0,  0,  1, -1,  -1,   1,   1,  -1};


int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n;
    cin >> n;
    long long a[n];
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    long long ans = (long long)(1e18);
    for (long long x = -100; x <= 100; x++){
        long long cur = 0;
        for (int i = 0; i < n; i++){
            cur += (x - a[i]) * (x - a[i]);
        }
        ans = min(ans, cur);
    }
    cout << ans;
#ifdef TIME
    cerr << "TIME = " << 1. * clock() / CLOCKS_PER_SEC;
#endif
    return 0;
}


Measured memory_bytes: 256
N, K = gets.split.map(&:to_i)

def count(range)
  if range.begin > range.end 
    return 0
  end
  (range.end - range.begin + 1)
end

if K == 0
  p N * N
  exit
end

ans = 0
for b in (K+1)..N
  n_chunks = N / b 
  x = n_chunks * count(K..(b-1))
  ans += x
  rest = N % b
  y = count(K..rest)
  ans += y
  #p b: b, n_chunks: n_chunks, x: x, rest: rest, y: y
end
p ans


Measured memory_bytes: 1788
#include <bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define mp make_pair
using namespace std;
vector< pair<ll,ll> > tc[114514];
ll dps[114514], dpt[114514], dis[114514];
int main(){
	ll n,m,s,t;
	cin>>n>>m>>s>>t;
	for(int i=0;i<m;i++){
		ll u,v,d;
		cin>>u>>v>>d;
		tc[u].pb( mp(d,v) );
		tc[v].pb( mp(d,u) );
	}
	priority_queue< pair<ll,ll> > que;
	que.push(mp(0,s));
	for(int i=1;i<=n;i++){
		dis[i] = (ll)mod * (ll)mod;
	}
	dis[s]=0;
	while(!que.empty()){
		ll cdis = -que.top().first;
		ll cpos = que.top().second;
		que.pop();
		if(dis[cpos]<cdis){continue;}
		for(int i=0;i<tc[cpos].size();i++){
			ll cdes = tc[cpos][i].second;
			ll ddis = tc[cpos][i].first;
			ll ncost = cdis + ddis;
			if(ncost < dis[cdes]){
				dis[cdes]=ncost;
				que.push(mp(-ncost, cdes));
			}
		}
	}
	vector< pair<ll,ll> > dispos;
	for(int i=1;i<=n;i++){
		dispos.pb( mp( dis[i], i) );
	}
	sort(dispos.begin(),dispos.end());
	dps[s] = 1;
	for(int i=0;i<n;i++){
		ll cpos = dispos[i].second;
		ll cdis = dispos[i].first;
		for(int j=0;j<tc[cpos].size();j++){
			ll cdest = tc[cpos][j].second;
			ll ddis = tc[cpos][j].first;
			if( cdis + ddis == dis[cdest]){
				dps[cdest] += dps[cpos];
				dps[cdest] %= mod;
			}
		}
	}
	reverse(dispos.begin(),dispos.end());
	dpt[t] = 1;
	for(int i=0;i<n;i++){
		ll cpos = dispos[i].second;
		ll cdis = dispos[i].first;
		for(int j=0;j<tc[cpos].size();j++){
			ll cdest = tc[cpos][j].second;
			ll ddis = tc[cpos][j].first;
			if( cdis - ddis == dis[cdest]){
				dpt[cdest] += dpt[cpos];
				dpt[cdest] %= mod;
			}
		}
	}
	ll tim = dis[t];
	ll ans = (dps[t] * dps[t])%mod;
	for(int i=1;i<=n;i++){
		if(dis[i]*2 == tim){
			ll tmp = (dps[i]*dpt[i])%mod;
			//cout<<"vertex"<<i<<" "<<dps[i]<<" "<<dpt[i]<<" "<<tmp<<endl;
			tmp = (tmp*tmp)%mod;
			ans = (ans+mod-tmp)%mod;
		}
		for(int j=0;j<tc[i].size();j++){
			ll de = tc[i][j].second;
			ll di = tc[i][j].first;
			if(dis[i]*2<tim && dis[de]*2>tim && dis[de]-dis[i]==di){
				ll tmp = (dps[i]*dpt[de])%mod;
				//cout<<"edge"<<i<<"&"<<de<<" "<<dps[i]<<" "<<dpt[de]<<" "<<tmp<<endl;
				tmp = (tmp*tmp)%mod;
				ans = (ans+mod-tmp)%mod;
			}
		}
	}
	cout<<ans%mod<<endl;
	return 0;
}

Measured memory_bytes: 18416
# 値の取得
N = int(input())
# Nまでに奇数を配列にする
n = [i for i in range(1, N + 1)]
res = 0
# それぞれの奇数に8個約数があるか計算
for i, x in enumerate(n):
    count = 0
    for j in range(1, x + 1, +2):
        if x % j == 0:
            count += 1
    if count == 8:
        res += 1
print(res)


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,cnt=0;
  int cnt2=0;

  cin >> n;
  
  string a[n];
  
  for(int i =0;i<n;i++){
    cin >> a[i];
  }

  cin >> m ;
  string b[m];
  
  for(int i=0;i<m;i++){
    cin >>b[i];
    for(int j=0;j<n;j++){
      if(b[i]==a[j] && cnt % 2 == 0){
	cnt++;
	cnt2++;
	cout << "Opened by " << b[i] << endl;
	break;
      } 
      else if(b[i]==a[j] && cnt % 2 == 1){
	cnt++;
	cnt2++;
	cout << "Closed by " << b[i] << endl;
	break;
      }
    }
    if(cnt2 == 0)cout << "Unknown " << b[i] << endl;
    cnt2 =0;
    }
}



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

using namespace std;

#define REP(i, n) for(int i = 0; i < (n); i++)
#define SORT(v, n) sort(v, v+n);
#define SSORT(v, n) sort(v, v+n, greater<int>())

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

	if(d==25) cout << "Christmas" << endl;
	else if(d==24) cout << "Christmas Eve" << endl;
	else if(d==23) cout << "Christmas Eve Eve" << endl;
	else if(d==22) cout << "Christmas Eve Eve Eve" << endl;
}

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

int main () {
    string x;
    cin >> x;
    int a;
    a = x.size();
    char ans;
    ans = x.at(a - 1);
    if (ans == '3') {
      cout << "bon" << endl;
    }
    else if (ans == '0' || ans == '1' || ans == '6' || ans == '8') {
      cout << "pon" << endl;
    }
    else {
      cout << "hon" << endl;
    }
}

Measured memory_bytes: 3624
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

const int MAX_M = 10;
const int INT_MAX = 1 << 30;

struct Edge{ int u, v, cost; };

int dijkstra(vector<Edge>& edges, int m, int s)
{
	vint d(m, INT_MAX);
	d[s] = 0;
	
	bool update = true;
	while(update)
	{
		update = false;
		
		rep(i, edges.size())
		{
			Edge e = edges[i];
			
			if(d[e.u] != INT_MAX && d[e.u] + e.cost < d[e.v])
			{
				d[e.v] = d[e.u] + e.cost;
				update = true;
			}
			
			if(d[e.v] != INT_MAX && d[e.v] + e.cost < d[e.u])
			{
				d[e.u] = d[e.v] + e.cost;
				update = true;
			}
		}
	}
	
	return accumulate(ALL(d), 0);
}

int main()
{
    int n;
	while(cin >> n && n)
	{
		int cost = INT_MAX, index = 0, m = 0;
		vector<Edge> edges(n);
		
		rep(i, n)
		{
			cin >> edges[i].u >> edges[i].v >> edges[i].cost;
			chmax(m, max(edges[i].u, edges[i].v) + 1);
		}
		
		rep(i, m)
		{
			int tmp = dijkstra(edges, m, i);
			
			if(tmp < cost)
			{
				index = i;
				cost = tmp;
			}
		}
		
		cout << index << " " << cost << endl;
	}
}

Measured memory_bytes: 0
def F(a, b):
    count = 0
    c = max(a, b)
    while c >= 10:
        c = c / 10
        count += 1
    return count+1

N = int(input())
minimum = 15
for num in range(1,int(N/(10**5))+10**5+1):
    if N % num == 0:
        minimum = min(minimum, F(num, N/num))
print(minimum)

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

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

    int a, b;
    cin >> a >> b;
    for (int i = 0; i < 1111; i++) {
        if (i * 8 / 100 == a && i / 10 == b) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <numeric>
#include <climits>
#define ll long long
#define LIM 1000
using namespace std;
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '9') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}


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

#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, n, m) for (int i = n; i < m; i++)
#define ll long long int

using namespace std;

int main()
{
  int a, b, c, d, e, k;
  cin >> a >> b >> c >> d >> e >> k;
  if (e -a> k)
  {
    cout << ":(" << endl;
    return 0;
  }
  cout << "Yay!" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int A,B;
    cin>>A>>B;
    if(A%3==0){
        printf("Possible");
        return 0;
    }
    if((A+B)%3==0){
        printf("Possible");
        return 0;

    }
    if(B%3==0){
        printf("Possible");
        return 0;
    }
    printf("Impossible");
    return 0;
}

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

int main(){

    vector<int> n(3);
    for(int i=0;i<3;i++) cin>>n.at(i);
    sort(n.begin(),n.end());
    reverse(n.begin(),n.end());

    cout<<n.at(0)*10+n.at(1)+n.at(2)<<endl;








    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int r;
    cin>>r;
    
    if(r<1200)
    cout<<"ABC";
    else if(r>=1200 && r<2800)
    cout<<"ARC";
    else if(r>=2800 && r<=4208)
    cout<<"AGC";
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
      
      //入力
      String S =sc.next();
      
      //数字列の前半と後半
      String first0 = S.substring(0,2);
      String last0 = S.substring(2,4);
      
      //数字列から数値に変更
      int first = Integer.valueOf(first0);    
      int last = Integer.valueOf(last0);
      
      //前半2桁と後半2桁が月として利用できる
      if((first>0 && first<=12) && (last>0 && last<=12)){
        	System.out.println("AMBIGUOUS");
        }  
        //前半2桁が月として利用できる
        else if(first>0 && first<=12) {
          System.out.println("MMYY");
        }
       //後半2桁が月として利用できる
        else if(last>0 && last<=12){
          System.out.println("YYMM");
        }
      	//どちらも月として利用できない
      	else{
          System.out.println("NA");
        }
    }
}

Measured memory_bytes: 35816
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <list>
#include <queue>
#include <string>
using namespace std;
#define lli long long int
#define MAX 100000000
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int ans = 0;
    int lon = 0;
    for (int i = 0; i < s.length(); i++)
    {
        if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')
        {
            lon++;
            continue;
        }
        else
        {
            if (lon > ans)
            {
                ans = lon;
            }
            lon = 0;
            continue;
        }
    }
    if (lon > ans)
    {
        ans = lon;
    }
    cout << ans << endl;
    return 0;
}

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

ll ruijyo(int k) {
  ll tmp = 1;
  if (k == 0) {
    return 1;
  }
  else {
    rep(i, k) {
      tmp *= 10;
    }
    return tmp;
  }
}

int main() {
  string s;
  cin >> s;
  //cout << s << endl;
  vector<int> num(4);
  rep(i, 4) {
    num.at(i) = (int)s.at(i) - 48;
    //cout << num.at(i) << endl;
  }
  bool finish = true;
  if (num.at(0) + num.at(1) + num.at(2) + num.at(3) == 7 && finish) {
    finish = false;
    cout << s.at(0) << '+' << s.at(1) << '+' << s.at(2) << '+' << s.at(3) << '=' << '7' << endl;
  }
  else if (num.at(0) - num.at(1) + num.at(2) + num.at(3) == 7 && finish) {
    finish = false;
    cout << s.at(0) << '-' << s.at(1) << '+' << s.at(2) << '+' << s.at(3) << '=' << '7' << endl;
  }
  else if (num.at(0) + num.at(1) - num.at(2) + num.at(3) == 7 && finish) {
    finish = false;
    cout << s.at(0) << '+' << s.at(1) << '-' << s.at(2) << '+' << s.at(3) << '=' << '7' << endl;
  }
  else if (num.at(0) + num.at(1) + num.at(2) - num.at(3) == 7 && finish) {
    finish = false;
    cout << s.at(0) << '+' << s.at(1) << '+' << s.at(2) << '-' << s.at(3) << '=' << '7' << endl;
  }
  else if (num.at(0) - num.at(1) - num.at(2) + num.at(3) == 7 && finish) {
    finish = false;
    cout << s.at(0) << '-' << s.at(1) << '-' << s.at(2) << '+' << s.at(3) << '=' << '7' << endl;
  }
  else if (num.at(0) + num.at(1) - num.at(2) - num.at(3) == 7 && finish) {
    finish = false;
    cout << s.at(0) << '+' << s.at(1) << '-' << s.at(2) << '-' << s.at(3) << '=' << '7' << endl;
  }
  else if (num.at(0) - num.at(1) + num.at(2) - num.at(3) == 7 && finish) {
    finish = false;
    cout << s.at(0) << '-' << s.at(1) << '+' << s.at(2) << '-' << s.at(3) << '=' << '7' << endl;
  }
  else if (num.at(0) - num.at(1) - num.at(2) - num.at(3) == 7 && finish) {
    finish = false;
    cout << s.at(0) << '-' << s.at(1) << '-' << s.at(2) << '-' << s.at(3) << '=' << '7' << endl;
  }
}  
    
  
  
  
  
  


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

int main (){
  string S,T;
  cin>>S>>T;
  if(S[0]==T[2] && S[1]==T[1] && S[2]==T[0]){
    cout<<"YES"<<endl;
  }
  else{
    cout<<"NO"<<endl;
  }
}


Measured memory_bytes: 256
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <bits/stdc++.h>

using namespace std;

int solve(int a[],int b[],int c[],int l,int m,int n)
{
    if(l<=0 || m<=0 || n<=0)
    return 0;
    else
    {
         if(l==m&&m==n)
         return max(max(b[l-1]+solve(a,b,c,l,l-1,l),c[l-1]+solve(a,b,c,l,l,l-1)),max(a[l-1]+solve(a,b,c,l-1,l,l),c[l-1]+solve(a,b,c,l,l,l-1)));
         else
         {
             if(l<m)
             return max(b[l-1]+solve(a,b,c,l,l-1,l),c[l-1]+solve(a,b,c,l,l,l-1));
             else if(m<n)
             return max(a[m-1]+solve(a,b,c,m-1,m,m),c[m-1]+solve(a,b,c,m,m,m-1));
             else
             return max(b[n-1]+solve(a,b,c,n,n-1,n),a[n-1]+solve(a,b,c,n-1,n,n-1));
         }
    }
}

int main()
{
    int n;
    cin>>n;
    int dp[n+1][3];
    memset(dp,0,sizeof(dp));
   
    for(int i=1;i<=n;i++)
    {
         int a,b,c;
        cin>>a>>b>>c;
        dp[i][0]=a+max(dp[i-1][1],dp[i-1][2]);
        dp[i][1]=b+max(dp[i-1][0],dp[i-1][2]);
        dp[i][2]=c+max(dp[i-1][1],dp[i-1][0]);
    }
    cout<<max(dp[n][0],max(dp[n][1],dp[n][2]));
    
    
}


Measured memory_bytes: 4688
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define pb push_back
#define fu(i,a,j) for(int i=a;i<j;i++)
#define fd(i,a,j) for(int i=a;i>=j;i--)
#define SYNC ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define MOD 1000000
#define MOD2 1000000021
#define INF 1e9
#define N 2
#define M_PI 3.14159265358979323846
using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<string> vs;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); };
int n, m, k, t;
int dr[] = { 0, 1, 0, -1, -1,1,1,-1 };
int dc[] = { 1, 0, -1, 0, 1,1,-1,-1 };

int main() {
	SYNC;
	cin >> n >> k;
	vector<set<int>> st(n+1);
	for (int i = 0; i < k; i++) {
		cin >> m;
		for (int j = 0; j < m; j++) {
			int a;
			cin >> a;
			st[a].insert(a);
		}
	}
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		if (st[i].size() == 0) {
			ans++;
		}
	}
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 3664
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main(void) {
	int x, y, sub;

	for (;;) {
		scanf("%d %d", &x, &y);
		if (x == 0 && y == 0) break;
		if (x >= 10000 || y >= 10000) continue;
		if (x > y) {
			sub = x;
			x = y;
			y = sub;
		}
		printf("%d %d\n",x, y);
	}
	return 0;
}


Measured memory_bytes: 2028
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

int n,ans;
string s,sb;
bool k;
int main(){
  cin.tie(nullptr); ios::sync_with_stdio(false);

  cin>>n>>s;
  int l=0,r=1;
  while(r<n){
    if(r-l<=ans){r++; continue;}
    sb=s.substr(l,r-l);
    k=false;
    for (int i = 0; i < n-r; i++){
      if(s.substr(r+i,r-l)==sb){k=true; break;}
    }
    if(k){
      cmax(ans,r-l); r++;
    }else l++;
  } 
  cout<<ans<<'\n';
}


Measured memory_bytes: 384
N = input()

if N[-1] == '2' or N[-1] == '4' or N[-1] == '5' or N[-1] == '7' or N[-1] == '9':
    Yomi = 'hon'
elif N[-1] == '0' or N[-1] == '1' or N[-1] == '6' or N[-1] == '8':
    Yomi = 'pon'
elif N[-1] == '3':
    Yomi = 'bon'

print(Yomi)

Measured memory_bytes: 8908
N, P = map(int, input().split())
S = [int(i) for i in input()]
from collections import Counter
def solve(S,N,P):
    if P==2 or P==5:
        ans = 0
        for i in range(N):
            if S[i]%P==0:
                ans += i+1
        return ans
    cum = [0]*(N+1)
    mods = [0]*N
    mods[0] = 1
    for i in range(1,N):
        mods[i] = mods[i-1]*10%P
    for i in range(N):
        cum[i+1] = (cum[i]+S[N-1-i]*mods[i])%P
    c = Counter(cum)
    ans = 0
    for v in c.values():
        ans += v*(v-1)//2
    return ans
print(solve(S,N,P))


Measured memory_bytes: 26508
k=int(input())
now=0
if k%2==0 or k%5==0:
    print(-1)
else:    
    for i in range(1,7*10**6):
        now=(now+(7*pow(10,i,k)))%k
        if now==0:
            print(i)
            break
    else:
        print(-1)

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

int main(void){
	int a,b,c;
	while (scanf("%d%d%d", &a, &b, &c)!=EOF){
		if (a+b >= c){
			printf("Yes\n");
		}
		else{
			printf("No\n");
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int g[89];
main()
{
  int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
    int a,b;
    int k;
    int ans=0;
    cin >>a>>b>>k;
    int count=0;
    for(int i=min(a,b);count <=k;i--){
        if(a%i==0 and b%i==0){
            count++;
       //     clog<<i<<endl;
        }
        if(count==k){
            cout<<i<<endl;
            return 0;
        }
    }
    cout<<ans<<endl;
}

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

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    auto ss = reads!(string).map!(toUpper);

    writeln(ss[0][0], ss[1][0], ss[2][0]);
}


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

int main() {
  ll n,k;
  cin >> n >> k;
  vector<ll> a(n);
  for(ll i=0;i<n;i++){
    cin >> a[i];
  }
  
  for(int i=k;i<n;i++){
    if(a[i-k] < a[i]){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
  
  return(0);
}

Measured memory_bytes: 4836
#include<stdio.h>
#include<iostream>
#include <algorithm>
using namespace std;
int main(){
	int n,x;
	int N;
	while(1){
		N=0;
		cin>>n>>x;
		if(n==0&&x==0){
			break;
		}
		for(int a=1;a<=n-2;a++){
			for(int b=a+1;b<=n-1;b++){
				for(int c=b+1;c<=n;c++){
					if(a+b+c==x){
						N++;
					}
				}
			}
		}
		cout<<N<<endl;
	}
	return 0;
}

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

using namespace std;
using ll=long long;

ll k(ll n){
    ll ans=0;
    while(n>0){
        n/=10;
        ans++;
    }
    return ans;
}

int main()
{
   ll n;cin >>n;
   ll ans=10000;
   for(ll  a=1;a<=100100;a++){
       if(a>n)break;
       if(n%a!=0)continue;
       ll b=n/a;
       ll d=max(k(a),k(b));
       ans=min(ans,d);
   }
   cout << ans << endl;
    return 0;
}


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

using namespace std;

template<typename T> T find_first_positive(
    T const _b,
    T const _e)
    {
    auto b = _b, e = _e;
    if (*b>=0) return b;
    while(1) {
        size_t d = distance(b,e);
        if(d==2) {
            return b+1;
        }
        auto c = b+(d/2);
        if (*c>=0) {
            e = c+1;
        } else {
            b = c;
        }
    }
}

int main(int argc, char const *argv[])
{
    int n; cin >> n;
    vector<long long> a(n);
    for(auto itr=a.begin();n>0;--n) {
        cin >> *itr; ++itr;
    }
    sort(a.begin(), a.end());
    if (*a.begin()>=0LL) {
        cout << accumulate(a.begin(), a.end(), 0LL) << endl;
    } else {
        auto p_itr = find_first_positive(a.begin(), a.end());
        //bool b1 = , b2 = (distance(p_itr, a.end()))&1;
        //if(b1&&b2) {
        if((distance(a.begin(), p_itr)&1)) {
            cout << max(accumulate(a.begin(), p_itr-1, 0LL) * -1LL + *(p_itr-1) + accumulate(p_itr,a.end(),0LL),
                        accumulate(a.begin(), p_itr, 0LL) * -1LL + *(p_itr) * -1LL + accumulate(p_itr+1,a.end(),0LL)) << endl;
        //} else if (b1&&(!b2)) {
        //    cout << accumulate(a.begin(), p_itr-1, 0LL) * -1LL + *(p_itr-1) + accumulate(p_itr,a.end(),0LL) << endl;
        } else {
            cout << accumulate(a.begin(), p_itr, 0LL) * -1LL + accumulate(p_itr,a.end(),0LL) << endl;
        }
    }


    return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>
#define N 3
#define MAX 8
typedef struct{
    int A[N][N];

}Pazzle;
int d_x[4]={0,1,0,-1};
int d_y[4]={1,0,-1,0};
void swap(int *,int *);
int check(Pazzle);
int dfs(int ,int ,int ,int ,Pazzle );

int main(void){
    Pazzle P,t_P;
    int  i,j,ans;
    int x0,y0;

    for(i=0;i<N;i++){
        for(j=0;j<N;j++){
            scanf("%d",&P.A[i][j]);
            if(P.A[i][j]==0){
                x0=j;
                y0=i;
                
            }
            
        }
    }
    t_P=P;
    for(i=1;i<100;i++){
        P=t_P;
    ans=dfs(x0,y0,i,0,P);
    if(ans!=-1){printf("%d\n",ans); break;}
    }
    return 0;
}

int dfs(int x,int y,int max,int cnt,Pazzle P){
         int i;
  int heau;
  int x_0,y_0;
  int ans=-1;   
  heau=check(P);
  if(heau==0) return cnt;
  if(cnt+heau>max) return -1; 
  for(i=0;i<4;i++){
    x_0=x+d_x[i];
    y_0=y+d_y[i];      
   
    if(!(0<=x_0 && x_0<3 && 0<=y_0 && y_0<3)) continue;    
    swap(&P.A[y][x],&P.A[y_0][x_0]);
    ans=dfs(x_0,y_0,max,cnt+1,P);
    if(ans!=-1) return ans;       
     swap(&P.A[y][x],&P.A[y_0][x_0]);
  }   
  return -1;
}

void swap(int *A,int *B){
 int hoge;
 hoge=*A;
 *A=*B;
 *B=hoge;
 
 
}
int check(Pazzle P){
    int sum=0,i,j,hy,hx;
    for(i=0;i<N;i++){
 
    for(j=0;j<N;j++){
        if(P.A[i][j]==0)
        continue;
        hy=(P.A[i][j]-1)/N-i;
        hx=(P.A[i][j]-1)%N-j;
        if(hy<0)
        sum-=hy;
        else
        sum+=hy;
        if(hx<0)
        sum-=hx;
        else
        sum+=hx;
 
 
}
}
 
return sum;
}


Measured memory_bytes: 2104
import heapq,sys

input=sys.stdin.readline

X,Y,Z=map(int,input().split())
N=X+Y+Z
coin=[tuple(map(int,input().split())) for i in range(N)]
coin.sort(key=lambda x:x[0]-x[1])
y=[0]*N
S=0
n=0
que=[]
for i in range(N):
    val=coin[i][1]-coin[i][2]
    if Y>n:
        heapq.heappush(que,val)
        S+=val
        n+=1
        y[i]=S
    else:
        if que[0]<val:
            S+=val-que[0]
            heapq.heappop(que)
            heapq.heappush(que,val)
        y[i]=S

x=[0]*N
S=0
n=0
que=[]
for i in range(N-1,-1,-1):
    val=coin[i][0]-coin[i][2]
    if X>n:
        heapq.heappush(que,val)
        S+=val
        n+=1
        x[i]=S
    else:
        if que[0]<val:
            S+=val-que[0]
            heapq.heappop(que)
            heapq.heappush(que,val)
        x[i]=S

base=sum(coin[i][2] for i in range(N))
ans=-1
for i in range(N):
    if i>=Y-1 and N-(i+1)>=X:
        temp=base+x[i+1]+y[i]
        ans=max(ans,temp)
print(ans)


Measured memory_bytes: 97964
//=========================================c++
/* ===========================================
// 20.03.21
// 
// 
=========================================== */
/* ===========================================

content

=========================================== */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i,n) for(int (i)=1;(i)<=(n);i++)
#define rez(i,n) for(int (i)=0;(i)<(n);i++)
#define ET "\n"
#define CLR(arr) memset(&arr, 0, sizeof(arr))
#define PAIR pair<int, int>
#define UQ unique_ptr
#define MQ make_unique
const ll INF = 1LL << 50;
const int mini = 10e5+5;



int main(){
    int n; cin >> n;
    
    bool chk = true;
    while(n--){
        int a; cin>> a;
        if ((a&1) == 0){
            if (a%3 == 0 || a%5 == 0){
                continue;
            }
            else{
                chk = false;
                break;
            }
        }
        else{
            continue;
        }
    }
    
    if (chk == true){
        cout << "APPROVED";
    }
    else{
        cout << "DENIED";
    }
}


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

int main(){
	string s;
	cin>>s;
	bool f;
	
	if(s[0]==s[s.size()-1]){
		if(s.size()%2==1) cout<<"Second"<<endl;
		else cout<<"First"<<endl;
	}
	else {
		if(s.size()%2==1) cout<<"First"<<endl;
		else cout<<"Second"<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 512