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

using ll=int64_t;
#define int ll

#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#ifdef LOCAL
#define cerr (cerr<<"-- line "<<__LINE__<<" -- ")
#else
class CerrDummy{}cerrDummy;
template<class T>
CerrDummy& operator<<(CerrDummy&cd,const T&){
	return cd;
}
using charTDummy=char;
using traitsDummy=char_traits<charTDummy>;
CerrDummy& operator<<(CerrDummy&cd,basic_ostream<charTDummy,traitsDummy>&(basic_ostream<charTDummy,traitsDummy>&)){
	return cd;
}
#define cerr cerrDummy
#endif
#define REACH cerr<<"reached"<<endl
#define DMP(x) cerr<<#x<<":"<<x<<endl
#define ZERO(x) memset(x,0,sizeof(x))
#define ONE(x) memset(x,-1,sizeof(x))

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

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

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

ll read(){
	ll i;
	scanf("%"  SCNd64,&i);
	return i;
}

void printSpace(){
	printf(" ");
}

void printEoln(){
	printf("\n");
}

void print(ll x,int suc=1){
	printf("%" PRId64,x);
	if(suc==1)
		printEoln();
	if(suc==2)
		printSpace();
}

string readString(){
	static char buf[3341000];
	scanf("%s",buf);
	return string(buf);
}

char* readCharArray(){
	static char buf[3341000];
	static int bufUsed=0;
	char* ret=buf+bufUsed;
	scanf("%s",ret);
	bufUsed+=strlen(ret)+1;
	return ret;
}

template<class T,class U>
void chmax(T& a,U b){
	if(a<b)
		a=b;
}

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

template<class T>
T Sq(const T& t){
	return t*t;
}

#define CAPITAL
void Yes(bool ex=true){
	#ifdef CAPITAL
	cout<<"YES"<<endl;
	#else
	cout<<"Yes"<<endl;
	#endif
	if(ex)exit(0);
}
void No(bool ex=true){
	#ifdef CAPITAL
	cout<<"NO"<<endl;
	#else
	cout<<"No"<<endl;
	#endif
	if(ex)exit(0);
}

const ll infLL=LLONG_MAX/3;

#ifdef int
const int inf=infLL;
#else
const int inf=INT_MAX/2-100;
#endif

signed main(){
	int n=read();
	int wayA=0,wayB=0;
	vector<pi> waf;
	REP(i,n){
		int a=read(),b=read();
		wayA+=a;
		wayB+=b;
		waf.PB(pi(a,i));
		waf.PB(pi(b,i));
	}
	int ans=min(wayA,wayB);
	sort(ALL(waf));
	vi cnt(n,0);
	int s=0;
	REP(i,n){
		s+=waf[i].first;
		cnt[waf[i].second]++;
	}
	bool ok=false;
	REP(i,n)
		if(cnt[i]==2)
			ok=true;
	if(ok){
		chmin(ans,s);
	}else{
		if(waf[n-1].second!=waf[n].second){
			chmin(ans,s+waf[n].first-waf[n-1].first);
		}else{
			chmin(ans,s+min(waf[n+1].first-waf[n-1].first,waf[n].first-waf[n-2].first));
		}
	}
	print(ans);
}


Measured memory_bytes: 6512
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <set>
#include <array>
#include <string>
#include <map>
#include <cmath>
//#include <iomainp>
using namespace std;

#define DB(x)
#define rep(i, n) for(int i = 0;i < n;i++)
typedef uint64_t LL;


bool isSosuu(int K)
{
    for( int i = 2; i < K; ++i ){
        if( K % i == 0 ){
            return false;
        }
    }
    return true;
}

int main()
{
    int K;
    cin >> K;
    
    do{
        if(isSosuu(K))
        {
            break;
        }
        K++;
    }while(1);
    
    cout << K << endl;
    
    return 0;
}



Measured memory_bytes: 256
N = int(input())
M = [[] for _ in range(N+1)]
used = [-1]*(N+1) 
for i in range(N-1):
    u,v,w = map(int,input().split())
    M[u-1].append([v-1,w])
    M[v-1].append([u-1,w])


# from collections import deque 
q = []
q.append([0,0])
used[0] = 0
# print(M)
while q:
    # print(q)
    e,c = q.pop()
    for i,d in M[e]:
        if used[i]==-1:
            C = (c+d)%2
            used[i] = C
            q.append([i,C])  
for i in used[:-1]:
    print(i)


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

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

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

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

  for(int i = 0; i < n-1; i++){
    ll distance  = a[i+1]-a[i];
    if(distance == 0){
      cout << "NO" <<endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}

Measured memory_bytes: 1024
def main():
    s = list(input())

    if s[0] == s[-1]:
        if len(s) %2 ==0:
            print("First")
        else:
            print("Second")
    else:
        if len(s) % 2==0:
            print("Second")
        else:
            print("First")


if __name__ == "__main__":
        main()


Measured memory_bytes: 4084
n,*b=gets(p).split.map &:to_i
a=[]
for i in 0..b.size
	if i == 0
		a[i] = b[i]
	elsif b[i] == nil
		a[i] = b[-1]
	else
		a[i] = [b[i],b[i-1]].min
	end
end
#p b
#p a
p a.inject :+

Measured memory_bytes: 1788
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<stack>
using namespace std;

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

int main() {
	int a, b;
	cin >> a >> b;
	cout << (a-b<0?0:a-b) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cassert>
#include <cstring>
#include <vector>
#include <climits>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    t = 1;
    while(t--){
        int n,k;
        cin >> n >> k;
        vector<long long int> h(n);
        for(int i=0 ; i<n ; i++)
            cin >> h[i];

        vector<long long int> dp(n);
        dp[0] = 0;
        for(int i=1 ; i<n ; i++){
            long long int ans = INT_MAX;
            for(int j=1 ; j<=k && i-j >=0; j++){
                long long int temp = h[i] - h[i-j];
                if(temp<0) temp*=-1;
                if(dp[i-j] + temp < ans)
                    ans = dp[i-j] + temp;
            }
            dp[i] = ans;
        }
        cout << dp[n-1] << "\n";
    }
    return 0;
}



Measured memory_bytes: 4756
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a;
  int b;
  cin >> a >> b;
  
  if (a%2 != 0 && b%2 !=0) {
    cout << "Odd" << endl;
  }
  else {
    cout << "Even" << endl;
  }
}

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

using namespace std;

#define FastIO ios_base :: sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define read(in) freopen("Input.txt","r",stdin)
#define write(out) freopen("Ouput.txt","w",stdout)
#define pf printf
#define sf scanf
#define fr(i,n) for(i=1 ; i<=n ; i++)
#define fr1(i,x,n) for(i=x ; i<=n ; i++)
#define sf1(val) scanf("%lld",&val)
#define sf2(val1,val2) scanf("%lld %lld",&val1,&val2)
#define INF 999999999999999999
#define Pi 2*acos(0.0)
#define len 200000

typedef long long int lli;

lli a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,sum=0,total=0,res=0,ans=0;

int main()
{
    //FastIO;

    //read(in);

    sf1(t);

    map<lli,lli>mp;

    fr(i,t)     sf1(x) , sum+=x ,mp[x]++;

    sf1(q);

    fr(i,q)
    {
        sf2(x,y);

        if(mp[x]>0)  sum+=(mp[x]*(y-x)) ,mp[y]+=mp[x] ,mp[x]=0;

        pf("%lld\n",sum);
    }
}

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

int main()
{
	// 大きめに配列をとる
	int a[200][200] = {{0}}; 
	int b[200] = {0};
	int n, m;
	cin >> n >> m;
	for(int j = 0; j < n; j++) {
		for(int i = 0; i < m; i++) {
			cin >> a[i][j];
		}
	}
	for(int i = 0; i < m; i++) {
		cin >> b[i];
	}
	for(int j = 0; j < n; j++) {
		int c = 0;	
		for(int i = 0; i < m; i++) {
			c += a[i][j] * b[i];
		}
		cout << c << endl;
	}
}


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

int main() {
	string s,tmp;
  	cin >> s;
  	int len = s.length();
  	int No(0);
  	for(int i  = len-1;;){
        if(i == -1){
        cout << "YES";
        return 0;
      }else if(i <= 2){
          cout << "NO";
          return 0;
        }
      if(s.at(i) == 'e'){
       	tmp = s.substr(i-4,5);
        	if(tmp == "erase"){
        	i = i - 5;
           }
      }else if(s.at(i) == 'r'&&s.at(i-1) == 'e'&& s.at(i-2) == 's'){
        tmp = s.substr(i-5,6);
			if(tmp == "eraser"){
        	i = i - 6;
            }
      }else if(s.at(i) == 'm'){
        tmp = s.substr(i-4,5);
        if(tmp =="dream"){
        	i = i - 5;
        	}
      }else if(s.at(i) == 'r'&&s.at(i-1) == 'e'&& s.at(i-2) == 'm'){
       	tmp = s.substr(i - 6,7);
      	if(tmp == "dreamer"){
        	i = i - 7;
        }
      }
      
      if(i == No){
        cout << "NO";
        return 0;
      }
      No = i;
    }
  
}


Measured memory_bytes: 3776
N,K=map(int,input().split())
k = 0
res = 0
flag = True
for i in range(1,N+1):
  flag = True
  mid = 1/N
  k = i
  if k >=K:
    pass
  else:
    while k<K:
      mid = mid*0.5
      k = k*2
  res += mid
print(res)

Measured memory_bytes: 9188
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair < ll, ll > PLL;
#define rep(i,n) for (int i = 0; i < (n); ++i)
int main() {
    int n;
    cin >> n;
    vector<int> h(n);
    rep(i, n) cin >> h[i];
    int ans = 0;
    rep(i, n) {
        while(1) {
            if ( h[i] == 0 ) break;
            int rp = i;
            while(1) {
                if ( rp == n - 1 ) break;
                if ( h[rp+1] == 0 ) {
                    break;
                }
                ++rp;
            }
            int min_num = 1e8;
            for ( int j = i; j <= rp; ++j ) {
                min_num = min(min_num, h[j]);
            }
            for ( int j = i; j <= rp; ++j ) {
                h[j] -= min_num;
            }
            ans += min_num;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
package main
import(
  "fmt"
  "bufio"
  "os"
  "strconv"
)
func min (a int, b int)int{
  if a>b{
    return b
  }
  return a
}
var sc=bufio.NewScanner(os.Stdin)
func nextInt() int{
  sc.Scan()
  i, e :=strconv.Atoi(sc.Text())
  if e!=nil{
    panic(e)
  }
  return i
}
func main(){
  var i int
  sc.Split(bufio.ScanWords)
  n:=nextInt()
  b:=make([]int, n)
  for i=0;i<n-1;i++{
    b[i]=nextInt()
  }
  ans:=0
  for i=0;i<n;i++{
    if i==0{
      ans+=b[0]
    }else if i==n-1{
      ans+=b[n-2]
    }else{
      ans+=min(b[i], b[i-1])
    }
  }
  fmt.Println(ans)
}


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

int main() {
    int N;
    cin >> N;
    int t = N, c = 0;
    while (t) {
        c += t % 10;
        t /= 10;  
    }
    if (N % c == 0){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	int a,b,c;
	int count;
	
	scanf("%d %d %d",&a,&b,&c);
	
	if( a==b && b==c && c==a){
		 count=1;
	}else if( (a==b) && a!=c){
		count = 2;
	}else if( (b==c) && b!=a){
		count = 2;
	}else if( (c==a) && c!=b){
		count = 2;
	}else{
		count = 3;
	}
	
	printf("%d",count);
	
	return 0;
}

Measured memory_bytes: 128
s = Array.new(13, 0)
h = Array.new(13, 0)
c = Array.new(13, 0)
d = Array.new(13, 0)

gets.chomp.to_i.times do
  suit,num = gets.chomp.split
  num = num.to_i

  case suit
  when "S"
    s[num-1] = 1
  when "H"
    h[num-1] = 1
  when "C"
    c[num-1] = 1
  when "D"
    d[num-1] = 1
  end

end

s.each_with_index { |item, index| print "S #{index+1}\n" if item == 0 }
h.each_with_index { |item, index| print "H #{index+1}\n" if item == 0 }
c.each_with_index { |item, index| print "C #{index+1}\n" if item == 0 }
d.each_with_index { |item, index| print "D #{index+1}\n" if item == 0 }


                                                            

Measured memory_bytes: 6116
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--) 
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define downque(que) priority_queue<ll> que;
#define upque(que) priority_queue<ll, vector<int>, greater<int>> que;
typedef long long ll;
typedef vector<vector<int>> Matrix;
const int MOD = 1e9 + 7;
const int MAX = 1e7;
const int INF = numeric_limits<int>::max();


int main(){
  int a,b,c;
  cin >> a >> b >> c;
  bool flag = false;
  for (int i = a; i < b * a; i += a)
  {
    if(i%b==c)
      flag =true;
  }
 if(flag)
  cout << "YES" << endl;
  else
    cout << "NO" << endl;
}

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

typedef long long ll;
typedef long double ld;
using namespace std;
mt19937_64 mrand(chrono::steady_clock::now().time_since_epoch().count());
//mt19937_64 mrand(42);
#define ii for(int i=1;i<=n;++i)
#define ji for(int j=1;j<=n;++j)
#define jj for(int j=1;j<=m;++j)
#define ij for(int i=1;i<=m;++i)
#define sz(x) ((ll)x.size())
#define all(x) x.begin(),x.end()
#define al(x) x+1,x+1+n
#define asd cout<<"ok"<<endl;
#define asdd cout<<"okok"<<endl;
#define pii pair<int,int>
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vii vector<pair<int,int>>
#define pr(v) for(auto i:v) cout<<i<<" ";cout<<endl
#define prt(a, l, r) for(auto i=l;i<=r;++i) cout<<a[i]<<" ";cout<<endl;
#define pc(x) __builtin_popcount(x)
#define pb push_back

int a[10];
int main() {
    int n=5;
    ii cin>>a[i];
    ii if(a[i]==0) {cout<<i<<endl;break;}
}

Measured memory_bytes: 3652
using System;

class Rectangle
{
    public static void Main()
    {
        while (true)
        {
            string[] s = Console.ReadLine().Split();

            int H = int.Parse(s[0]);
            int W = int.Parse(s[1]);

            if(H == 0&& W == 0)
            {
                break;
            }

            for (int i = 0; i < H; i++) {
                for (int j = 0; j < W; j++){
                    if((i == 0 || i==H-1) || (j==0 || j==W-1))
                    {
                        Console.Write("#");
                    }
                    else
                    {
                        Console.Write(".");
                    }

                }
                Console.WriteLine();
            }
            Console.WriteLine();
        }
    }
}


Measured memory_bytes: 8952
#include <bits/stdc++.h>
#ifdef local
#define debug(a...) qqbx(#a, a)
template <typename H, typename ...T> void qqbx(const char *s, const H &h, T&&...a) {
    for(; *s && *s != ','; ++s) if(*s != ' ') std::cerr<<*s;
    std::cerr<<" = "<<h<<(sizeof...(T) ? ", " : "\n");
    if constexpr(sizeof...(T)) qqbx(++s, a...);
}
#else
#define debug(...) ((void)0)
#endif // local
#define pb emplace_back
#define all(v) begin(v),end(v)

using namespace std;
const int MOD = 1000000007, N = 2025, inf = 2e9;
signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    int n;
    cin >> n;
    int mn[2] = {inf, inf};
    int mx[2] = {-inf, -inf};
    for(int i = 0; i < n; i++) {
        int x, y;
        cin >> x >> y;
        mn[0] = min(mn[0], x+y);
        mn[1] = min(mn[1], x-y);
        mx[0] = max(mx[0], x+y);
        mx[1] = max(mx[1], x-y);
    }
    cout << max(mx[0]-mn[0], mx[1]-mn[1]) << '\n';
}


Measured memory_bytes: 3500
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

int k;
string t;
int mi;
int solve(const string &ts, int now, int c) {
  //cout << ts << " " << now << " " << c << endl;
  if (c >= mi) return c;
  if (now == k) {
    mi = min(mi, c);
    return c;
  }
  int d = t[now]-ts[now];
  if (d == 0) return solve(ts, now+1, c);
  int res = INF;
  for (int i=now; i<k; ++i) {
    string s = ts;
    for (int j=now; j<=i; ++j) {
      s[j] = (s[j]-'0'+d+10)%10 + '0';
    }
    res = min(res, solve(s, now+1, c+1));
  }
  return res;
}

int main() {
  while(cin>>k, k) {
    string s;
    cin >> s >> t;
    mi = INF;
    cout << solve(s,0,0) << endl;
  }
}

Measured memory_bytes: 924
n=int(input())
a=list(map(int,input().split()))
l=0
r=0
now=0
ans=[0]*n
while l < n:
    if r < n and now^a[r] == now + a[r]:
        now += a[r]
        ans[l]=r
        r+=1
    else:
        now -= a[l]
        l+=1
        ans[l-1]=r-1
print(sum([ans[i]-i+1 for i in range(n)]))

Measured memory_bytes: 24840
#include <bits/stdc++.h>
using namespace std;
int main(){
  string N;
  cin >> N;
  
  if((N.at(0) == N.at(1) && N.at(1) == N.at(2) ) ||
     (N.at(1) == N.at(2) && N.at(2) == N.at(3) )){
     cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  
  
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010


int main(){
  int A, B, K;

  cin >> A >> B >> K;

  for (int i=A; i<=B; i++) {
    if (i < A+K || B-K < i) {
      printf("%d\n", i);
    }
  }

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
const double EPS=1e-8;
typedef vector<double>vec;
typedef vector<vec>mat;
double abs(double a){
	return max(a,-a);
}
vec gauss_jordan(const mat &A,const vec &b){
	int n=A.size();
	mat B(n,vec(n+1));
	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++)B[i][j]=A[i][j];
	for(int i=0;i<n;i++)B[i][n]=b[i];
	for(int i=0;i<n;i++){
		int pivot=i;
		for(int j=i;j<n;j++){
			if(abs(B[j][i])>abs(B[pivot][i]))pivot=j;
		}
		swap(B[i],B[pivot]);
		if(abs(B[i][i])<EPS)break;
		for(int j=i+1;j<=n;j++)B[i][j]/=B[i][i];
		for(int j=0;j<n;j++){
			if(i!=j){
				for(int k=i+1;k<=n;k++)B[j][k]-=B[j][i]*B[i][k];
			}
		}
	}
	vec x(n);
	for(int i=0;i<n;i++)x[i]=B[i][n];
	return x;
}
int q[110];
int e[110][110];
int g[110][110];
int main(){
	int a,b,c;
	while(scanf("%d%d%d",&a,&b,&c),a){
		b--;c--;
		for(int i=0;i<a;i++)scanf("%d",q+i);
		for(int i=0;i<a;i++)for(int j=0;j<a;j++){
			e[i][j]=99999999;
			if(i==j)e[i][j]=0;
		}
		for(int i=0;i<a;i++)for(int j=0;j<a;j++){
			int tmp;scanf("%d",&tmp);if(tmp)e[i][j]=tmp;
		}
		for(int i=0;i<a;i++)for(int j=0;j<a;j++)g[i][j]=e[i][j];
		for(int k=0;k<a;k++)for(int i=0;i<a;i++)for(int j=0;j<a;j++)g[i][j]=min(g[i][j],g[i][k]+g[k][j]);
		if(g[b][c]>9999999){
			printf("impossible\n");continue;
		}
		mat A(a,vec(a));
		vec B(a);
		for(int i=0;i<a;i++){
			if(i==c){
				B[i]=0;
				A[i][i]=1;
				continue;
			}
			if(q[i]){
				int dist=99999999;
				for(int j=0;j<a;j++)if(i!=j&&e[i][j]<999999)dist=min(dist,e[i][j]+g[j][c]);
				for(int j=0;j<a;j++){
					if(e[i][j]&&e[i][j]<999999&&e[i][j]+g[j][c]==dist){
						A[i][i]+=1;
						A[i][j]-=1;
						B[i]+=e[i][j];
					}
				}
			}else{
				for(int j=0;j<a;j++){
					if(e[i][j]&&e[i][j]<999999){
						A[i][i]+=1;
						A[i][j]-=1;
						B[i]+=e[i][j];
					}
				}
			}
		}
		vec x=gauss_jordan(A,B);
		printf("%.12f\n",x[b]);
	}
}

Measured memory_bytes: 1332
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

#define MAX 1000001
int main(){
  int n,a,b,c,x;
  while(scanf("%d%d%d%d%d",&n,&a,&b,&c,&x), n){
    int y[n], yy = 0;
    REP(i,n) scanf("%d",&y[i]);
    int i;
    for(i=0; i<=10000; i++){
      if(y[yy] == x) yy++;
      x = (a*x + b) % c;
      if(yy == n) break;
    }
    if(i == 10001) i=-1;
    printf("%d\n",i);
  }
  return 0;
}

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

#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T>
T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); }
template <typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;

namespace Problem {
using namespace std;

class Solver {
 public:
  LL n;
  Solver(LL n) : n(n){};

  void solve() {
    if (n % 2) {
      cout << 0 << endl;
    } else {
      LL div = 10;
      LL ans = 0;
      while (1) {
        DBG(div, ans)
        ans += n / div;
        div *= 5;
        if (div > n) break;
      }
      cout << ans << endl;
    }
  }
};

}  // namespace Problem

int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  // std::cout << std::fixed << std::setprecision(12);
  long long n = 0;
  std::cin >> n;

  Problem::Solver sol(n);
  sol.solve();
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define vi vector<int>
#define pb push_back
#define ff first
#define ss second
#define forn(i,n) for(int i=0;i<n;i++)
#define M 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(0)

int mod(long long x) {
	return ((x % M + M) % M);
}
int add(int a, int b) {
	return mod(mod(a) + mod(b));
}
int diff(int a, int b) {
	return mod(mod(a) - mod(b));
}

int mul(int a, int b) {
	return mod(mod(a) * mod(b));
}

int modPow(int a, int b) {
	if (b == 0)
		return 1;
	if (b == 1)
		return a % M;
	int res = 1;
	while (b) {
		if (b % 2 == 1)
			res = mul(res, a);
		a = mul(a, a);
		b = b / 2;
	}
	return res;
}

void solve() {

  int d,t,s;
  cin>>d>>t>>s;
  int x=s*t;
  if(x>=d){
  	cout<<"Yes"<<endl;
  }
  else
  	 cout<<"No"<<endl;

}



int32_t main() {

	fastio;

#ifndef ONLINE_JUDGE
	freopen("input1.txt", "r", stdin);
	freopen("output1.txt", "w", stdout);
#endif

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

	while (t--) {
		solve();
	}

	return 0;
}

Measured memory_bytes: 3664
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+7;
int a[N];
map<int,int>mp;
int main()
{
	 int n;
	 int count;
	 cin>>n;
	 int ans=-0x3f3f3f3f;
	 for(int i=1;i<=n;i++)
	 {
	 	cin>>a[i];
	 	mp[a[i]]++;
	 }
	 for(int i=1;i<=N;i++)
	 {
	 	count=mp[i]+mp[i-1]+mp[i+1];
	 	if(count>=ans)
	 	ans=count;
	 }
	 cout<<ans<<endl;
}

Measured memory_bytes: 5376
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define all(v) v.begin(), v.end()
#define sz(v) v.size()
#define INF 100000000000000 //10^14 100兆
// aよりもbが大きいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmax(T &a, const T& b) {
  if (a < b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}
// aよりもbが小さいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmin(T &a, const T& b) {
  if (a > b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}

int main(){
  ll H, W, K;
  cin >> H >> W >> K;
  vector<string> c(H);
  rep(i, H){
    cin >> c.at(i);
  }
  vector<string> p(W, "");
  vector<string> p2(W);
  rep(i, W){
    rep(j, H){
      p.at(i) += c.at(H-1-j).at(i);
    }
    rep(j, H){
      p.at(i) += "#";
    }
  }
  rep(i, W){
    p2.at(i) = p.at(i);
  }
  queue<pair<ll, ll>> s;
  ll ans = 0;
  rep(i, W){
    rep(m, H){
      rep(j, W){
        p.at(j) = p2.at(j);
      }
      ll chain = 0;
      ll score = 0;
      s.push(make_pair(i, m));
      while(!s.empty()){
        while(!s.empty()){
          pair<ll, ll> r = s.front();
          s.pop();
          p.at(r.first).at(r.second) = '!';
        }
        rep(j, W){
          auto it = p.at(j).begin();
          while(it != p.at(j).end()){
            if(*it == '!'){
              it = p.at(j).erase(it);
            }
            else{
              it++;
            }
          }
        }
//        cout << i << " " << score << endl;
//        rep(j, W){
//          cout << p.at(j) << endl;
//        }
        rep(j, H){
          ll rin = 1;
          rep(k, W-1){
            if(p.at(k).at(j) == p.at(k+1).at(j) && isdigit(p.at(k).at(j))){
              rin++;
            }
            else if(isdigit(p.at(k).at(j)) && rin >= K){
              score += pow(2, chain) * rin * (p.at(k).at(j) - '0');
              rep(l, rin){
                s.push(make_pair(k-l, j));
              }
              rin = 1;
            }
            else{
              rin = 1;
            }
          }
          if(isdigit(p.at(W-1).at(j)) && rin >= K){
            score += pow(2, chain) * rin * (p.at(W-1).at(j) - '0');
            rep(l, rin){
              s.push(make_pair(W-1-l, j));
            }
          }
        }
        chain++;
      }
//    cout << i  << " " << m << " " << score << endl;
      chmax(ans, score);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define mod (ll)(1e9+7)
#define FIX(a) ((a)%mod+mod)%mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define fi first
#define se second
#define pb push_back
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vint a(n);
    int ans = 0;
    int now = 0;
    REP(i,n){
        cin >> a[i];
        if(a[i]==now+1){
            now++;
        }
    }
    if(now==0){
        cout << -1 << endl;
    }else{
        cout << n-now << endl;
    }

    return 0;
}

Measured memory_bytes: 1152
#line 2 "header.hpp"

//%snippet.set('header')%
//%snippet.fold()%
#ifndef HEADER_H
#define HEADER_H

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

// varibable settings
const long long INF = 1e18;

#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define _rrep(i, n) rrepi(i, 0, n)
#define rrepi(i, a, b) for (ll i = (ll)((b)-1); i >= (ll)(a); --i)
#define r_rep(...) _overload3(__VA_ARGS__, rrepi, _rrep, )(__VA_ARGS__)
#define each(i, a) for (auto &&i : a)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(...) make_tuple(__VA_ARGS__)
#define ub upper_bound
#define lb lower_bound
#define lpos(A, x) (lower_bound(all(A), x) - A.begin())
#define upos(A, x) (upper_bound(all(A), x) - A.begin())
template <class T>
inline void chmax(T &a, const T &b) {
    if ((a) < (b)) (a) = (b);
}
template <class T>
inline void chmin(T &a, const T &b) {
    if ((a) > (b)) (a) = (b);
}

#define divceil(a, b) ((a) + (b)-1) / (b)
#define is_in(x, a, b) ((a) <= (x) && (x) < (b))
#define uni(x)    \
    sort(all(x)); \
    x.erase(unique(all(x)), x.end())
#define slice(l, r) substr(l, r - l)

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef tuple<ll, ll, ll> iii;

template <typename T>
using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast {
    Fast() {
        std::cin.tie(0);
        ios::sync_with_stdio(false);
    }
} fast;
void check_input() {
    assert(cin.eof() == 0);
    int tmp;
    cin >> tmp;
    assert(cin.eof() == 1);
}

#if defined(PCM) || defined(LOCAL)
#else
#define dump(...) ;
#define dump_1d(...) ;
#define dump_2d(...) ;
#define cerrendl ;
#endif

#endif /* HEADER_H */
//%snippet.end()%
#line 2 "solve.cpp"


int solve() {
    int n,m,x;cin>>n>>m>>x;
    vi c(n);
    vvi a(n, vi(m));
    rep(i, n){
        cin>>c[i];
        rep(j, m) cin>>a[i][j];
    }

    ll ans = INF;
    rep(s, 1<<n){
        ll res = 0;
        vi score(m);
        rep(i, n){
            if (s>>i&1){
                rep(j, m) score[j] += a[i][j];
                res += c[i];
            }
        }
        bool valid = true;
        rep(j, m){
            if (score[j] < x) valid = false;
        }
        if (valid){
            chmin(ans, res);
        }
    }
    cout << (ans==INF ? -1 : ans) << endl;

    return 0; 
}


int main(){/*{{{*/
    solve();
    check_input();
    return 0;
}/*}}}*/


Measured memory_bytes: 3660
n = gets.chomp.to_i

n.times do
  sc = 0
  out = 0
  bases = [false, false, false]

  while out < 3
    event = gets.chomp

    case event
      when "HIT"
      2.downto(0).each do |i|
        if bases[i]
          bases[i + 1] = true
          bases[i] = false
        end
      end
      if bases[3]
        sc += 1
        bases.delete_at(3)
      end
      bases[0] = true

      when "HOMERUN"
      sc += 1
      bases.each{|b| sc += b ? 1 : 0}
      bases = [false, false, false]

      when "OUT"
      out += 1
    end
  end

  puts sc
end

Measured memory_bytes: 6108
def a(t,x,y):
    n=abs(x)+abs(y)
    if (t-n)%2==0 and t-n>=0 :
        return 1
    else :
        return 0
N=int(input())
result=1
tn,xn,yn=0,0,0
for i in range(N):
    t,x,y=map(int,input().split())
    tn=t-tn
    xn=x-xn
    yn=y-yn
    result*=a(tn,xn,yn)
    #print (result)
if result==1:
    print ('Yes')
else:
    print ('No')

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;

int main(){
  int k;
  string s;
  cin >> k >> s;
  
  if(s.size() <= k){
    cout << s << endl;
  }
  else{
    cout << s.substr(0,k) << "..." << endl;
  }
  
  return 0;
}


Measured memory_bytes: 3568
#include<stdio.h>
#include<string.h>
typedef long long int lli;
int main() {
  int n,i,cnt=0;
  scanf("%d", &n);
  char s[n];
  scanf("%s", &s);
  for(i=0;i<n-2;i++){
    if(s[i]=='A' && s[i+1]=='B' && s[i+2]=='C'){
      cnt++;
    }
  }

  printf("%d", cnt);
  return 0;
}


Measured memory_bytes: 1680
import collections,sys
d=collections.deque()
input()
for e in sys.stdin:
 if'i'==e[0]:d.appendleft(e.split()[1])
 else:
  if' '==e[6]:
   m=e.split()[1]
   if m in d:d.remove(m)
  elif len(e)%2:d.pop()
  else:d.popleft()
print(*d)


Measured memory_bytes: 69736
n, m, x = map(int, input().split())
inn = [ list( map(int, input().split() ) ) for _ in range(n) ]
c = [inn[_][0] for _ in range(n) ]
ara = [ inn[_][1:] for _ in range(n)]

ans = 1e9

for mask in range(2**n):
	cost = 0
	cnt = [0 for _ in range(m)]
	for i in range(n):
		if ( (1 << i) & mask ) == 0:
			continue
		cost += c[i]
		for j in range(m):
			cnt[j] += ara[i][j]
	if min(cnt) >= x:
		ans = min(ans, cost)

if ans == 1e9:
	ans = -1

print(ans)





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

const long long MOD = 1000000007;
const long long INF = 1LL << 60;
const int INT_INF = 1000000000;

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

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  vector<ll> A(N);
  for (auto &a : A)
    cin >> a;
  ll ans = 0;
  map<ll, ll> mp;
  for (int i = 0; i < N; i++)
    mp[A[i]]++;
  ll sum = 0;
  for (auto itr = mp.begin(); itr != mp.end(); itr++)
  {
    sum += itr->second * (itr->second - 1) / 2;
  }
  for (auto &a : A)
  {
    ll tmp = sum;
    ll before, after;
    before = mp[a] * (mp[a] - 1) / 2;
    after = (mp[a] - 1) * (mp[a] - 2) / 2;
    tmp -= before;
    tmp += after;
    cout << tmp << endl;
  }
  return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> A(N), memo(100001);
  int64_t ans = 0;
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
    memo.at(A.at(i))++;
    ans += A.at(i);
  }
  int Q;
  cin >> Q;
  for (int i = 0; i < Q; i++) {
    int64_t B, C;
    cin >> B >> C;
    ans += memo.at(B) * (C - B);
    memo.at(C) += memo.at(B);
    memo.at(B) = 0;
    cout << ans << endl;
  }
}

Measured memory_bytes: 4024
#include <stdio.h>
char* F(char *b,int n,FILE *f){char *r=fgets(b,n,f);if(!r)return NULL;b[strlen(b)-1]=0;return r;}
char Q[29999],*q[9],L[29999];
n;dfs(old_indent,depth){
	int indent=0;
	if(!F(L,sizeof(L),stdin))puts("no such property"),exit(0);
	for(;L[indent]==' ';indent++);
	if(old_indent>=indent)puts("no such property"),exit(0);
	char *name=strtok(L+indent,":"),*value=name+strlen(name)+1;
	if(!strcmp(name,q[depth])){
		if(depth==n-1)
			if(*value)printf("string \"%s\"\n",value+1),exit(0);
			else puts("object"),exit(0);
		dfs(indent,depth+1);
	}
	dfs(old_indent,depth);
}
main(){F(Q,sizeof(Q),stdin);q[0]=strtok(Q+1,".");for(n=1;;n++)if(!(q[n]=strtok(NULL,".")))break;dfs(-1,0);}

Measured memory_bytes: 588
ARGF.each do |line|
  m, f, r  = line.split.map(&:to_i)
  break if (m + f + r) == -3

  if m == -1 || f == -1
    puts "F"
    next
  end

  point = m + f

  case point
  when 0..29
    puts 'F'
  when 30..49
    if r >= 50
      puts 'C'
    else
      puts 'D'
    end
  when 50..64
    puts 'C'
  when 65..79
    puts 'B'
  when 80..100
    puts 'A'
  end
end

Measured memory_bytes: 6104
#include <iostream>
#include <string>
#include <deque>
#include <algorithm>
using namespace std;

int main()
{
    string s; cin>>s;
    deque<char> a(begin(s), end(s));

    int n; cin>>n;
    bool rev=false;
    while (n--) {
        int t; cin>>t;
        if (t==1) {
            rev=!rev;
        }
        else {
            int f;
            string c;
            cin>>f>>c;
            if (f+!rev==2)
                a.push_front(c[0]);
            else
                a.push_back(c[0]);
        }
    }
    if (rev) reverse(begin(a), end(a));
    cout<<string(begin(a), end(a))<<endl;
}


Measured memory_bytes: 1280
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <ctime>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define fs first
#define sc second
#define INF 1000000000
#define MOD 1000000007
#define EPS 0.00000001


int main() {
    int N, K; cin >> N >> K;
    string S; cin >> S;
    S[K-1] += 32;
    cout << S << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <set>
using namespace std;
const int INF = 1<<29;

// グラフ
using Edge = pair<int,long long>; // {辺の行き先, 重み}
using Graph = vector<vector<Edge> >; // グラフ

// 使われうる辺集合
set<pair<int,int> > use;

// s を始点とする Dijkstra
vector<long long> Dijkstra(const Graph &G, int s) {
    vector<long long> dist((int)G.size(), INF);
    vector<vector<int> > prev((int)G.size()); // prev[v] := v から復元できる辺たち
    dist[s] = 0;
    priority_queue<pair<long long,int>, vector<pair<long long,int> >, greater<pair<long long,int> > > que;
    que.push({0, s});
    while (!que.empty()) {
        auto cur = que.top(); que.pop();
        long long cur_dist = cur.first;
        int v = cur.second;
        if (cur_dist > dist[v]) continue; // 効く枝刈り
        for (auto e : G[v]) {
            if (dist[e.first] > dist[v] + e.second) {
                dist[e.first] = dist[v] + e.second;
                que.push({dist[e.first], e.first});

                // 復元のための
                prev[e.first].clear();
                prev[e.first].push_back(v);
            }
            else if (dist[e.first] == dist[v] + e.second) {
                prev[e.first].push_back(v);
            }
        }
    }

    // 使われうる辺集合
    for (int v = 0; v < (int)G.size(); ++v) {
        for (auto u : prev[v]) {
            use.insert(make_pair(min(u, v), max(u, v)));
        }
    }
    return dist;
}

int main() {
    int N, M; cin >> N >> M;
    Graph G(N);
    for (int i = 0; i < M; ++i) {
        int a, b; long long c;
        cin >> a >> b >> c;
        --a, --b;
        G[a].push_back(Edge(b, c));
        G[b].push_back(Edge(a, c));
    }
    for (int v = 0; v < N; ++v) Dijkstra(G, v);
    cout << M - (int)use.size() << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,x) for(ll i = 0; i < (ll)(x); i++)
#define pb push_back
#define eb emplace_back
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
const ll INF = numeric_limits<ll>::max()/4;
const int n_max = 1e5+10;

template<class T>
bool chmax(T &a, T b){if(a < b){a = b; return true;} return false;}
template<class T>
bool chmin(T &a, T b){if(a > b){a = b; return true;} return false;}

int main(){
    ll n; cin >> n;
    vector<ll> p(n);
    rep(i,n) cin >> p[i];
    ll ans = 0;
    ll min_ = INF;
    rep(i,n){
        if(chmin(min_,p[i]))ans++;
    }
    cout << ans << endl;
}

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

int main(){
	int sx,sy,tx,ty;
	cin>>sx>>sy>>tx>>ty;
	string ans;
	for(int i=0;i<ty-sy;++i){
		ans+='U';
	}
	for(int i=0;i<tx-sx;++i){
		ans+='R';
	}
	for(int i=0;i<ty-sy;++i){
		ans+='D';
	}
	for(int i=0;i<tx-sx;++i){
		ans+='L';
	}
	ans+='L';
	for(int i=0;i<ty-sy;++i){
		ans+='U';
	}
	ans+='U';
	for(int i=0;i<tx-sx;++i){
		ans+='R';
	}
	ans+="RDR";
	for(int i=0;i<ty-sy;++i){
		ans+='D';
	}
	ans+='D';
	for(int i=0;i<tx-sx;++i){
		ans+='L';
	}
	ans+='L';
	ans+='U';
	cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
long long int a[1000009];
using namespace std;
typedef long long int ll;
int main()
{
    ll i,j,n,k,t1,t,t2,s=0,c,a,b;
    map<string,ll>mp;
    map<string,ll>::iterator it;
    vector<ll> v;
    pair<char,ll>p;
    list<ll>l;
    string s1,s2;
    cin>>a>>b;
    if(a==b)
        cout<<"Draw"<<endl;
   else if(a==1)
        cout<<"Alice"<<endl;
    else if(b==1)
        cout<<"Bob"<<endl;
    else if(a>b)
        cout<<"Alice"<<endl;
    else if(a<b)
        cout<<"Bob"<<endl;
       // main();
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i < (n);i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define SCANF(i) int i;scanf("%d",&i)
using namespace std;
using P = pair<int,int>;
const long long INF = 1LL << 60;
const int IINF=100000000;
const int MOD = (int)1e9 + 7;
typedef long long ll;
//約数列挙
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    //sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
vector<int> dx={1,0,-1,0};vector<int> dy={0,-1,0,1};

signed main () {
    ll n,k,l,r;cin >> n >> k >> l >> r;
    vector<ll> list(n);
    REP(i,n)cin >> list[i];
    ll ind = n/2;
    vector<vector<ll>> firsthalf(ind+1,vector<ll>());
    vector<vector<ll>> secondhalf(n-ind+1,vector<ll>());
    for(ll i=0;i<(1<<ind);i++){
        ll cnt=0;ll value=0;
        for(ll j=0;j<ind;j++){
            if(i >> j & 1)value+=list[j],cnt++;
        }
        firsthalf[cnt].push_back(value);
    }
    for(ll i=0;i<(1<<n-ind);i++){
        ll cnt=0;ll value=0;
        for(ll j=0;j<n-ind;j++){
            if(i >> j & 1)value+=list[ind+j],cnt++;
        }
        secondhalf[cnt].push_back(value);
    }
    REP(i,ind)sort(ALL(firsthalf[i]));
    ll ans=0;
    for(ll i=max(k-ind,(ll)0);i<min(k,n-ind)+1;i++){
        vector<ll> target = secondhalf[i];
        for(int j = 0;j<target.size();j++){
            ll res = (ll)(upper_bound(ALL(firsthalf[k-i]),r-target[j]) - lower_bound(ALL(firsthalf[k-i]),l-target[j]));
            ans += res;
        }
    }
    cout << ans << endl;
}


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

int main()
{
  int a, b, c;
  cin >> a >> b >> c;
  int arr[3] = {a, b, c};
  sort(arr, arr + 3);
  cout << arr[0] << " " << arr[1] << " " << arr[2] << endl;
}


Measured memory_bytes: 3152
#include<stdio.h>

int main(){
    char s[101];
    int N;
    scanf("%d",&N);
    scanf("%s",s);
    int i;
    int result=0;

    for(i=0;i<N;i++){
        if(s[i]=='R'){
            result+=1;
        }
        else{
            result-=1;
        }
    }
    if(result>0){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }

    return 0;
}

Measured memory_bytes: 128
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a = [False]*N
b = [False]*M

ans = 0
now = 0
bf = 0

for i in range(N):
    if now + A[i] > K:
        break
    now += A[i]
    ans += 1
    a[i] = True

for i in range(M):
    if now + B[i] > K:
        break
    now += B[i]
    ans += 1
    b[i] = True
    bf = i

if all(a) and all(b):
    print(ans)
    exit()

if not any(a) and not any(b):
    print(ans)
    exit()

n = K - now
ans2 = ans
for i in reversed(range(N)):
    if a[i]:
        a[i] = False
        n += A[i]
        ans2 -= 1
        for j in range(bf,M):
            if not b[j]:
                if n - B[j] < 0:
                    break
                b[j] = True
                bf = j
                n -= B[j]
                ans2 += 1
    if ans2 > ans:
        ans = ans2

print(ans)



Measured memory_bytes: 41108
import math
a, b, c = map(float, input().split())

A = ((a*b) * math.sin(math.radians(c)) * 0.5)
L = math.sqrt((a**2) + (b**2) - (2*a*b) * math.cos(math.radians(c))) + a + b
H = 2 * A / a

print("{:.8f}\n{:.8f}\n{:.8f}".format(A, L, H))


Measured memory_bytes: 5704
#include<iostream>

using namespace std;

int main()
{
	double right,left;
	int A , B , C , D;
	int a , b , c , d;
	
	A = B = C = D = 0;
	a = b = c = d = 0;
	
	while(cin>>left>>right){
		if(left >= 1.1){
			A++;
		}
		else if(left < 1.1 && left >= 0.6){
			B++;
		}
		else if(left < 0.6 && left >= 0.2){
			C++;
		}
		else{
			D++;
		}
		
		if(right >= 1.1){
			a++;
		}
		else if(right < 1.1 && right >= 0.6){
			b++;
		}
		else if(right < 0.6 && right >= 0.2){
			c++;
		}
		else{
			d++;
		}
	}
	
	printf("%d %d\n",A,a);
	printf("%d %d\n",B,b);
	printf("%d %d\n",C,c);
	printf("%d %d\n",D,d);
	
}

Measured memory_bytes: 0
#include<iostream>
#include<cmath>
#include<iomanip>

using namespace std;

int main(){
	
    int n;
    cin >> n;
    while(n--) {
    	
        double x1, y1, x2, y2, x3, y3;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        
        double a1 = 2 * (x2 - x1);
        double b1 = 2 * (y2 - y1);
        double c1 = x1 * x1 -x2 * x2 + y1 * y1 - y2 * y2;
        
        double a2 = 2 * (x3 - x1);
        double b2 = 2 * (y3 - y1);
        double c2 = x1 * x1 - x3 * x3 + y1 * y1 - y3 * y3;
        
        double x = (b1  *c2 - b2 * c1) / (a1 * b2 - a2 * b1);
        double y = (c1 * a2 - c2 * a1) / (a1 * b2 - a2 * b1);
        double r = hypot(x-x1, y-y1);
        
        cout << fixed << setprecision(3) 
        	 << x << " " << y << " " << r << "\n";
        
    }
    return 0;
}


Measured memory_bytes: 3244
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
typedef  long long ll;
ll gcd(ll x,ll y){
   if(y==0) return x;
   else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
   return x/gcd(x,y)*y;
}
using namespace std;

int main(){
    int x;
    cin>>x;
    cout<<std::setprecision(10)<<x*2*acos(-1)<<endl;
return 0;
}


Measured memory_bytes: 3780
def func(diff, cnt9, cnt0):
    if cnt9 <= 0 : return diff == 0
    num = int("9" * cnt9 + "0" * cnt0)
    return sum(func(diff + i * num, cnt9 - 2, cnt0 + 1) * (9 - abs(i) + 1 - (cnt0 < 1)) for i in range(-9, 10) if abs(diff + i * num) < num)

D = input()
print sum(func(D, d, 0) * (10 - d % 2 * 9) for d in range(1, 21))

Measured memory_bytes: 2696
from sys import stdin
from copy import deepcopy
import queue

class Dice:
    def __init__(self, nums):
        self.labels = [None] + [ nums[i] for i in range(6) ]
        self.pos = {
            "E" : 3,
            "W" : 4,
            "S" : 2,
            "N" : 5,
            "T" : 1,
            "B" : 6
        }

    def rolled(dice, queries):
        d = deepcopy(dice)
        for q in queries:
            if q == "E":
                d.pos["T"], d.pos["E"], d.pos["B"], d.pos["W"] = d.pos["W"], d.pos["T"], d.pos["E"], d.pos["B"]
            elif q == "W":
                d.pos["T"], d.pos["E"], d.pos["B"], d.pos["W"] = d.pos["E"], d.pos["B"], d.pos["W"], d.pos["T"]
            elif q == "S":
                d.pos["T"], d.pos["S"], d.pos["B"], d.pos["N"] = d.pos["N"], d.pos["T"], d.pos["S"], d.pos["B"]
            elif q == "N":
                d.pos["T"], d.pos["S"], d.pos["B"], d.pos["N"] = d.pos["S"], d.pos["B"], d.pos["N"], d.pos["T"]
        else:
            return d

    def isDiceSame(d1, d2):
        if not isinstance(d1, Dice) or not isinstance(d2, Dice):
            return False

        if set(d1.labels[1:]) != set(d2.labels[1:]):
            return False

        else:
            q = ["T", "S", "E", "N", "W", "B"]
            memo = [[False] * 7 for i in range(7)]
            memo[d1.pos["T"]][d1.pos["S"]] = ""
            res = {}
            for i in q[:3]:
                if d1.labels[d1.pos[i]] != d2.labels[d2.pos[i]]:
                    break
            else:
                res[memo[d1.pos["T"]][d1.pos["S"]]] = d1

            def bfs_isDiceSame():
                que = queue.Queue()
                que.put(d1)

                while not que.empty():
                    d = que.get()
                    for i in q[1:5]:
                        d_next = Dice.rolled(d, i)
                        if memo[d_next.pos["T"]][d_next.pos["S"]] == False:
                            que.put(d_next)
                            memo[d_next.pos["T"]][d_next.pos["S"]] = memo[d.pos["T"]][d.pos["S"]] + i
                            for j in q[:3]:
                                if d_next.labels[d_next.pos[j]] != d2.labels[d2.pos[j]]:
                                    break
                            else:
                                res[memo[d_next.pos["T"]][d_next.pos["S"]]] = d_next

            bfs_isDiceSame()
            if len(res) == 0:
                return False
            else:
                for k, v in res.items():
                    for i in q[3:]:
                        if v.labels[v.pos[i]] != d2.labels[d2.pos[i]]:
                            break
                    else:
                        return True
                else:
                    return False

d1_nums = [int(x) for x in stdin.readline().rstrip().split()]
d2_nums = [int(x) for x in stdin.readline().rstrip().split()]
d1 = Dice(d1_nums)
d2 = Dice(d2_nums)
if Dice.isDiceSame(d1, d2):
    print("Yes")
else:
    print("No")


Measured memory_bytes: 7056