akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repp(i, s, e) for (int i = (s); i < (e); i++)
#define all(x) x.begin(), x.end()

#define endl "\n"

void use_cio() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
}

template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
    return os << "(" << P.first << "," << P.second << ")";
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
    os << "[";
    for (auto x : V) os << x << ", ";
    return os << "]";
}
//--------------------------------------------------//

int main() {
    use_cio();
    int n, l;
    cin >> n >> l;
    vector<ll> a(n, 0);
    rep(i, n) cin >> a[i];
    rep(i, n - 1) if (a[i] + a[i + 1] >= l) {
        cout << "Possible\n";
        for (int j = n - 1; j > i + 1; j--) cout << j << endl;
        rep(j, i + 1) cout << j + 1 << endl;
        return 0;
    }
    cout << "Impossible";
}


Measured memory_bytes: 1664
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <numeric>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;

using namespace std;

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

int main(void){
    ll A, B, count=1;
    cin >>A>>B;
    ll r = gcd(A, B);
    bool divided=false;
    for(int i=2; i<1e6; i++){
        divided=false;
        while(true){
            if(r%i!=0) break;
            divided=true;
            r /= i;
        }
        if(divided==true) count++;
        if(i*i >=r) break;
    }
    if(r != 1) count++;
    cout << count <<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
ll fn(ll n) {
    vector<int> res;
    while(n) {
        res.push_back(n % 2);
        n /= 2;
    }
    ll ans = 0;
    for(auto e : res) {
        ans += e;
    }
    return ans;
}
ll modpow(ll a, ll n, ll mod = MOD) {
    ll res = 1;
    while(n > 0) {
        if(n & 1)
            res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
int main() {
    ll n;
    cin >> n;
    string s;
    cin >> s;
    ll bit = 0;
    for(auto e : s) {
        bit += (e == '1');
    }
    ll x = 0, y = 0, z = 0;
    for(int i = 0; i < n; i++) {
        if(s[i] == '1') {
            x += modpow(2, n - i - 1, bit);
            y += modpow(2, n - i - 1, bit + 1);
            if(bit > 1) {
                z += modpow(2, n - i - 1, bit - 1);
            }
        }
    }
    for(int i = 0; i < n; i++) {
        if(s[i] == '1') {
            ll w = z;
            if(bit > 1) {
                w -= modpow(2, n - i - 1, bit - 1);
                w = (w + bit - 1) % (bit - 1);
            } else {
                cout << 0 << endl;
                continue;
            }
            int ans = 0;
            while(w) {
                w = w % fn(w);
                ans++;
            }
            cout << ans + 1 << endl;
        } else {
            ll w = y;
            int ans = 0;
            w += modpow(2, n - i - 1, bit + 1);
            w = (w + bit + 1) % (bit + 1);
            while(w) {
                w = w % fn(w);
                ans++;
            }
            cout << ans + 1 << endl;
        }
    }
}

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

int main() {
	int N;
	cin >> N;
	int(*heights)[100] = new int[100][100];
	int xs[100];
	int ys[100];
	int x, y, h;
	int k = 0;
	while (cin >> x >> y >> h)
	{
		xs[k] = x;
		ys[k++] = y;
		heights[x][y] = h;
	}

	long long int H = 1;
	long long int max_H = 1000000000 + 201;
	int i = 0;
	int Cx = 0;
	int Cy = 0;
	for (Cx = 0; i < N && Cx <= 100; Cx++)
		for (Cy = 0; i < N && Cy <= 100; Cy++)
		{
			long long int temp_H = 0; //作为测试标杆，如果对于每一对坐标，H都与temp_H相等，则说明H正确。
			for (i = 0; i < N; i++)
			{
				if (heights[xs[i]][ys[i]] > 0)
				{
					H = abs(xs[i] - Cx) + abs(ys[i] - Cy) + heights[xs[i]][ys[i]];
					if (temp_H == 0)
						temp_H = H;
					if (H != temp_H || H > max_H)
						break;
				}
				else
				{
					max_H = abs(xs[i] - Cx) + abs(ys[i] - Cy) + heights[xs[i]][ys[i]];
					if (temp_H != 0 && temp_H > max_H)
						break;
				}
			}

		}
	delete[] heights;
	cout << Cx - 1 << ' ' << Cy - 1 << ' ' << H;
}


Measured memory_bytes: 3168
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>

using namespace std;
#define it std::vector<int>::iterator

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

  vector<int> x(n), y(n);
  vector<int> x_, y_;

  for(int i=0; i<n; i++){
    cin >> x[i] >> y[i];
    x_.push_back(x[i]);
    y_.push_back(y[i]);
  }
  sort(x_.begin(), x_.end());
  sort(y_.begin(), y_.end());

  long long ans = 1LL * (x_[n-1] - x_[0]) * (y_[n-1] - y_[0]);
  for(int xi=0; xi<n; xi++){
    for(int xj=xi+1; xj<n; xj++){
      for(int yi=0; yi<n; yi++){
        for(int yj=yi+1; yj<n; yj++){
          int num = 0;
          long long lx = x_[xi], rx = x_[xj];
          long long by = y_[yi], uy = y_[yj];
          for(int i=0; i<n; i++){
            if(lx <= x[i] and x[i] <= rx and by <= y[i] and y[i] <= uy){
              num++;
            }
          }
          if(num >= k) ans = min(ans, 1LL * (rx - lx) * (uy - by));
        }
      }
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int i,j,k,l;
set <int> s;
int main()
{
    long long n,a,b;
    while(scanf("%lld%lld%lld",&n,&a,&b)!=EOF)
    {
        if(a>b||(n<2&&a!=b)||n==0) {printf("0\n");continue;}
        long long int ans=(b-a)*(n-2)+1;
        printf("%lld\n",ans);
    }
    return 0;
}


Measured memory_bytes: 256
a,b=map(int,input().split())
print(a+1-b)
#Source code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 characters

Measured memory_bytes: 2940
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<stdlib.h>
#include<cstdio>
#include<vector>
#include<string.h>
#include<math.h>
using namespace std;
#define ll long long int 
typedef pair <ll,ll> P;
set<P> st;
ll A[1000],B[1000];
int main(){
    ll n;
    cin>>n;
    for(ll i=0;i<n;i++){
        cin>>A[i]>>B[i];
        st.insert(P(A[i],B[i]));
    }
    ll ans=0;                ll cnt=0;
    for(ll i=0;i<n;i++){
        for(ll j=0;j<n;j++){
            if(i!=j){
                P p=P(A[i]-A[j],B[i]-B[j]);
                cnt=0;
                for(ll k=0;k<n;k++){
                    P q=P(p.first+A[k],p.second+B[k]);
                    if(st.count(q)) cnt++;
                }   
                ans=max(cnt,ans);
            }
        }
    }
    cout<<n-ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
typedef long long ll;
using namespace std;

int main() {
    int n; cin >> n;
    int ans=0;
    vector<int> V(n);
    rep(i,n){
        cin >> V[i];
    }
    for(auto num: V){
        while(num%2==0){
            ans += 1;
            num /=2;
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
  int m,f,v;
  
  while(1){
    cin >> m >> f >> v;
    if(m == -1 && f == -1 && v == -1) break;
    if(m == -1 || f == -1){
      cout << "F" << endl;
      continue;
    }
    
    if(m + f >= 80) cout << "A" << endl;
    else if(m + f >= 65) cout << "B" << endl;
    else if(m + f >= 50) cout << "C" << endl;
    else if(m + f >= 30){
      if(v >= 50) cout << "C" << endl;
      else cout << "D" << endl;
    }
    else cout << "F" << endl;
  }
    
}


Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    int n,m,c,d,i;
  	cin>>n>>m;
  	vector<int> a(n);
  	for(i=0;i<m;i++){
		cin>>c>>d;
      a[c-1]++;
      a[d-1]++;
    }
  
  	for(i=0;i<n;i++){
		cout<<a[i]<<endl;
    }
  	
      
}
		

  



Measured memory_bytes: 256
N=int(input())
a=list(map(int,input().split()))
distrib={}
for element in a:
    if element not in distrib:
        distrib[element] = 1
    else:
        distrib[element] += 1
ans = 0
for key in distrib:
    diff = distrib[key] - key
    if diff >= 0:
        ans += diff
    else:
        ans += distrib[key]
print(ans)

Measured memory_bytes: 18160
#include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch JudgeStatusSummary | diff JudgeStatusSummary.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address JudgeStatusSummary.cpp && ./a.out

/*

 7/5/2020

 5:02-

 */

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;

  int N; cin>>N;
  map<string,int> cnt;
  REP(i,N) {
    string s; cin>>s;
    cnt[s]++;
  }
  vector<string> ks={"AC","WA","TLE","RE"};
  FORR(k,ks) {
    cout<<k<<" x "<<cnt[k]<<endl;
  }

  return 0;
}


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

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


Measured memory_bytes: 3760
#include <algorithm>
#include <climits>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define INF_INT (INT_MAX / 2)
#define INF_LONG (LONG_MAX / 2)
//#define DEBUG true
#define DEBUG false
using namespace std;

const int MAX = 100001;
const int MOD = 1000000007;

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

int ceil(int x, int y) { return (x % y == 0) ? x / y : x / y + 1; }

int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }

int lcm(int x, int y) { return x / gcd(x, y) * y; }

char wise2(char a, char b) {
  if (a != 'r' && b != 'r') return 'r';
  if (a != 's' && b != 's') return 's';
  return 'p';
}

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

  int n, k;
  int r, s, p;
  string t;
  cin >> n >> k;
  cin >> r >> s >> p;
  cin >> t;

  map<char, char> win;
  win['r'] = 'p';
  win['s'] = 'r';
  win['p'] = 's';

  map<char, char> lose;
  lose['r'] = 's';
  lose['s'] = 'p';
  lose['p'] = 'r';

  map<char, int> point;
  point['r'] = r;
  point['s'] = s;
  point['p'] = p;

  int sum = 0;
  string ss;
  for (int i = 0; i < n; i++) {
    if (i - k < 0 || ss[i - k] != win[t[i]]) {
      sum += point[win[t[i]]];
      ss.push_back(win[t[i]]);
    } else {
      if (i + k < n) {
        if (t[i + k] != ss[i - k])
          ss.push_back(t[i + k]);
        else if (lose[t[i + k]] != ss[i - k])
          ss.push_back(lose[t[i + k]]);
        else
          ss.push_back(wise2(t[i + k], lose[t[i + k]]));
      } else {
        ss.push_back(win[ss[i - k]]);
      }
    }
  }

  cout << sum << endl;

  return 0;
}


Measured memory_bytes: 704
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 2
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	ert := make([]int, int(1e6)+1)
	for i := 2; i < len(ert); i++ {
		if ert[i] != 0 {
			continue
		}
		for j := i * i; j < len(ert); j += i {
			if ert[j] != 0 {
				continue
			}
			ert[j] = i
		}
	}
	max := map[int]int{}
	var sum, x int64
	mod := int64(1e9 + 7)
	x = 1
	for i := 0; i < n; i++ {
		a := getNextInt(scanner)
		sum += inv(int64(a))
		sum %= mod
		temp := map[int]int{}
		for ert[a] > 1 {
			temp[ert[a]] = temp[ert[a]] + 1
			a /= ert[a]
		}
		temp[a] = temp[a] + 1
		for k, v := range temp {
			if k == 0 {
				continue
			}
			if max[k] < v {
				max[k] = v
			}
		}
	}
	for k, v := range max {
		if k == 0 {
			continue
		}
		for i := 0; i < v; i++ {
			x *= int64(k)
			x %= mod
		}
	}
	fmt.Fprintln(writer, x*sum%mod)
}

func inv(n int64) int64 {
	var ii [64]int64
	mod := int64(1e9 + 7)
	ii[0] = n
	for i := 1; i < 64; i++ {
		ii[i] = (ii[i-1] * ii[i-1]) % mod
	}
	var ans int64
	ans = 1
	m := int64(mod - 2)
	for i := 62; i >= 0; i-- {
		for m >= 1<<uint(i) {
			ans = (ans * ii[i]) % mod
			m -= 1 << uint(i)
		}
	}

	return ans
}


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

dp = [0] * 100001

dp[1] = 1

for i in range(2, N + 1):
    dp[i] = dp[i - 1] + 1
    j = 1
    while 6 ** j <= i:
        dp[i] = min(dp[i], dp[i - (6 ** j)] + 1)
        j += 1
    j = 1
    while 9 ** j <= i:
        dp[i] = min(dp[i], dp[i - (9 ** j)] + 1)
        j += 1

print(dp[N])


Measured memory_bytes: 73340
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  if(n<=81){
    int k=0;
    for(int i=1;i<=9;i++){
      for(int j=1;j<=9;j++){
        if(n==i*j){
          k++;
        }
      }
    }
    if(k==0){
      cout<<"No"<<endl;
    }
    else{
      cout<<"Yes"<<endl;
    }
  }
  else{
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 256
import java.io.*;

public class Main {

	static boolean f = false;
	static int[] left = new int[10];
	static int[] right = new int[10];
	static int[] arr = new int[10];
	static int left_c = 0, right_c = 0;
	
	public static void main(String[] args) throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		String str = br.readLine();
		int kaisuu = Integer.parseInt(str);

		for(int j = 0; j < kaisuu;j++){
			int n = 10;
			String c = br.readLine();

			for(int i = 0; i < n; i++){
				if(c.indexOf(" ") !=  -1){
					String prestr = c.substring(0, c.indexOf(" "));
					arr[i] = Integer.parseInt(prestr);
					c = c.substring(c.indexOf(" ") + 1);
				}
				else{
					arr[i] = Integer.parseInt(c);
				}
				//System.out.println(junban[i]);
			}
			back(0);//, 0);
			if(f)
				System.out.println("YES");
			else
				System.out.println("NO");
			reset();
		}
		
		
	}
	static private void back(int i){
		if(i == 10){
			f = true;
			return;
		}
		if(left_c == 0 || left[left_c-1] < arr[i]){
			left[left_c++] = arr[i];
			back(i+1);//, k+1);
		}
		else if(right_c == 0 || right[right_c-1] < arr[i]){
			right[right_c++] = arr[i];
			back(i+1);//, k+1);
		}
		else {
			return;
		}
	}
	
	static void reset(){
		for(int i = 0; i < 10; i++){
			left[i] = 0;
			right[i] = 0;
			arr[i] = 0;
		}
		f = false;
		left_c = 0; right_c = 0;
	}
}

Measured memory_bytes: 9328
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder();

            while (true)
            {
                int[] memo = new int[31];
                memo[1] = 1; memo[2] = 2; memo[3] = 4;

                for (int i = 4; i <= 30; i++)
                {
                    memo[i] = memo[i - 1] + memo[i - 2] + memo[i - 3];
                }

                int n = int.Parse(Console.ReadLine());

                if (n == 0) break;

                int res = memo[n] / 3650 + 1;
                sb.AppendLine(res.ToString());
            }
            Console.Write(sb);
        }
    }
}

Measured memory_bytes: 9144
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int q;
    cin >> q;
    int a, x;
    string key;
    map<string, int> m;
    while(q--){
        cin >> a >> key;
        if(a==0){
            cin >> x;
            m[key]=x;
        }else if(a==1){
            cout << m[key] << "\n";
        }else{
            m.erase(key);
        }
    }
    
    return 0;
}


Measured memory_bytes: 27812
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll modpow(ll a, ll n) {
    ll res = 1;
    while(n > 0) {
        if(n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }

    return res;
}

ll comb(ll a, ll b) {
    ll ans = 1;

    for(ll i = a; i > a - b; i--) {
        ans = ans * i % mod;
    }
    for(ll i = 1; i <= b; i++) {
        ans = (ans * modpow(i, mod - 2)) % mod;
    }
    return ans;
}

int main() {
    int N;
    cin >> N;
    ll res = 0;
    vector<vector<ll>> num(10, vector<ll>(10,0));
    for(int i = 1; i <= N; i++) {
        vector<int> d;
        int nn = i;
        while(nn) {
            d.push_back(nn % 10);
            nn /= 10;
        }

        int a = d[0];
        int b = d.back();
        if(!a || !b) continue;
        ++num[a][b];
    }
    for(int a = 1; a < 10; a++) {
        for(int b = 1; b < 10; b++) {
            res += num[a][b] * num[b][a];
        }
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,a,b;
    scanf("%d%d",&a,&b);
    if(a>1)
    {
    for(i=b-(a-1);i<=b+(a-1);i++)
    {
        printf("%d ",i);
    }
    printf("\n");
    }
    else
    {
        printf("%d\n",b);
    }
    return 0;
}


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

int main(){
    int n, k, i, j, l;
    cin >> n >> k;
    if((n-2)*(n-1)/2 < k){
        cout << -1;
    }else{
        cout << (n-1) + ((n-2)*(n-1)/2 - k) << '\n';
        for(i=2; i<=n; i++){
            cout << 1 << ' ' << i << '\n';
        }
        i = (n-2)*(n-1)/2 - k;
        j = 2;
        l = 3;
        while(i > 0){
            cout << j << ' ' << l << '\n';
            i--;
            l++;
            if(l > n){
                j++;
                l = j+1;
            }
        }
    }
    return 0;
}

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, y; cin >> n >> y;
  y /= 1000; y -= n;
  for (int i = 0; i <= n; i++) {
    if (9 * i > y) break;
    if ((y - 9 * i) % 4) continue;
    int j = (y - 9 * i) / 4;
    if (i + j > n) continue;
    int k = n - i - j;
    printf("%d %d %d\n", i, j, k);
    return 0;
  }
  cout << "-1 -1 -1" << '\n';
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int main() {
  char s[100];
  scanf("%s", s);
  string str = string(s);

  int itr = 0;
  int x, y, z = 0;
  int min = 1000;
  for (char c : str) {
    z = y;
    y = x;
    x = int(c - '0');
    itr++;
    if (itr <= 2) {
      continue;
    }
    int gap = abs(z * 100 + y * 10 + x - 753);
    if (gap < min) {
      min = gap;
    }
  }
  printf("%d\n", min);

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll INF= 1000000005; 
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
  }

  vector<int>dp(n,INF);
  dp[0]=0;
  for(int i=0;i<n;i++)
  {
    for(int j:{i+1,i+2})
    { if(j<n){
      dp[j]=min(dp[j],dp[i]+abs(a[i]-a[j]));}
     			}
                }
          cout<<dp[n-1];
}


Measured memory_bytes: 1024
A, B, C, D, E, F = map(int, input().split())
ans = [100 * A, 0]
c = 0

for i in range(1, F // (100 * A) + 1):
    for j in range((F - 100 * A * i) // (100 * B) + 1):
        a = 100 * A * i + 100 * B * j
        for k in range((F - a) // C + 1):
            for l in range((F - a - C * k) // D + 1):
                b = k * C + l * D
                concentration = 100 * b / (a + b)
                if (A * i + B * j) * E >= b:
                    if concentration > c:
                        c = concentration
                        ans = [a + b, b]
                else:
                    break

print(' '.join(map(str, ans)))

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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,m,s,c,sum=0,cnt;
	bool f=true;
	cin>>n>>m;
	vector<pair<bool,int>>v(n+1);
	for(int i=0;i<n;i++) v.at(i).second=0;
	for(int i=0;i<m;i++){
		cin>>s>>c;
		if(n!=1 && s==1&&c==0){
			f=false;
		}
		if(v.at(s).first==false){
			v.at(s).first=true;
			v.at(s).second=c;
		}else{
			if(v.at(s).second!=c){
				f=false;
			}
		}
	}
	if(f==false){
		cout<<-1<<endl;
		return 0;
	}
	cnt=n-1;
	for(int i=1;i<n+1;i++){
		sum+=v.at(i).second*pow(10,cnt);
		cnt--;
	}
	if(n>=2){
		if(sum<1*pow(10,n-1)){
			sum+=1*pow(10,n-1);
		}
	}
	cout<<sum<<endl;
	return 0;
}


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

int main(){
  int X,N;
  cin>>X>>N;
  vector<int> vec(N);
  for(int i=0;i<N;i++)
    cin>>vec[i];
  for(int i=0;i<N+1;i++){
    if(X-i<1){
      cout<<X-i<<endl;
      return 0;
    }
    int k=0;
    for(int y:vec){
      if(y==X-i){
        k=1;
        break;
      }
    }
    if(k==0){
      cout<<X-i<<endl;
      return 0;
    }
    if(X+i>100){
      cout<<X+i<<endl;
      return 0;
    }
    int w=0;
    for(int y:vec){
      if(y==X+i){
        w=1;
        break;
      }
    }
    if(w==0){
      cout<<X+i<<endl;
      return 0;
    }
  }
}

Measured memory_bytes: 3628
#include <iostream>
using namespace std;
int main(){
  int a,b;
  cin>>a>>b;
  string s ="";
  if(a<b){
   char n='0'+a;   
   for(int i=0;i<b;i++){
    s+=n;
  }
  }
  else{
  char n='0'+b;
  for(int i=0;i<a;i++){
    s+=n;
  }
  }
cout<<s;

return 0;
}



Measured memory_bytes: 256
from collections import deque
n,x=map(int,input().split())
t=list(map(int,input().split()))
ans=0
t=deque(t)
tmp=t.popleft()
for _ in range(n-1):
    tmp2=t.popleft()
    if tmp2-tmp>x:
        ans+=x
    else:
        ans+=tmp2-tmp
    tmp=tmp2
ans+=x
print(ans)



Measured memory_bytes: 89168
use std::str::FromStr;

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

fn get_vec<T : FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    return s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect();
}

fn main() {
    let nab : Vec<u64> = get_vec();
    let n = nab[0];
    let a = nab[1];
    let b = nab[2];
    if a == 0 && b == 0 {
        println!("{}", 0);
    }
    else {
        println!("{}", (n/(a+b)) * a + std::cmp::min(n%(a+b),a));        
    }
}


Measured memory_bytes: 4352
#include <iostream>
#include <string.h>
#include <fstream>
#include<time.h>
#include <string>
#include <string.h>
#include <vector>
#include <stdio.h>
#include <cstdlib>
#include <stack>
#include <map>
#include <queue>
#include<cctype>
#include <math.h>
#include <algorithm>
#define Size 1000
using namespace std;
char flo[Size][Size];
int dir_x[]={ 0, 0, 1, -1};
int dir_y[]={ 1, -1, 0, 0};
int heng, chang;
int _count;
void dfs(int x, int y, char ch){
    flo[x][y] = '.';
    for(int i = 0; i < 4; i ++){
        int t_x = x + dir_x[i];
        int t_y = y + dir_y[i];
        if((t_x >= 0 && t_x < heng)&&
           (t_y >= 0 && t_y < chang)&&
           flo[t_x][t_y] == ch){
            dfs(t_x,t_y,ch);
           }
    }
    return;
}
int main()
{
    //ifstream in;
    //in.open("a.txt", ios::in);
    while(cin>>heng>>chang){
        memset(flo, 0, sizeof(flo));
        if(heng==0&&chang==0)
            break;
        for(int i = 0; i < heng; i ++){
            for(int j = 0; j < chang; j ++){
                cin>>flo[i][j];
            }
        }
        _count = 0;
        for(int i = 0; i < heng; i ++){
            for(int j = 0; j < chang; j ++){
                if(flo[i][j] != '.'){
                    _count ++;
                    dfs(i,j,flo[i][j]);
                }
            }
        }
        cout<<_count<<endl;
    }
    return 0;
}

Measured memory_bytes: 4512
#include <bits/stdc++.h>
#include<algorithm>
using namespace std;
long long int __lcm(long long int a,long long int b){
  long long int n;
  n=a*b/__gcd(a,b);
  return n;
}
 //__gcd 最大公約数
 //__lcm 最小公倍数
 //double 少数（変数）
//sqrt 平方根
//ceil 天井関数
//floor 床関数
//abs 絶対値
//pow 累乗
//cbrt  立方根
//hypot 平方和の平方根
 
int main() {
  int a;
  cin>>a;
  vector<int> b(a),c(a);
  for(int i=0;i<a;i++){
    cin>>b[i];
    c[i]=b[i];
  }
  int d=0;
  string f="YES";
  sort(b.begin(),b.end());
  for(int i=0;i<a;i++){
    if(b[i]!=c[i])
      d++;
    if(d>2){
      f="NO";
      break;
  }
  }
  cout<<f;
}

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();
        char[][] charList=new char[n][];
        int[] result=new int[26];
        int[][] num=new int[26][n];
        for(int i=0;i<result.length;i++){
            result[i]=100000;
            for(int j=0;j<n;j++){
                num[i][j]=0;
            }
        }

        for(int i=0;i<n;i++){
            charList[i]=sc.next().toCharArray();
            for(int j=0;j<charList[i].length;j++){
                num[charList[i][j]-'a'][i]++;
            }
            for(int j=0;j<26;j++){
                if(result[j]>num[j][i]){
                    result[j]=num[j][i];
                }
            }
        }

        String s="";
        for(int i=0;i<26;i++){
            for(int j=0;j<result[i];j++){
                s=s+(char)('a'+i);
            }
        }
        System.out.println(s);
    }
}

Measured memory_bytes: 23764
// /usr/local/bin/g++ Main.cpp -std=c++14
#include <bits/stdc++.h>

#define INF 4000001
using namespace std;

int n, m;
struct edge {int to, co;};
vector<edge> g[100010];
int dis[100010];
set<int> disc[100010];

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		int a, b, c;
		cin >> a >> b >> c;
		g[a].push_back({b, c});
		g[b].push_back({a, c});
	}

	dis[1] = 0;
	for (int i = 2; i <= n; i++) {
		dis[i] = INF;
	}
	priority_queue<pair<int, int> > q;
	q.push({-dis[1], 1});
	while(q.size()) {
		int now = q.top().second;
		int d = -q.top().first;
		q.pop();
		if (dis[now] < d) continue;
		for (edge j : g[now]) {
			int nd = dis[now];
			if (!disc[now].count(j.co)) nd++;
			if (nd < dis[j.to]) {
				dis[j.to] = nd;
				disc[j.to].clear();
				disc[j.to].insert(j.co);
				q.push({-dis[j.to], j.to});
			} else if (nd == dis[j.to]) {
				disc[j.to].insert(j.co);
			}
		}
	}

	if (dis[n] == INF) {
		cout << -1 << endl;
	} else {
		cout << dis[n] << endl;
	}
}

Measured memory_bytes: 23412
#include<bits/stdc++.h>
    using namespace std;
    int main(){
    int a,b;
    stringstream ss;
    scanf("%d%d",&a,&b);
    ss<<a<<b;
    ss>>a;
    b=0;
    for(int i=1;i<=(int)sqrt((double)a);++i) b+=i*i==a;
    printf("%s\n",b?"Yes":"No");
    return 0;
    }

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,x,f=1,ans=0;
    vector<long long int>v;
    cin>>n;
    for(long long int i=0; i<n; i++)
    {
        cin>>x;
        v.push_back(x);
        if(x%2==1)
            f=0;
    }
    while(f!=0)
    {
        ans++;
        for(long long int i=0; i<n; i++)
        {
            v[i]=v[i]/2;
            if(v[i]%2==1)
            {
                f=0;
                break;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Scanner;

public class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> result = new ArrayList<Integer>();
        int n = sc.nextInt();
        for(int i =1;i <=n;i++ ) {
        	int count = 0;
        	for(int x =1; x*x <i;x++) {
        		for(int y =x; y*y <i;y++) {
        			for(int z =y; z*z <i;z++) {
                		int f =x*x+y*y+z*z+x*y+y*z+z*x;
                		if(f==i) {
                			if((x==y) && (y==z)) {
                				count++;
                    			break;
                			}
                			else if((x==y) || (y==z)){
                				count = count +3;
                    			break;
                			}
                			else {
                				count = count +6;
                    			break;
                			}
     
                		}
                	}
        		}
        	}
        	result.add(count);
        }
        for(int a:result) {
        	System.out.println(a);
        }
    }

}

Measured memory_bytes: 39512
#include <iostream>
#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 rep(i,n) for(int i=0;i<n;i++)
int main() {
    int N;
    cin >> N;
    vector<int> W(N);
    int sum = 0;
    rep(i,N){
        cin >> W.at(i);
        sum += W.at(i);
    }
    int mini = sum;
    int bubunnwa = 0;
    rep(i, N) {
        bubunnwa += W.at(i);
        mini = min(mini, abs(bubunnwa * 2 - sum));
    }

    cout << mini << endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(0);cin.tie(0);
#define all(v)    ((v.begin()),(v.end()))
#define sz(v)     ((int)(v.size()))
#define forv(i, v) for(int i = 0; i < sz(v); ++i)
#define forn(i,n)   for(int i = 0; i < (int)(n); i++)
using namespace std;

typedef long long       ll;
typedef long double     ld;
typedef vector<int>     vi;
typedef vector<double>  vd;
typedef vector< vi >    vii;
typedef vector< vd >    vdd;
typedef vector<string>  vs;
const int M = 305;

double dp[M][M][M];

int main()
{
	//fast;
	int n;
	scanf("%d", &n);
	int cnt1 = 0, cnt2 = 0, cnt3 = 0;
	for (int i = 0; i < n; i++) {
		int x;
		scanf("%d", &x);
		if (x == 1) cnt1++;

		if (x == 2) cnt2++;

		if (x == 3) cnt3++;
	}
	for (int c = 0; c <= n; c++) {
		for (int b = 0; b <= n; b++) {
			for (int a = 0; a <= n; a++) {

				int k = a + b + c;

				if (k == 0) continue;
				if (k > n) continue;

				dp[a][b][c] += (1.0 * n) / k;

				if (a)
					dp[a][b][c] += (1.0 * a) / k * dp[a - 1][b][c];
				if (b)
					dp[a][b][c] += (1.0 * b) / k * dp[a + 1][b - 1][c];
				if (c)
					dp[a][b][c] += (1.0 * c) / k * dp[a][b + 1][c - 1];

			}
		}
	}
	printf("%.12lf\n", dp[cnt1][cnt2][cnt3]);
	return 0;
}


Measured memory_bytes: 112624
#include<iostream>
#include <algorithm>
#define syso(s) std::cout<<s<<endl;
#define sc(i) std::cin>>i;
using namespace std;
int main() {
	int a, b, c;
	int count = 0;
	sc(a)
	sc(b)
	sc(c)
	if (a == b) {
		count++;
	}
	if (b == c) {
		count++;
	}
	if (c == a) {
		count++;
	}
	if (count == 3) {
		count--;
	}
	syso(3-count)
	return 0;
}

Measured memory_bytes: 256
/*

  "With age, comes wisdom. With travel, comes understanding.
   Remember that happiness is a way of travel – not a destination"

*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define int            long long int
#define F              first
#define S              second
#define pb             push_back
#define si             set <int>
#define vi             vector <int>
#define pii            pair <int, int>
#define vpi            vector <pii>
#define vpp            vector <pair<int, pii>>
#define mii            map <int, int>
#define mpi            map <pii, int>
#define spi            set <pii>
#define endl           "\n"
#define sz(x)          ((int) x.size())
#define all(p)         p.begin(), p.end()
#define double         long double
#define que_max        priority_queue <int>
#define que_min        priority_queue <int, vi, greater<int>>
#define bug(...)       __f (#__VA_ARGS__, __VA_ARGS__)
#define print(a)       for(auto x : a) cout << x << " "; cout << endl
#define print1(a)      for(auto x : a) cout << x.F << " " << x.S << endl
#define print2(a,x,y)  for(int i = x; i < y; i++) cout<< a[i]<< " "; cout << endl

inline int power(int a, int b)
{
     int x = 1;
     while (b)
     {
          if (b & 1) x *= a;
          a *= a;
          b >>= 1;
     }
     return x;
}

typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> Set;

template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{
     const char* comma = strchr (names + 1, ',');
     cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

const int N = 200005;
int a[N], n, m, k;

void solve()
{
     string s; cin >> s;
     if (s[0] == '7' || s[1] == '7' || s[2] == '7')
          cout << "Yes";
     else
          cout << "No";

}

int32_t main()
{
     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

     cout << setprecision(9) << fixed;
     clock_t z = clock();
     solve();
     cerr << "Run Time : " << ((double)(clock() - z) / CLOCKS_PER_SEC);

     return 0;
}

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

using namespace std;

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

#define M 2000
#define ADJUST 4000

bool ab[ADJUST*2],ac[ADJUST*2],bc[ADJUST*2];

bool match(char c1, char c2){
return (c1 == '?' || c2 == '?' || c1 == c2);
}

int main(void){
int i,j;

string a,b,c;
cin >> a >> b >> c;

int A = a.length();
int B = b.length();
int C = c.length();

REP(i,A) REP(j,B) if(!match(a[i], b[j])) ab[i-j+ADJUST] = true;
REP(i,A) REP(j,C) if(!match(a[i], c[j])) ac[i-j+ADJUST] = true;
REP(i,B) REP(j,C) if(!match(b[i], c[j])) bc[i-j+ADJUST] = true;

int ans = 3 * M;
for(i=-2*M;i<=2*M;i++) for(j=-2*M;j<=2*M;j++) if(!ab[i+ADJUST] && !ac[j+ADJUST] && !bc[j-i+ADJUST]){
    int L = min(0, min(i, j));
    int R = max(A, max(B + i, C + j));
    ans = min(ans, R - L);
}

cout << ans << endl;

return 0;
}

Measured memory_bytes: 384
#include <iostream>

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

    int i = 1;
    while(true){
        int x;
        std::cin >> x;
        if(x==0) break;
        std::cout << "Case " << i++ << ": " << x << "\n";
    }
    return 0;
}

Measured memory_bytes: 1204
# -*- coding: utf-8 -*-
n = int(input())
a=[]
for i in range(n):
  a.append(input())
count={}

for i in a:
  if i in count:
    count[i]=count[i]+1
  else:
    count[i]=1

max = 0
for k in count.keys():
  if max < count[k]:
    max=count[k]

l =[]
for k in count.keys():
  if count[k]==max:
    l.append(k)

l.sort()
for i in l:
  print(i)

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

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


Measured memory_bytes: 3612
using System;
namespace ABC
{
    public class B
    {
        static void Main()
        {
            int N = int.Parse(Console.ReadLine());
            int AC = 0;
            int WA = 0;
            int TLE = 0;
            int RE = 0;

            for (int i = 0; i < N; i++)
            {
                string S = Console.ReadLine();

                if (S == "AC")
                {
                    AC = AC + 1;
                }
                else if (S == "WA")
                {
                    WA = WA + 1;
                }
                else if (S == "TLE")
                {
                    TLE = TLE + 1;
                }
                else
                {
                    RE = RE + 1;
                }
            }
            Console.WriteLine("AC x " + AC.ToString());
            Console.WriteLine("WA x " + WA.ToString());
            Console.WriteLine("TLE x " + TLE.ToString());
            Console.WriteLine("RE x " + RE.ToString());
        }
    }
}


Measured memory_bytes: 30700
#include <bits/stdc++.h>
#define clr(x) memset(x,0,sizeof (x))
#define For(i,a,b) for (int i=(a);i<=(b);i++)
#define Fod(i,b,a) for (int i=(b);i>=(a);i--)
#define fi first
#define se second
#define kill _z_kill
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define outval(x) cerr<<#x" = "<<x<<endl
#define outv(x) cerr<<#x" = "<<x<<"  "
#define outtag(x) cerr<<"--------------"#x"---------------"<<endl
#define outarr(a,L,R) cerr<<#a"["<<L<<".."<<R<<"] = ";\
	For(_x,L,R) cerr<<a[_x]<<" ";cerr<<endl;
#define User_Time ((double)clock()/CLOCKS_PER_SEC)
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned uint;
typedef long double LD;
typedef vector <int> vi;
typedef pair <int,int> pii;
LL read(){
	LL x=0,f=0;
	char ch=getchar();
	while (!isdigit(ch))
		f=ch=='-',ch=getchar();
	while (isdigit(ch))
		x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return f?-x:x;
}
//const int mod=1e9+7;
//int Pow(int x,int y){
//	int ans=1;
//	for (;y;y>>=1,x=(LL)x*x%mod)
//		if (y&1)
//			ans=(LL)ans*x%mod;
//	return ans;
//}
//void Add(int &x,int y){
//	if ((x+=y)>=mod)
//		x-=mod;
//}
//void Del(int &x,int y){
//	if ((x-=y)<0)
//		x+=mod;
//}
//int Add(int x){
//	return x>=mod?x-mod:x;
//}
//int Del(int x){
//	return x<0?x+mod:x;
//}
void ckmax(int &x,int y){
	if (x<y)
		x=y;
}
void ckmin(int &x,int y){
	if (x>y)
		x=y;
}
int main(){
	string s;
	cin>>s;
	string t;
	For(i,0,2)
		t+=s[i];
	cout<<t<<endl;
	return 0;
}

Measured memory_bytes: 3476
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;



int main(void){
	ll N,a[100010],four=0,two=0;
	cin>>N;
	rep(i,N){
		cin>>a[i];
		if(a[i]%4==0){
			four++;
		}else if(a[i]%2==0){
			two++;
		}
	}
	if(four>=N/2){
		cout<<"Yes"<<endl;
	}else if(four*2+two>=N){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}


	return 0;
}

Measured memory_bytes: 1024
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let h: usize = read();
    let w: usize = read();
    let n: usize = read();
    let mut a: Vec<usize> = vec![];
    let mut map: Vec<Vec<String>> = vec![vec!["0".to_string(); w]; h];
    for _ in 0..n {
        let ai = read();
        a.push(ai);
    }

    let mut is_rev = false;
    let mut colors = vec![];
    for i in 0..a.len() {
        let ai = a[i];
        for _ in 0..ai {
            colors.push(i + 1);
        }
    }

    let mut idx = 0;
    for hi in 0..h {
        if is_rev {
            for wi in (0..w).rev() {
                map[hi][wi] = colors[idx].to_string();
                idx += 1;
            }
        } else {
            for wi in 0..w {
                map[hi][wi] = colors[idx].to_string();
                idx += 1;
            }
        }
        is_rev = !is_rev;
    }
    for i in map {
        println!("{}", i.join(" "));
    }
}


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

using namespace std;
 
int judge(char c){
    char right[12]={'y','h','n','u','j','m','i','k','o','l','p'};
     
    for(int i = 0 ; i < 11 ; i++){
        if(c == right[i]) return 1;
    }
    return 0;
}
 
int main(void){
    string str;
     
    while(1){
        int cnt = 0;
        cin >> str;
        if(str == "#") break;
 
        for(int i = 1 ; i < str.size() ; i++){
            if(judge(str[i-1]) != judge(str[i])) cnt++;
        }    
        cout << cnt << endl;
    }   
    return 0;
}

Measured memory_bytes: 3116
N=int(input())
P=list(map(int,input().split()))
Q=list(map(int,input().split()))

c=0
def dfs(X):
  global a,b,c
  if len(X)==N:
    c+=1
    if X==P:
      a=c
    if X==Q:
      b=c
  else:
    for i in range(1,N+1):
      if i not in X:
        X.append(i)
        dfs(X)
        X.remove(i)

dfs([])
print(abs(a-b))

Measured memory_bytes: 3188
use std::io::stdin;

fn main(){
    let c = getline().chars().nth(0);
    println!("{}", match c{
        Some('a')=> "vowel",
        Some('i')=> "vowel",
        Some('u')=> "vowel",
        Some('e')=> "vowel",
        Some('o')=> "vowel",
         _  => "consonant"
    });
}

#[allow(dead_code)]
fn getline() -> String {
    let mut s = String::new();
    match stdin().read_line(&mut s){
        Ok(_) => {s.trim().to_string()}
        Err(_) => String::new()
    }
}

#[allow(dead_code)]
fn getvec() -> Vec<i64>{
    let line = getline();
    line.split_whitespace().map(|x| x.parse().unwrap()).collect()
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define int ll
#define MOD (ll)(1e9+7)
using namespace std;
using ll=long long;
using pii=pair<int,int>;

int32_t main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int a,b,c; cin>>a>>b>>c;
	cout<<min(c,a*b)<<'\n';
	return 0;
}

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

int main() {
  int W, H, x, y, r;
  cin >> W >> H >> x >> y >> r;

  if (x - r >= 0 && x + r <= W ) {
    if (0 <= y - r && y + r <= H) {
      cout << "Yes" << endl;
    }
    else {
      cout << "No" << endl;
    }
  }
  else {
    cout << "No" << endl;
  }
}



Measured memory_bytes: 3104
#include <bits/stdc++.h>
#define INF 1000000000
#define ll long long
#define pll pair<ll, ll>
using namespace std;

//=============z_algorithm============================
ll z_algorithm(string S)
{
  vector<ll> Z(S.size(), 0);
  ll res = 0;
  ll i = 1, j = 0;
  while (i < S.size())
  {
    while (i+j < S.size() && S[j] == S[i+j]) ++j;
    Z.at(i) = j;
    if (i >= j)
    {
      res = max(res, j);
    }
    if (j == 0) { ++i; continue;}
    ll k = 1;
    while (i+k < S.size() && k+Z.at(k) < j) Z.at(i + k) = Z.at(k), ++k;
    i += k; j -= k;
  }
  return res;
}
//=================================================

int main()
{
  ll N;
  cin >> N;
  string S;
  cin >> S;
  ll ans = 0;
  for (ll i = 0; i < N; ++i)
  {
    ll temp = z_algorithm(S.substr(i, S.size() - i));
    ans = max(ans, temp);
    // cout << ans << endl;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream> //入出力
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#include <math.h> //算術演算子
#include <vector>
#include <cstdlib>
#include <queue>
#include <stack>
#include <list>
#include <iomanip> //小数点以下を表示させる(setprecision())
// #include <bits/stdc++.h>
using namespace std;
typedef long long ll; //64bit型

#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n'
#define PRINT(V)                                   \
        {                                          \
                for (int i = 0; i < V.size(); i++) \
                {                                  \
                        cout << V[i] << " ";       \
                }                                  \
                cout << endl;                      \
        }

int gcd(int a, int b)
{
        return b ? gcd(b, a % b) : a;
}
string trans(int N)
{
        string S;
        while (N != 0)
        {
                if (N % 2 == 1)
                {
                        N--;
                        S = '1' + S;
                }
                else
                {
                        S = '0' + S;
                }
                N /= 2;
        }
        return S;
}

int main() //input->compute->output
{
        string S;
        cin >> S;

        map<char, int> mp;
        for (int i = 0; i < S.size(); i++)
        {
                mp[S[i]]++;
        }

        bool ok=true;
        for(auto itr:mp){

                if(itr.second!=1){
                        ok=false;
                }
        }
        if(ok){
                cout<<"yes"<<endl;
        } else{
                cout<<"no"<<endl;
        }

        return 0;
}


Measured memory_bytes: 256