akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 
using namespace std;
 
#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define RSORT(x) sort((x).rbegin(),(x).rend())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define chmax(x,y) x = max(x,y)

 
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int> > VVI;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<bool> VB;
typedef vector<LL> VL;
typedef vector<vector<long long>> VVLL;
typedef vector<set<int>> VSI;
const int MOD = 1e9+7;
const int INF = 1e9;
const LL LINF = 1e18;
int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

int lcm(int a, int b)
{
   return a * b / gcd(a, b);
}


int main() {
    int n,x,t;
    cin >> n >> x >> t;
    int ans = 0;
    while(n>0) {
        ans += t;
        n -= x;
    }

    cout << ans << endl;
}


Measured memory_bytes: 3616
#include <iostream>
#include <cmath>
#include <vector>
#include <string>

int main(int argc, char *argv[])
{
    int n, m;
    std::vector<int> p;
    std::vector<bool> ac;

    std::cin >> n >> m;

    p.resize(m);
    ac.resize(m);

    for (int i = 0; i < m; i++) {
        std::string s;
        std::cin >> p[i] >> s;
        ac[i] = (s == "AC");
    }

    std::vector<bool> problemAccepted(n, false);
    std::vector<int> problemPenalty(n, 0);

    for (int i = 0; i < m; i++) {
        const int problemId = p[i] - 1;
        const bool submissionAccepted = ac[i];
        if (! problemAccepted[problemId]) {
            if (submissionAccepted) {
                problemAccepted[problemId] = true;
            } else {
                problemPenalty[problemId]++;
            }
        }
    }

    int penalty = 0;
    int acCount = 0;
    for (int i = 0; i < n; i++) {
        if (problemAccepted[i]) {
            acCount++;
            penalty += problemPenalty[i];
        }
    }

    std::cout << acCount << " " <<penalty << std::endl;

    return 0;
}


Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define dbg(x) cout << #x << '=' << x << '\n';
#define ll long long
#define pi pair<int,int>
#define pl pair<long long,long long>
#define lg length()
#define pb push_back
ifstream in("file.in");
ofstream out("file.out");
#define MAXN 100005
#define INF 1000000005
#define LINF 1000000000000000005

struct nibab{
    long long x,y,z;
} a[100005];

long long x,y,z,p[100005],q[100005],t,u[100005],v[100005],ans;

multiset <long long> s;

bool comp(nibab a, nibab b){
    return (a.x-a.y)>(b.x-b.y);
}

int32_t main(){
    ios_base :: sync_with_stdio(0);
    cin >> x >> y >> z;
    for(int i=1;i<=x+y+z;i++){
        cin >> a[i].x >> a[i].y >> a[i].z;
    }
    sort(a+1,a+x+y+z+1,comp);
    for(int i=1;i<=x+y+z;i++){
        p[i]=a[i].x-a[i].z;
        q[i]=a[i].y-a[i].z;
    }
    for(int i=1;i<=x;i++){
        s.insert(p[i]);
        p[i]+=p[i-1];
        u[i]=u[i-1]+a[i].z;
    }
    for(int i=x+1;i<=x+y+z;i++){
        t=*(s.begin());
        if(p[i]<=t) p[i]=p[i-1];
        else s.erase(s.begin()),s.insert(p[i]),p[i]+=p[i-1]-t;
        u[i]=u[i-1]+a[i].z;
    }
    s.clear();
    for(int i=1;i<=y;i++){
        s.insert(q[x+y+z-i+1]);
        q[x+y+z-i+1]+=q[x+y+z-i+2];
        v[x+y+z-i+1]=v[x+y+z-i+2]+a[x+y+z-i+1].z;
    }
    for(int i=y+1;i<=x+y+z;i++){
        t=*(s.begin());
        if(q[x+y+z-i+1]<=t) q[x+y+z-i+1]=q[x+y+z-i+2];
        else s.erase(s.begin()),s.insert(q[x+y+z-i+1]),q[x+y+z-i+1]+=q[x+y+z-i+2]-t;
        v[x+y+z-i+1]=v[x+y+z-i+2]+a[x+y+z-i+1].z;
    }
    for(int i=x;i<=x+z;i++){
        ans=max(ans,u[i]+p[i]+v[i+1]+q[i+1]);
    }
    cout << ans;
}


Measured memory_bytes: 10112
import itertools
n=int(input())
l=list(map(int,input().split()))
L=list(itertools.combinations(l,3))
cnt=0
for i in range(len(L)):
  j=0
  ll=L[i]
  for k in range(3):
    if len(set(list(ll)))!=3:
      j+=1
      break
    if abs(ll[k]-ll[(k+1)%3])<ll[(k+2)%3]<ll[k]+ll[(k+1)%3]:
      j=j
    else:
      j+=1
      break
  if j==0:
    cnt+=1
print(cnt)

Measured memory_bytes: 87452
#include <iostream>
#include <set>
#include <stack>
#include <vector>
#include <algorithm>
using namespace std;

typedef pair<int,int> P;
class Circle;
const int MAX_N=24;

struct Circle{
     int x;
     int y;
     int r;
     set<int> ons;
};

bool iscover(Circle a,Circle b){
     int dist=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
     return (a.r+b.r)*(a.r+b.r)>dist;
}
vector<Circle> clist;
int map[MAX_N];//ãÉæÁÄé~Ì
int color[MAX_N];
int maxdel=0,del=0;
int N;
bool used[MAX_N];
int map_c[4];

void delc(int n){
     for(int i=0;i<N;i++){
	  if(clist[i].ons.find(n)!=clist[i].ons.end()){
	       --map[i];
	  }
     }
     used[n]=true;
     ++del;maxdel=max(maxdel,del);
}
void revc(int n){
     for(int i=0;i<N;i++){
	  if(clist[i].ons.find(n)!=clist[i].ons.end()){
	       ++map[i];
	  }
     }
     used[n]=false;
     --del;
}

void firstdel(){
     vector<int> dellist[4];
     for(int i=0;i<N;i++){
	  if(map_c[color[i]]==0){
	       //cout<<"c"<<color[i]<<endl;
	       dellist[color[i]].push_back(i);
	  }
     }
     for(int k=0;k<4;k++){
	  if(dellist[k].size()<2)continue;
	  for(int i=0;i<(dellist[k].size()-1);i+=2){
	       delc(dellist[k][i]);delc(dellist[k][i+1]);
	       //cout<<"i"<<i<<endl;
	       
	  }
     }
     //cout<<"#"<<endl;
}

void dfs(int n1,int n2){
     delc(n1);delc(n2);
     //stack<P> sta;
     vector<int> freecir[4];
     for(int i=0;i<N;i++){
	  if(map[i]==0&&(!used[i]))freecir[color[i]].push_back(i);
     }
     for(int k=0;k<4;k++){
	  for(int i=0;i<freecir[k].size();i++){
	       for(int j=i+1;j<freecir[k].size();j++){
		    dfs(freecir[k][i],freecir[k][j]);
		    //cout<<freecir[k][i]<<freecir[k][j]<<endl;
	       }
	  }
     }
     revc(n1);revc(n2);
     return;
}

void solve(){
     firstdel();
     vector<int> freecir[4];
     for(int i=0;i<N;i++){
	  if(map[i]==0&&!used[i]){
	       freecir[color[i]].push_back(i);
	       //cout<<color[i]<<":"<<i<<endl;
	  }
     }
     //cout<<"#"<<endl;
     for(int k=0;k<4;k++){
	  for(int i=0;i<freecir[k].size();i++){
	       for(int j=i+1;j<freecir[k].size();j++){
		    dfs(freecir[k][i],freecir[k][j]);
		    //cout<<freecir[k][i]<<freecir[k][j]<<endl;
	       }
	  }
     }
     //cout<<"#"<<endl;
     return;
}
	  

int main(){
     while(cin>>N,N){
	  clist.clear();
	  for(int i=0;i<N;i++){
	       map[i]=0;
	       color[i]=0;
	       used[i]=false;
	  }
	  maxdel=0;
	  del=0;
	  map_c[0]=map_c[1]=map_c[2]=map_c[3]=0;
	  
	  for(int i=0;i<N;i++){
	       Circle c;
	       int col;
	       cin>>c.x>>c.y>>c.r>>col;
	       col--;//1~4->0~3
	       color[i]=col;
	       for(int j=0;j<clist.size();j++){
		    if(iscover(c,clist[j])){
			 c.ons.insert(j);
			 map[i]++;
			 map_c[color[i]]++;
			 map_c[color[j]]++;
			 //cout<<i<<":"<<j<<endl;
		    }
	       }
	       clist.push_back(c);
	  }
	  solve();
	  cout<<maxdel<<endl;
     }
}

Measured memory_bytes: 0
#include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1000000000
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};

int main (){ 
    int a,b,c;
    cin>>a>>b>>c;
    int ans=0;
    if(a/2<b){
        ans+=c/1000*a;
        c%=1000;
    }else {
        ans+=c/500*b;
        c%=500;
    }
    if(c==0){
        cout<<ans<<endl;
        return 0;
    }
    if(c<=500){
        ans+=(a>b)?b:a;
    }else {
        ans+=a;
    }
    cout<<ans<<endl;
}


/*
abcdea

/root
a.txt
bunp.html
/desktop
r.txt
fsharp.cs
dp.cpp
/users
bison.txt

root r.txt
users r.txt
users a.txt

desktop/r.txt
../r.txt
../../a.txt
*/



Measured memory_bytes: 3096
/*
   Author: Shivam Shukla
*/
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pair<ll,ll> > vpll;
 
const int MOD=1e9+7;
const int MAX=1e5+5;
const double PI= acos(-1.0);
const long double EPS=1e-10;
const int64_t INF=1e18+10;
 
#define fastio() ios_base::sync_with_stdio(false);cin.tie(0), cout.tie(0)
#define trace(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vi vector<int>
#define vl vector<ll>
#define vs vector<str>
#define vc(x) vector<x>
#define mapll map<ll,ll>
#define mapib map<int,bool>
#define mapiv map<int,vector>
#define mapsi map<string,int>
#define rep(i,j,k) for(ll i=j;i<k;i++)
#define down(i,j,k) for(ll i=j;i>=k;i--)
#define repa(i,n) for(ll i=0;i<n;i++)
#define dowa(i,n) for(ll i=n;i>=0;i--)
#define reps(i,j,k,s) for(ll i=j;i<k;i+=s)
#define downs(i,j,k,s) for(ll i=j;i>=k;i-=s)
#define trv(i,x) for(auto i:x)
#define pb push_back
#define eb emplace_back
#define sz(x) (int)x.size()
#define ff first
#define ss second
#define str string 
#define dub double
#define pqmax priority_queue<ll>
#define pqmin priority_queue<ll,vl,greater<ll> >
#define INF(x) numeric_limits<x>::max()
 
template<typename t> t lcm(t a, t b) {return (a*b)/__gcd(a,b);}
template<typename t> t gcd(t a, t b) {return __gcd(a,b);}
template<typename t> t mul_mod(t a, t b, t m){t res=((a%m)*(b%m)%m); return res;}
template<typename t> t add_mod(t a, t b, t m){t res=((a%m)+(b%m))%m; return res;}
template<typename t> t pow_mod(t a,t b,t m) {t res=1;while(b){if(b&1) res=mul_mod(res,a,m);a=mul_mod(a,a,m), b>>=1;} return res%m;}
template<typename t> vc(t) num_vec(t num) {t res; while (num) res.pb(num%10), num/=10; return res;}
template<typename t> t vec_num(t vec) {t res=0; ll mul=1; repa(i,sz(vec)) res=vec[i]*mul, mul*=10; return res;}
 

int32_t main(int argc,char** argv){
    fastio();
    auto tstart= clock();
 
    #ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
      freopen("error.txt","w",stderr);
    #endif   

    int n; cin >> n;
    vc(vl) a(n, vl(3)), dp(n, vl(3));

    repa(i, n) 
       cin >> a[i][0] >> a[i][1] >> a[i][2];
     

    dp[0] = a[0];
    rep(i, 1, n) {
        repa(j, 3) {
           dp[i][j] = -INF(ll);
           repa(k, 3) 
                if (j != k)
                    dp[i][j] = max(dp[i][j], a[i][j] + dp[i - 1][k]);
        }            
    }

    ll mx = -INF(ll);
    repa(i, 3)
      mx = max(dp[n - 1][i], mx);

    cout << mx << endl;

    cerr << setprecision(2) << fixed<<"Time elapsed: " << (double)(clock() - tstart)/CLOCKS_PER_SEC << endl; 
    return 0; 
}

Measured memory_bytes: 14260
n,k = map(int,input().split())
s = input()

if s[k-1] =='A':
  s2 = 'a'
elif s[k-1] =='B':
  s2 = 'b'
else:
  s2 = 'c'
  
if k == 1:
  print(s2+s[1:n])
elif k == n:
  print(s[:k-1]+s2)
else:
  print(s[:k-1]+s2+s[k:n])

Measured memory_bytes: 3064
package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

// Sort
type Val struct {
	id, num int
}
type ByNum []Val

func (a ByNum) Len() int           { return len(a) }
func (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }
func (a ByNum) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	x, a, b := sc.nextInt(), sc.nextInt(), sc.nextInt()

	if abs(x-a) < abs(x-b) {
		fmt.Fprintln(wtr, "A")
	} else {
		fmt.Fprintln(wtr, "B")
	}
	wtr.Flush()
}


Measured memory_bytes: 640
n = int(input())
w = list(map(int, input().split()))

l = [0 for _ in range(n-1)]
r = [0 for _ in range(n-1)]

l[0] = w[0]
r[n-2] = w[n-1]
for i in range(1, n-1):
  l[i] = l[i-1] + w[i]
  r[n-2-i] = r[n-1-i] + w[n-1-i]
  
#print(l, r)

res = 10000
for i in range(n-1):
  d = l[i] - r[i] if l[i] > r[i] else r[i] - l[i]
  res = min(res, d)
print(res)

Measured memory_bytes: 3064
#include <stdio.h>
int main(void){
	int a,b[1001],c,i,j,x,k;
	scanf("%d",&a);
	for(i=0;i<a;i++)
		scanf("%d",&b[i]);
	for(i=0;i<a;i++){
		if(i==0)
			goto out;
		for(j=i-1;j>=0;j--){
			if(b[j] > b[j+1]){
				c = b[j];
				b[j] = b[j+1];
				b[j+1] = c;
			}
		}
		out:
		for(k=0;k<a;k++){
			printf("%d",b[k]);
			if(k!=a-1)
				printf(" ");
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 604
#include<stdio.h>
int main(){
int W,H,x,y,r;
scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
if(x-r<0 || x+r>W || y-r<0 || y+r>H){
printf("No\n");
}else{
printf("Yes\n");
}
return 0;
}

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;

void Main()
{
	int n;
  	cin >> n;
  	if(n<=999) puts("ABC");
    else puts("ABD");
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}


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

int n,tp,cnt[256];
char ans[100005];
string s[100005];

int main()
{
    cin>>n>>cnt['A']>>cnt['B']>>cnt['C'];
    for(int i=1;i<=n;i++)
    {
        cin>>s[i];
        if(s[i][0]>s[i][1]) swap(s[i][0],s[i][1]);
    }
    for(int i=1;i<=n;i++)
    {
        if(cnt[s[i][0]]+cnt[s[i][1]]==0) return printf("No"),0;
        if(cnt[s[i][0]]==0||cnt[s[i][1]]==0)
        {
            if(cnt[s[i][1]]==0) swap(s[i][0],s[i][1]);
            ans[i]=s[i][0];
            cnt[s[i][0]]++,cnt[s[i][1]]--;
            continue;
        }
        if(i==n||(s[i+1][0]==s[i][0])+(s[i+1][1]==s[i][0])==1)
            ans[i]=s[i][0],cnt[s[i][0]]++,cnt[s[i][1]]--;
        else
            ans[i]=s[i][1],cnt[s[i][1]]++,cnt[s[i][0]]--;
    }
    printf("Yes\n");
    for(int i=1;i<=n;i++) printf("%c\n",ans[i]);
    return 0;
}


Measured memory_bytes: 6996
#include<bits/stdc++.h>
using namespace std;
const int MAXN=3000+20;
int dp[MAXN][MAXN],d[MAXN][MAXN];
string a,b;
int la,lb;
void output(int x,int y) {
//	cout<<x<<' '<<y<<'\n';
	if(d[x][y]==1) {
		output(x-1,y-1);
		cout<<a[x];
	}
	if(d[x][y]==2) output(x-1,y);
	if(d[x][y]==3) output(x,y-1);
}
int main() {
	cin>>a>>b;
	la=a.size(),lb=b.size();
//	cout<<la<<' '<<lb<<'\n';
	a=' '+a,b=' '+b;
//	cout<<a<<'\n'<<b<<'\n';
	for(int i(1); i<=la; ++i) {
		for(int j(1); j<=lb; ++j) {
			if(a[i]==b[j]) {
				dp[i][j]=dp[i-1][j-1]+1;
				d[i][j]=1;
			} else {
				if(dp[i-1][j]>dp[i][j-1]) {
					dp[i][j]=dp[i-1][j];
					d[i][j]=2;
				} else {
					dp[i][j]=dp[i][j-1];
					d[i][j]=3;
				}
			}
		}
	}
//	cout<<dp[la][lb]<<'\n';
//	for(int i(0);i<=la;++i)
	if(dp[la][lb]) output(la,lb);
	cout<<'\n';
	return 0;
}

Measured memory_bytes: 74656
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		long A = long.Parse(str[0]);
		long B = long.Parse(str[1]);
		string ans = "NO";
		if((A+1)/B>=2){
			ans = "YES";
		}
		Console.WriteLine(ans);
	}
}

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

int main(){
	int N , sum;
  	cin >> N;
    for(int i = 1 ; i <= N ; i*=10){
      	sum += N / i % 10;
	}
  	if (N % sum == 0)
      cout << "Yes" << endl;
  	else
      cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(false)
vector<long long int>v,v1;
long long int a[2000000], b[2000000];
int main()
{
    IO;
    long long int j, n, m, k=0, l, i;
    for(i=0; i<10; i++){
            v.push_back(i); a[i]=i; b[i]=10;
    }
    n=0; m=10;
    while(m<1e6){
            k=0;
        for(i=n; i<m; i++){
            l=a[i]*b[i] + v[i];
            v.push_back(l); k++;
            a[m+k-1]=a[i]; b[m+k-1]=b[i]*10;

            if(a[i]>0){
            l=(a[i]-1)*b[i] + v[i];
            v.push_back(l); k++;
            a[m+k-1]=a[i]-1; b[m+k-1]=b[i]*10;
            }
            if(a[i]!=9){
                l=(a[i]+1)*b[i] + v[i];
            v.push_back(l); k++;
            a[m+k-1]=a[i]+1; b[m+k-1]=b[i]*10;
            }
        }
        n=m; m+=k;
    }
    n=v.size();sort(v.begin(),v.end());
    for(i=0; i<n; i++){
        if(v[i]!=v[i+1]) v1.push_back(v[i]);
    }
    cin>>n; cout<<v1[n]<<endl;
    return 0;
}



Measured memory_bytes: 72420
#include <stdio.h>
#include <math.h>
int main(){
	double a,b,c;
	double PI=acos(-1);
	scanf("%lf %lf %lf",&a,&b,&c);
	c/=180.0;
	c*=PI;
	printf("%lf\n%lf\n%lf\n",a*b*0.5*sin(c),a+b+sqrt(a*a+b*b-2.0*a*b*cos(c)),a*b*sin(c)/a);
	return 0;
}



Measured memory_bytes: 2088
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[9]={1,0,-1,0,1,1,-1,-1,0};
const ll dx[9]={0,-1,0,1,1,-1,1,-1,0};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

int main(){
    ll a,b,c;cin >> a >> b >> c;
    rep(i,2*b){
        if((a*i)%b==c){
            cout <<"YES" <<endl;
            return 0;
        }
    }
    cout <<"NO" <<endl;
} 

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <algorithm>

#include <bits/stdc++.h>
#include <cmath>
#include <limits>

using namespace std;
typedef long long LL;
using Graph = vector<vector<int>>;

static long long INF = (1LL<<62);

int main(int argc, char* argv[]){
	cin.tie(0);
	ios::sync_with_stdio(false);

	LL N, D;
	cin >> N >> D;

	LL ans = 0;
	for(int i=0; i<N; i++){
		LL x, y;
		cin >> x >> y;
		if(x*x + y*y <= D*D){
			ans++;
		}
	}

	printf("%lld\n", ans);
	return 0;

}


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

int main(int argc, char const *argv[])
{
	int a,b;
	cin>>a>>b;

	int num=1;
	int count=0;

	while(1)
	{
		if(num>=b)break;
		num+=(a-1);
		count++;
	}
	cout<<count<<endl;
	return 0;
}

Measured memory_bytes: 256
import sys
import copy
import math
import itertools
import numpy as np

l = [int(c) for c in input().split()]
a = l[0]
b = l[1]
c = l[2]
d = l[3]
x = c - a
y = d - b
print(c-y,d+x,a-y,b+x)


Measured memory_bytes: 27108
private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main(args: Array<String>) {
    println(readLn().map { 'x' }.joinToString(""))
}

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

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

long long MOD = 10000000000 + 7;
// modint
const ll mod = 1e9+7;
template< int mod >
struct ModInt {
  int x;
  ModInt() : x(0) {}
  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
  ModInt &operator+=(const ModInt &p) {
    if((x += p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt &operator-=(const ModInt &p) {
    if((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt &operator*=(const ModInt &p) {
    x = (int) (1LL * x * p.x % mod);
      return *this;
  }
  ModInt &operator/=(const ModInt &p) {
    *this *= p.inv();
    return *this;
  }
  ModInt operator-() const { return ModInt(-x); }
  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
  bool operator==(const ModInt &p) const { return x == p.x; }
  bool operator!=(const ModInt &p) const { return x != p.x; }
    
  ModInt inv() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }
  
  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while(n > 0) {
      if(n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }
  
  friend ostream &operator<<(ostream &os, const ModInt &p) {
    return os << p.x;
  }
  
  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt< mod >(t);
    return (is);
  }
  
  static int get_mod() { return mod; }
};
 
using mint = ModInt<mod>;

int main(){
  cout << setprecision(10);
  int N,M; cin >> N >> M;
  vector<int> S(N), T(M);
  for(int i = 0; i < N; i++){
    cin >> S[i];
  }
  for(int j = 0; j < M; j++){
    cin >> T[j];
  }

  mint dp[N+1][M+1];
  mint s[N+2][M+2];

  for(int i = 0; i < N+1; i++){
    for(int j = 0; j < M+1; j++){
      if(i+j == 0){
        dp[i][j] = 1;
      } else {
        dp[i][j] = 0;
      }
      if(i==1 || j == 1){
        s[i][j] = 1;
      }
    }
  }
   

  for(int i = 1; i <= N; i++){
    for(int j = 1; j <= M; j++){
      if(S[i-1] == T[j-1]){
        dp[i][j] = s[i][j];
        s[i+1][j+1] = s[i+1][j] + s[i][j+1] - s[i][j] + dp[i][j];
      } else {
        dp[i][j] = 0;
        s[i+1][j+1] = s[i+1][j] + s[i][j+1] - s[i][j] + dp[i][j];
      }
    }
  }




  cout << s[N+1][M+1] + 2 << endl;
}


Measured memory_bytes: 34876
#include<bits/stdc++.h>
using namespace std;
#define tezi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define loop(i,a,b) for(int i=a;i<b;i++)
#define all(c) c.begin(),c.end()
#define ll long long
#define ull unsigned long long
#define traverse(c,it) for(auto it=c.begin();it!=c.end();it++)
#define lowerb(v,a) lower_bound(v.begin(),v.end(),a)
#define lowerbarr(v,n,a) lower_bound(v,v+n,a)
#define upperb(v,a) upper_bound(v.begin(),v.end(),a)
#define upperbarr(v,n,a) upper_bound(v,v+n,a)
#define maxval(v) max_element(v.begin(),v.end())
#define maxarr(v,n) max_element(v,v+n)
#define minval(v) min_element(v.begin(),v.end())
#define minarr(v,n) min_element(v,v+n)
#define sz(a) (ll)a.size()
#define f first
#define s second
#define PI 3.1415926536
#define mem0(v) memset(v,0,sizeof(v))
#define memf(v) memset(v,false,sizeof(v))
#define memt(v) memset(v,true,sizeof(v))
#define mem(v,a) memset(v,a,sizeof(v))
#define npos string::npos
#define MAX 1000000
#define MOD 1000000007
                   /**************SIEVE****************/

bool prime[MAX+1];
vector<ll> v;
void sieve(){ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true.
   
    memset(prime, true, sizeof(prime)); 
  
    for (long p=2; p*p<=MAX; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (long i=p*p; i<=MAX; i += p) 
                prime[i] = false; 
        } 
    } 
  for(int i=0;i<=MAX;i++)if(prime[i])v.pb(i);
  
   
    
   
} 
 
                                        /**************gcd****************/

ll gcd(ll a,ll b) 
{ if(a>b)swap(a,b);
    if (a == 0) 
        return b; 
 return gcd(b%a, a); 
}
 
 
 
                                         /**************POWER****************/
 ull binpow(ll a, ll b) {
    if (b == 0)
        return 1;
    ll res = binpow(a, b / 2)%MOD;
    if (b % 2)
        return ((ull)res * (ull)res * (ull)a)%MOD;
    else
        return ((ull)res * (ull)res)%MOD;
}
   

 
 
 
 
                                     /**************MAIn****************/


int main()
{   tezi
  #ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("put.txt","w",stdout);
  #endif

  int T=1;
  //cin>>T;
  while(T--)
  {ll n;
    cin>>n;
      ull ans=0;
     for(ll c=1;c<n;c++)
     {ll curr=1;
      ll temp=n-c;
      if(temp==1){ans++;continue;}
       
      for(int j=2;j*j<=temp;j++)
      {
        if(temp%j==0)
        {int p=0;
          while(temp%j==0)
          {
             p++;temp/=j;
          }
          curr*=(p+1);
        
        }
      }
      if(temp!=1)curr*=2;
      ans+=curr;



     }
     cout<<ans;
    
  
 
    
  
}
 
 cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
}  
 
 
 
 
 
  
 
 

Measured memory_bytes: 3808
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
      return Array.new(size1){init}
  else
      return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

s=get_nsp
t=get_nsp
N=s.size
M=t.size
res=s.dup
is_change=false
(N-M+1).times do|i|
    flag=true
    M.times do|j|
      unless res[N-1-i-j]==t[M-1-j] or res[N-1-i-j]=="?"
        flag=false
        break 
      end
    end
    if flag
      M.times do|j|
          res[N-1-i-j]=t[M-1-j]
      end 
      is_change=true
      break
    end
end
unless is_change
  puts "UNRESTORABLE"
  exit
end
N.times do|i|
  if res[i]=="?"
      res[i]="a"
  end
end
puts res.join("")

Measured memory_bytes: 14332
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d,i,e,f,g,n,m,k,l,q,x;
map <long long,long long> mp,mp1;

int main() {
           cin>>n>>m;
           a=n/m;
           if(n%m!=0) a++;
           cout<<a;
}

Measured memory_bytes: 256
N = int(input())
num = {}
num['AC'] = 0
num['WA'] = 0
num['TLE'] = 0
num['RE'] = 0
for i in range(N):
    s = input()
    num[s] += 1
for key, value in num.items():
    print('{} x {}'.format(key, value))

Measured memory_bytes: 69864
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

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

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)

int main()
{
  int n;
  cin>>n;
  map<string, int> name;
  string s, t;
  cin >> s;
  name[s] = 1;

  bool ans = true;
  for (int i=0; i < n - 1; i++)
  {
    cin >> t;
    if (!(name[t]==0 && t[0] == s[s.length() - 1]))
    {
      ans = false;
    }
    name[t] = 1;
    s = t;
  }
  if(ans)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

  return 0;
}


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

int main()
{
    int n,k;cin >> n >> k;
    vector<int> fruit(n);
    for (int i=0;i<n;i++)
    {
        cin >> fruit[i];
    }
    vector<vector<int>> dp(n+1,vector<int> (k+1,INF));
    dp[0][0]=0;
    for (int i=1;i<n+1;i++)
    {
        for (int j=0;j<k+1;j++)
        {
            if (j>0)
            {
                dp[i][j]=min(dp[i-1][j],dp[i-1][j-1]+fruit[i-1]);
            }
            else
            {
                dp[i][j]=dp[i-1][j];
            }
        }
    }
    cout << dp[n][k]<< endl;
    return 0;
}

Measured memory_bytes: 7556
#include <bits/stdc++.h>
#define DB(x) cerr << __LINE__ << ": " << #x << " = " << (x) << endl
#define ll long long
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	cout.tie(NULL);

	ll s;
	cin >> s;
	set<ll> x;
	ll ans = 1;
	while(x.find(s) == x.end()) {
		x.insert(s);
		++ans;
		if(s&1) {
			s = 3*s + 1;
		}
		else {
			s /= 2;
		}
	}	
	cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define f first
#define s second
#define mod 1000000007
#define N 500043
#define mp(a,b) make_pair(a,b)
#define loop(a,b) for(int i=a;i<b;i++)
#define test int t; cin >> t; while(t--)
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,m;
    cin >> n >> m;
    vector<string>vec(n);
    for(int i=0;i<n;i++)
        cin >> vec[i];
    vector<vector<ll>>dp(n,vector<ll>(m,0));
    dp[0][0]=1;
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            if(vec[i][j]=='.'){
                if(i>0){
                    dp[i][j]=(dp[i][j]+dp[i-1][j])%mod;
                }
                if(j>0){
                    dp[i][j]=(dp[i][j]+dp[i][j-1])%mod;
                }
            }
        }
    }
    cout << dp[n-1][m-1]%mod;
}


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

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#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 range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 29;

int n;
int pw;
int vw[100010];
int pf[100010];
int vf[100010];
int th[100010];


double check(double water){
	double res=0.0;
	rep(i,n){
		double fi=max(0.0,1.0*(th[i]-1.0*water*vw[i])/vf[i]);
		res+=pf[i]*fi;
	}
	res+=water*pw;
	return res;
}


int main(void){

	while(1){
		cin >> n;
		if(n==0)
			break;

		cin >> pw;

		rep(i,n) cin >> vw[i]  >> pf[i] >> vf[i] >> th[i];

		double l=0.0,r=inf;

		rep(loop,200){
			if(check((2.0*l+r)/3.0) < check((l+2.0*r)/3.0) )
				r=(l+2.0*r)/3.0;
			else
				l=(2.0*l+r)/3.0;
		}

		double ans=check((l+r)*0.5);

		cout.precision(9);
		cout << fixed << ans << endl;

	}
	return 0;
}

Measured memory_bytes: 2796
n = int(input())
list = list(map(int, input().split()))
list.reverse()

# joinで半角スペースで結合して出力
# print(" ".join(map(str, list)))

# enumerate関数でインデックスとその値を取得する
for i, elem in enumerate(list):
    if i > 0:
        print(" ", end="")
    print(elem, end="")
print()



Measured memory_bytes: 5616
#include<cstdio>
#include<map>
#include<set>
#include<algorithm>
#include<vector>
#include<iostream>
#include<queue>
using namespace std;
const int dx[]={0,1,1,-1,-1,0};
const int dy[]={1,1,0,0,-1,-1};
struct data{
    int y,x;
    data(int a,int b):y(a),x(b){}
    data(){}
    bool operator<(const data &d)const{
        return y!=d.y?y<d.y:x<d.x;
    }
};
typedef pair<int,data>P;

int main(){
    int t,n;
    while(cin>>t>>n,t||n){
        set<data>S,M;
        for(int i=0;i<n;i++){
            int y,x;
            cin>>x>>y;
            S.insert(data(y,x));
        }
        int sy,sx;
        cin>>sx>>sy;
        queue<P>Q;
        Q.push(P(0,data(sy,sx)));
        while(Q.size()){
            data d=(Q.front()).second;
            int cnt=Q.front().first;
            Q.pop();
            if(cnt>t)continue;
            if(S.find(d)!=S.end())continue;
            if(M.find(d)!=M.end())continue;
            M.insert(d);
            for(int i=0;i<6;i++){
                Q.push(P(cnt+1,data(d.y+dy[i],d.x+dx[i])));
            }
        }
        cout<<M.size()<<endl;
    }
    return 0;
}

Measured memory_bytes: 1380
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(a) a.begin(), a.end()
#define P pair<int, int>
#define F first
#define S second
#define mod 1000000007
#define INF 9000000000000000
signed main() {
    int n,m,l;cin>>n>>m>>l;
    vector<vector<int>>G(n,vector<int>(n,INF));
    rep(i,m){
        int x,y,c;cin>>x>>y>>c;
        x--;y--;
        G[x][y]=c;
        G[y][x]=c;
    }
    rep(k,n)rep(i,n)rep(j,n)G[i][j]=min(G[i][j],G[i][k]+G[k][j]);
    vector<vector<int>>Count(n,vector<int>(n,INF));
    //rep(i,n){rep(j,n)cout<<G[i][j]<<' ';cout<<endl;}
    rep(i,n)rep(j,n){
        if(G[i][j]<=l)Count[i][j]=1;
    }
    rep(k,n)rep(i,n)rep(j,n)Count[i][j]=min(Count[i][j],Count[i][k]+Count[k][j]);
    int q;cin>>q;
    rep(i,q){
        int f,t;cin>>f>>t;
        f--;t--;
        if(Count[f][t]==INF)cout<<-1<<endl;
        else cout<<Count[f][t]-1<<endl;
    }
}
        

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

int main(void){

  int n,m;
  int quiz[20][20];
  int cnt;
  int max = 0;

  cin >> n >> m;


  for( int i = 0 ; i < n ; i++ ){

    cnt = 0;

    for( int j = 0 ; j < m ; j++ ){

      cin >> quiz[i][j];
      if( quiz[i][j] == 1 ) cnt++;

    }

    if( max < cnt ) max = cnt;

  }

  cout << max << endl;

  return 0;

}

Measured memory_bytes: 1160
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>
#include <cmath>
#include <cstdlib>

using namespace std;

#define int long long

#define rep(i, n) for (int i=0;i<(int)n;++i)
#define rep1(i, n) for (int i=1;i<=(int)n;++i)
#define unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using ll=long long;
using vi=vector<int>;
using pii=pair<int, int>;

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); };

bool chmin(double&a,int b){return a>b?(a=b,true):false;}
bool chmax(double&a,double b){return a<b?(a=b,true):false;}
int read(){int a;scanf("%lld",&a);return a;}

const int inf = TEN(9) + 10;
const int mod = TEN(9) + 7;

signed main()
{
	string a,b;cin>>a>>b;
	if (a.size() == b.size()) {
      if (a == b) puts("EQUAL");
		if (a > b) puts("GREATER");
		if (a < b) puts("LESS");
	} else {
		if (a.size() > b.size()) puts("GREATER");
		if (a.size() < b.size()) puts("LESS");
	}
}


Measured memory_bytes: 256
/*
 ============================================================================
 Name        : AtCoder_A.c
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : Hello World in C, Ansi-style
 ============================================================================
 */

#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int N;
	int X;
	int min=0;
	int i;
	int kosu=0;
	int* m;

	scanf("%d", &N);
	scanf("%d", &X);

	 m = (int *)malloc(sizeof(int) * N);

	 for(i=0; i<N; i++){
		 scanf("%d", &m[i]);
	 }
	min = m[0];

	for(i=0; i<N; i++){
		X = X - m[i];
		kosu++;
	}

	for(i=0; i<N; i++){
		if(m[i]< min){
			min=m[i];
		}
	}

	printf("%d", kosu + X/min );

	return 0;

}


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

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int n,x,y,sol[100001];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>n>>x>>y;
    for(int i=1;i<n;i++)
    {
        for(int j=i+1;j<=n;j++)
        {
            int dist=j-i;
            int d1=abs(x-i)+1+abs(y-j);
            int d2=abs(y-i)+1+abs(x-j);
            dist=min(dist,min(d1,d2));
            sol[dist]++;
        }
    }
    for(int i=1;i<n;i++)
        cout<<sol[i]<<'\n';
    return 0;
}


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

using namespace std;

//#define FILE_IO

typedef pair<int, int> pii;

int N, M;
int v[200005], f[200005], ff[200005];
vector<pii> edg[200005];
queue<int> q;

void answer(bool ok)
{
    if(ok)  printf("Yes\n");
    else printf("No\n");
    exit(0);
}

int F(int x)
{
    if(ff[x] == x)  return x;
    return ff[x] = F(ff[x]);
}

void unite(int x, int y)
{
    int f1 = F(x), f2 = F(y);
    if(f1 == f2)    return;
    ff[f1] = f2;
}

int main()
{
    #ifdef FILE_IO
    freopen("1.in", "r", stdin);
    freopen("1.out", "w", stdout);
    #endif

    scanf("%d%d", &N, &M);
    for(int i = 1; i <= N; i++) ff[i] = i;
    for(int i = 1; i <= M; i++)
    {
        int x, y, z;
        scanf("%d%d%d", &x, &y, &z);
        edg[x].push_back({y, -z});
        edg[y].push_back({x, z});
        unite(x, y);
    }

    for(int i = 1; i <= N; i++)
        if(F(i) == i)
        {
            v[i] = 0;
            f[i] = 0;
            q.push(i);
        }

    while(!q.empty())
    {
        int x = q.front();
        q.pop();

        for(auto e: edg[x])
        {
            int nxt = e.first;
            int d = e.second;
            if(f[nxt])
            {
                bool ok = (d == v[x] - v[nxt]);
                if(!ok) answer(0);
                continue;
            }
            v[nxt] = v[x] - d;
            f[nxt] = 1;
            q.push(nxt);
        }
    }
    answer(1);

    return 0;
}


Measured memory_bytes: 13184
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
for i in range(n):
    b = int(input())
    for j in range(3):
        if b in a[j]:
            idx = a[j].index(b)
            a[j][idx] = 0
# print(a)
for k in range(3):
    if sum(a[k]) == 0:  # 横の確認
        print('Yes')
        exit()
    elif a[0][k] + a[1][k] + a[2][k] == 0:
        print("Yes")
        exit()
if a[0][0] + a[1][1] + a[2][2] == 0 or a[0][2] + a[1][1] + a[2][0] == 0:
    print('Yes')
else:
    print('No')

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

using namespace std;

int main(void) {
    int x, n, t;
    cin >> n >> x >> t;
    // int tmp = n;
    int count = 0;
    if(n % x == 0){
        count = n / x;
    }
    else{
        count = n / x + 1;
    }
    cout << count * t << endl;
    return 0;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
#define S second
#define F first
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(false);cout.tie(0)
#define pb push_back
#define mp make_pair
using namespace std ;
typedef long long ll ;
typedef pair<int,int> pii ;
const ll mod=1000*1000*1000+7 ;
 
 
ll pow(ll a , ll b){
    if(b==0){
        return 1;
    }
    ll x = pow(a,b/2) ;
    x = (x*x)%mod ;
    if(b%2){
        x = (x*a)%mod ;
    }
    return x ;
}

ll f[2005] ;

ll tarkib(ll n , ll k){
    return ((f[n]*pow((f[k]*f[n-k])%mod , mod-2))%mod) ;
}

int main(){
    ll n ;
    cin >> n ;
    if(n < 3){
        cout << 0 ;
        return 0 ;
    }
    f[0] = 1 ;
    for(int i =1 ; i <= 2002 ; i++){
        f[i] = (f[i-1] * i)%mod ;
    }
    ll javab=0 ;
    for(ll j=1 ; j <= n ; j++){
        if(n < 3*j){
            break ;
        }
        javab = ((ll)javab + tarkib((n-j-j-1) ,(j-1) ))%mod ;
    }
    cout << javab ;

    return 0;
}


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

int main(){
    ll n,m,ans=0;
    cin>>n>>m;
    if(n*2<=m){
        ans+=n;
        m-=n*2;
        ans+=m/4;
    }
    else{
        ans+=m/2;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3648
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
typedef long long int ll;
using namespace std;
#define INF 1234567890
ll x, y;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> x >> y;
	ll ans;
	if (x%y == 0) {
		cout << -1;
	}
	else {
		cout << x;
	}
}


Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
use std::cmp;
fn main(){

    input!{
        a: i32,
        b: i32,
    }
    
    let max = std::cmp::max(std::cmp::max(a + b,a - b), a * b);
    println!("{}", max);
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
 #define REP(i, n) for(int i=0; i<(int)(n); i++)
 #define REP1(i,a,b) for(int i=a; i<=(int)(b); i++)
 #define ALL(x) begin(x),end(x)
 #define PB push_back
 using namespace std;
 typedef int64_t LL;
 typedef vector<int> VI;
 typedef pair<int,int> PII;
 
 template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
 template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
 template<class T> using MaxHeap = priority_queue<T>;
 template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
 template<class T, class F=less<T>> void sort_uniq( vector<T> &v, F f=F() ) {
     sort(begin(v),end(v),f);
     v.resize(unique(begin(v),end(v))-begin(v));
 }
 
 int main() {
     ios::sync_with_stdio(0);
     cin.tie(0);
  
     int n;
     LL t;
     cin >> n >> t;
     LL ans=0, stop=0;
     for ( int i=0; i<n; i++ ) {
        LL a; cin >> a;
        ans+=(a+t)-max(a,stop);
        stop=a+t;
     }
     cout << ans << '\n';
     return 0;
 } 

Measured memory_bytes: 256
//   _/                _/                 _/_/_/   _/
//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
// _/     _/    _/   _/     _/    _/  _/_/_/     _/
//_/     _/    _/   _/     _/    _/  _/    _/   _/
// _/_/   _/_/       _/_/   _/_/      _/_/     _/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
#include<random>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=1e9;
const ll INF=1e18;
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  string s,t;
  cin >> s >> t;
  int x=s.size(),y=t.size(),dp[x+5][y+5]={};
  for(int i=0; i<=x; i++) {
    dp[i][0]=i;
  }
  for(int i=0; i<=y; i++) {
    dp[0][i]=i;
  }
  for(int i=1; i<=x; i++) {
    for(int j=1; j<=y; j++) {
      if(s[i-1]==t[j-1]) {
        dp[i][j]=min({dp[i-1][j-1],dp[i-1][j]+1,dp[i][j-1]+1});
      }
      else {
        dp[i][j]=min({dp[i-1][j-1]+1,dp[i-1][j]+1,dp[i][j-1]+1});
      }
    }
  }
  cout << dp[x][y] << endl;
 }


Measured memory_bytes: 7140