akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<algorithm>
using namespace std;
int x,k,r[100001],q,t,y,a[100001],b[100001],c[100001],left,right,mid,d,e,f,flag;
int main(){
    scanf("%d",&x);
    scanf("%d",&k);
    r[0]=0;
    for(int i=0;i<k;i++){
        scanf("%d",&r[i+1]);
    }
    a[0]=0;
    b[0]=x;
    c[0]=0;
    for(int i=0;i<k;i++){
        flag=0;
        if(i%2){
            d=min(x,max(0,a[i]+c[i]+r[i+1]-r[i]));
            e=max(0,min(x,b[i]+c[i]+r[i+1]-r[i]));
        }
        else{
            d=max(0,min(x,a[i]+c[i]+r[i]-r[i+1]));
            e=min(x,max(b[i]+c[i]+r[i]-r[i+1],0));
        }
        if(e!=d){
            left=a[i];
            right=b[i];
            while(left<=right){
                mid=(right+left)/2;
                if(i%2){
                    f=max(0,mid+c[i]+r[i+1]-r[i]);
                    f=min(x,f);
                }
                else{
                    f=max(0,mid+c[i]+r[i]-r[i+1]);
                    f=min(x,f);
                }
                if(f==d){
                    left=mid+1;
                }
                else if(f==e){
                    right=mid-1;
                }
                else{
                    flag=1;
                    c[i+1]=f-mid;
                    a[i+1]=d-c[i+1];
                    b[i+1]=e-c[i+1];
                    break;
                }
            }
            if(!flag){
                a[i+1]=right;
                b[i+1]=left;
                c[i+1]=d-a[i+1];
            }
        }
        else{
            a[i+1]=b[i+1]=0;
            if(i%2){
                f=max(0,e);
                f=min(x,f);
            }
            else{
                f=max(0,e);
                f=min(x,f);
            }
            c[i+1]=f;
        }
    }
    scanf("%d",&q);
    for(int i=0;i<q;i++){
        scanf("%d %d",&t,&y);
        left=0;
        right=k;
        while(left<=right){
            mid=(right+left)/2;
            if(r[mid]==t){
                left=right=mid;
                break;
            }
            if(r[mid]>t){
                right=mid-1;
            }
            else if(mid+1>right){
                break;
            }
            else{
                left=mid+1;
            }
        }
        f=min(b[right]+c[right],c[right]+y);
        f=max(f,a[right]+c[right]);
        if(right%2){
            e=min(x,f+t-r[right]);
        }
        else{
            e=max(0,f-t+r[right]);
        }
        printf("%d\n",e);
    }
}

Measured memory_bytes: 2688
#include<stdio.h>

int main(void)
{
  int h=0,w=0;
  char moji[110][110];
  scanf("%d%d",&h,&w);
  for(int i = 0;i < h;i++)
  {
    scanf("%s",moji);
    printf("%s\n%s\n",moji,moji);
  }

  return 0;
}


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

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

    ll N;
    cin >> N;
    vector<ll> P(N);
    REP(i, N) cin >> P[i];
    vector<ll> Q(N);
    REP(i, N) Q[P[i]-1] = i;

    set<ll> st;
    st.insert(-1);
    st.insert(N);
    st.insert(Q[N-1]);

    ll res = 0;
    for(int q=N-2;q>=0;q--){
    	ll idx = Q[q];
    	ll tmp = 0;
    	auto migi = st.lower_bound(idx);
    	auto hidari = prev(migi);
    	if(*hidari != -1){
    		auto hidari2 = prev(hidari);
    		tmp += (*migi - idx)*(*hidari - *hidari2);
    	}
    	if(*migi != N){
    		auto migi2 = next(migi);
    		tmp += (*migi2 - *migi)*(idx-*hidari);
    	}
    	res += (q+1)*tmp;
    	st.insert(idx);
    }
    cout << res << endl;

    return 0;
}

Measured memory_bytes: 6528
#include<bits/stdc++.h>
using namespace std;
const int twx=1000000007;
long long n,m,a,dp[100010];
bool pan[100010];
int main() {
	scanf("%lld %lld",&n,&m);
	for(int i=1;i<=m;i++) {
		scanf("%lld",&a);
		pan[a]=1;
	}
	dp[0]=1;
	for(int i=1;i<=n;i++)
	if(!pan[i])
		if(i==1) 
		    dp[i]=dp[0];
		else
			dp[i]=((dp[i]+dp[i-1])%twx+dp[i-2])%twx;
	printf("%d\n",dp[n]);
}

Measured memory_bytes: 1152
fn gcd(a: usize, b: usize) -> usize {
    if a < b {
        gcd(b, a)
    } else if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}
fn main() {
    let n = read();
    let mut a = vec![];
    for _ in 0..n {
        a.push(read());
    }
    let mut l = vec![0; n + 1];
    let mut ltmp = a[0];
    for i in 0..n {
        l[i + 1] = gcd(a[i], ltmp);
        ltmp = l[i + 1];
    }
    let mut r = vec![0; n + 1];
    let mut rtmp = a[n - 1];
    for i in (0..n).rev() {
        r[i] = gcd(a[i], rtmp);
        rtmp = r[i];
    }
    let mut ans = 0;
    for i in 0..n {
        ans = max(ans, gcd(l[i], r[i + 1]));
    }
    println!("{}", ans);
}

// =========
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};
#[allow(unused_imports)]
use std::process::exit;

#[allow(dead_code)]
const MOD: usize = 1000000007;

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

// =========


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

const int N = 1e5 + 10;
int a[N];

int main() {
  	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  	int n;
  	cin >> n;
  	for (int i = 0; i < n; i++)
      	cin >> a[i];
 	int ans = 0, cnt = 0;
  	for (int i = 0; i < n; i++)
      	if (a[i] == i + 1)
          	cnt++;
  		else {
          	ans += (cnt + 1) / 2;
          	cnt = 0;
        }
 	if (cnt)
      	ans += (cnt + 1) / 2;
 	cout << ans << "\n";
  	return 0;
}

Measured memory_bytes: 640
package main

import "fmt"

func main() {
	// Code for B - OddString
	var s string
	fmt.Scanf("%s", &s)

	for i := 0; i < len(s); i++ {
		if (i+1)%2 != 0 {
			fmt.Printf("%c", s[i])
		}
	}

	fmt.Printf("\n")
}


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

int main(){
    unsigned long long a, b, x;
    cin >> a >> b >> x;
    if(a%x==0){
        cout << ((b/x)-(a/x)+1) << endl;
    }else{
        cout << ((b/x)-(a/x)) << endl;
    }
}

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

int main() {
  int N;
  cin >> N;
  int cake_price = 4;
  int donut_price = 7;
  
  int flag = 0;
  
  for (int i = 0; i < N/cake_price + 1; i++){
    for (int j = 0; j < (N - cake_price * i)/donut_price + 1; j++){
      if (N == cake_price * i + donut_price * j && flag ==0){
        flag = 1;
      }
    }
  }
  if (flag == 0) {
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define REP(i, start, end) for (ll i = start, i##Len = (end); i < i##Len; ++i)
#define REPR(i, start, end) for (ll i = start, i##Len = (end); i > i##Len; --i)
using ll = long long;
using namespace std;

int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);

    ll n, u, v, ans = 0;
    cin >> n;
    REP(i, 1, n + 1)
    ans += i * (i + 1) / 2;

    REP(_, 0, n - 1)
    {
        cin >> u >> v;
        if (u > v)
            swap(u, v);
        ans -= u * (n - v + 1);
    }

    cout << ans << endl;
}


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

typedef long long ll;

long combi(int n, int r)
{
    if (r == 0)
    {
        return 1;
    }

    return (n - r + 1) * combi(n, r - 1) / r;
}
int main()
{
    ll N, M;
    cin >> N >> M;
    if (N == 1)
    {
        N = 0;
    }
    N = combi(N, 2);
    if (M == 0)
    {
        M = 0;
    }
    M = combi(M, 2);
    cout << N + M << endl;
}


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

int INF = 1001001001;

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

    if (n == 0) {
        cout << x << endl;
        return 0;
    } 

    set<int> p;
    rep(i, n) {
        int x;
        cin >> x;
        p.insert(x);
    }
    
    int ans = INF;
    int dif = INF;
    rep(i, 102) {
        if (p.count(i) == 0) {
            if (dif > abs(x - i)) {
                dif = abs(x - i);
                ans = i;
            }
        }
        // cout << "i: " << i << " ans: " << ans << " dif: " << dif << endl;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3560
N = int(input())
S = list(input())
num_E = []
for i in range(N):
  if i == 0 and S[i] == 'E':
    num_E.append(1)
  elif i == 0 and S[i] == 'W':
    num_E.append(0)
  elif S[i] == 'E':
    num_E.append(num_E[i - 1] + 1)
  else:
    num_E.append(num_E[i - 1])
num_turn = [None for _ in range(N)]
ans = 100000000000000000000000
for i in range(N):
  me = 1 if (S[i] == 'E') else 0
  num_turn[i] = i - (num_E[i] - me) + (num_E[N - 1] - num_E[i])
  if ans > num_turn[i]:
    ans = num_turn[i]
print(ans)

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

int main(){
  int a,b,k;
  cin>>a>>b>>k;
  if(b-a+1<=k*2)
  {
    for(int i=0;i<b-a+1;i++)
    {
        cout<<a+i<<"\n";
    }
  }else{
    for(int i=0;i<k;i++)
    {
      cout<<a+i<<"\n";
    }
    for(int i=k-1;i>=0;i--)
    {
      cout<<b-i<<"\n";
    }
  }

}


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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;
const int NIL = -1;
const ld PI = acosl(-1);

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

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

int main() {
	ios::sync_with_stdio(false); cin.tie(nullptr);
	//cout << fixed << setprecision(6);
	string o, e;
	cin >> o >> e;

	rep(i, o.size()){
		cout << o[i];
		if(i < e.size()){
			cout << e[i];
		}
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
    #include <stdio.h>
    #include <string>
    #include <math.h>
    #include<algorithm>
    #include <numeric>
    using namespace std;
     
    int main(){
      long long X,Y;
      cin >> X >> Y;
      long long ans=0;
      while(X<=Y){
       X*=2;
        ans++;
      }
      cout << ans << endl;
      return 0;}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define ff              first
#define ss              second
#define ll              long long
#define dd              double
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define vll             vector<long long>
#define vdd             vector<double>
#define vpii            vector<pair<int,int>>
#define vpll            vector<pair<long long,long long>>
#define vvi             vector<vector<int>>
#define vvl             vector<vector<long long>>
#define mii             map<int,int>
#define mll             map<long long,long long>
#define umii            unordered_map<int,int>
#define umll            unordered_map<long long,long long>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define rep(i,n)        for(int i=0;i<n;i++)
#define rep2(i,a,b)     for(int i=a;i<b;i++)
#define rev(i,n)        for(int i=n;i>=0;i--)
#define rev2(i,a,b)     for(int i=a;i>=b;i--)
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define inf             9e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define fio             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl            '\n'
#define all(x)          x.begin(),x.end()
#define d0(x)           cout <<x<<" "
#define d1(x)           cout <<x<<endl
#define d2(x,y)         cout <<x<<" "<<y<<endl
#define d3(x,y,z)       cout <<x<<" "<<y<<" "<<z<<endl
#define d4(x,y,z,w)     cout <<x<<" "<<y<<" "<<z<<" "<<w<<endl
#define read2(x,y)      cin>>x>>y
#define read3(x,y,z)    cin>>x>>y>>z
#define read4(x,y,z,w)  cin>>x>>y>>z>>w
#define read5(x,y,z,w,a)cin>>x>>y>>z>>w>>a
#define sz(a)           (int)a.size()
const ll mod=1e9+7;
const double PI = 3.14159265359;
const ll MOD=998244353;
void i_o()
{
   #ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
   #endif
}


int main() {
   fio
   i_o();
   int n;
   cin>>n;
   int A[n+1];
   rep2(i,1,n+1) cin>>A[i];
   unordered_map<int,int> m;
   ll ans=0;
   for(int i=1;i<=n;i++){
      m[i+A[i]]++;
      ans+=m[i-A[i]];
   }
   d1(ans);
   return 0;
}



Measured memory_bytes: 19236
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i=0; i<(long long)(n); i++)
#define REP(i, k, n) for(long long i=(long long)(k); i<(long long)(n); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define PQ(T) priority_queue<T>
#define PQS(T) priority_queue<T, vector<T>, greater<T> >
#define deci cout << fixed << setprecision(15);
typedef long long ll;
const ll inf = 1020304050607080910;
const ll mod = 1000000007;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
template<class T> bool chmin(T&x,T y){if(x>y){x=y;return true;}return false;}
template<class T> bool chmax(T&x,T y){if(x<y){x=y;return true;}return false;}
ll gcd(ll x,ll y){if(x>y)swap(x, y);while(x!=0){y%=x;swap(x, y);}return y;}
ll mpow(ll x,ll r){if(r==0)return 1;if(r%2==1){return x*mpow(x,r-1)%mod;}else{ll aa=mpow(x,r/2);return aa*aa%mod;}}

int main(){
	string T; cin >> T;
	ll cnt = 0, ans = 0, s[T.size()], sum = 0;
	vector<P> num;
	rep(i, T.size()){
		if(i==0){
			cnt++;
			s[i] = ((T[i]=='0')?1:0);
		}else if(T[i] != T[i-1]){
			if(T[i-1]=='1') num.pb(P(cnt, i-1));
			cnt = 1;
			s[i] = s[i-1] + ((T[i]=='0')?1:0);
		}else{
			cnt++;
			s[i] = s[i-1] + ((T[i]=='0')?1:0);
		}
		sum += ((T[i]=='0')?1:0);
	}
	if(T[T.size()-1]=='1') num.pb(P(cnt, T.size()-1));
	ll p = T.size() - sum;
	if(p%2==0) ans = (1+(p/2))*(p/2);
	else ans = (1+(p/2))*(p/2)+(p+1)/2;
	if(T[0] == '0'){
		ll ss = 0;
		rep(i, num.size()){
			ll q = num[i].first, r = num[i].second;
			ans += q*(s[r]/2) + (sum-s[r])*((q+1)/2);
			if(ss%2==0 && s[r]%2==1) ans += q/2;
			else if(ss%2==1 && s[r]%2==1) ans += (q+1)/2;
			ss += q;
		}
	}else{
		ll ss = num[0].first;
		ans += ((num[0].first+1)/2)*sum;
		rep(i, num.size()-1){
			ll q = num[i+1].first, r = num[i+1].second;
			ans += q*(s[r]/2) + (sum-s[r])*((q+1)/2);
			if(ss%2==0 && s[r]%2==1) ans += q/2;
			else if(ss%2==1 && s[r]%2==1) ans += (q+1)/2;
			ss += q;
		}
	}
	cout << ans << endl;
	return 0;
}


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

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

using namespace std;

using ll = long long;
using P = pair<int , int>;
  
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  int n, m, x; cin >> n >> m >> x;
  vector<int> c(n, 0);
  int v[n][m];

  bool f = 0;
  ll ans = 1e9;
  rep(i, n) {
    int y; cin >> y;
    c[i] = y;
    rep(j, m) {
      cin >> v[i][j];
    }
  }

  rep(i, 1 << n) {
    vector<int> vec(n, 0);
    rep(j, n) {
      vec[j] = (i>>j)&1;
    }
    
    vector<int> arr(n, 0);
    ll cost = 0;
    rep(j, n) {
      if(vec[j]) {
	cost += c[j];
	rep(k, m) {
	  arr[k] += v[j][k];
	}
      }
    }
    bool flag = 1;
    rep(j, m) {
      if(arr[j] < x) {
	flag = 0;
	break;
      }
    }
    if(flag) {
      f = 1;
      ans = min(ans, cost);
    }
  }
  if(f) {
    cout << ans << endl;
  } else {
    cout << -1 << endl;
  }
}
  
    


Measured memory_bytes: 3668
#include <bits/stdc++.h>
#define rep(i,l,r) for(int i=l; i<(int)(r); i++)
#define rep_eq(i,l,r) for(int i=l; i<=(int)(r); i++)
#define all(vec) vec.begin(),vec.end()
#define allr(vec) vec.rbegin(),vec.rend()
using namespace std;

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

using ll=int64_t;

using vb=vector<bool>;
using vc=vector<char>;
using vs=vector<string>;
using vi=vector<int>;
using vll=vector<ll>;
using vvi=vector<vi>;

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

  string S; cin >>S;

  vi cnt(3);
  rep(i,0,S.size()) {
    if (S[i]=='a') {
      cnt[0]++;
    } else if (S[i]=='b') {
      cnt[1]++;
    } else {
      cnt[2]++;
    }
  }

  string ans="YES";
  if (abs(cnt[0]-cnt[1])>1) {ans="NO";}
  if (abs(cnt[1]-cnt[2])>1) {ans="NO";}
  if (abs(cnt[2]-cnt[0])>1) {ans="NO";}

  cout <<ans <<'\n';
  return 0;
}


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

int main(){
  string s;
  cin >> s;
  sort(s.begin(), s.end());

  string t;
  cin >> t;
  sort(t.begin(), t.end());
  reverse(t.begin(), t.end());

  cout << ((s < t)? "Yes":"No") << endl;

}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstdio>
#include <queue>
#include <map>

#define rep(i, n) for(int i = 0; i < n; i++)
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define all(v) (v).begin(), (v).end()
#define MP make_pair

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> P;
typedef vector<P> vp;

void pp(vi v){
	rep(i, v.size()){
		cout << v[i] << ' ';
	}
	cout << endl;
}

void pp(vector<string> v){
	rep(i, v.size()){
		cout << v[i] << endl;
	}
}

void pp(int (*v)[1000], int size = 10){
	rep(i, size){
		rep(j, size){
			cout << v[i][j] << ' ';
		}
		cout << endl;
	}
}

P dif(P &a, P &b){
	return P(a.first-b.first, a.second-b.second);
}

bool equal(P &a, P&b){
	return (a.first == b.first && a.second == b.second);
}

// 平行移動はOK、回転はNG
bool linecmp(vp &a, vp &b){
	if(a.size() != b.size()) return false;
	vp diffs;
	rep(i, a.size()){
		diffs.push_back(dif(a[i], b[i]));
	}
	FOR(i, 1, diffs.size()){
		if( equal(diffs[i], diffs[i-1]) == false) return false;
	}
	return true;
}

int main(){
	int n;
	while(cin >> n,n){
		int m;
		cin >> m;
		vector<vp> target(4);
		target[0].resize(m);
		rep(i, m){	// 探す折れ線
			cin >> target[0][i].first >> target[0][i].second;
		}
		FOR(i, 1, 4){
			target[i].resize(m);
			rep(j, m){	// 90度回転
				target[i][j].first = target[i-1][j].second;
				target[i][j].second = -target[i-1][j].first;
			}
		}

		rep(i, n){	// 探される折れ線たち
			cin >> m;
			vp v(m), rv(m);
			rep(j, m){
				cin >> v[j].first >> v[j].second;
			}
			rv = v;
			reverse(all(rv));
			rep(j, 4){ // 4方向に対して比較
				if(linecmp(target[j], v) || linecmp(target[j], rv)){
//					cout << "***";
					cout << i+1 << endl;
					break;
				}
			}
		}
		cout << "+++++" << endl;
	}

	return 0;
}

Measured memory_bytes: 1196
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(10)

using namespace std;

typedef pair<int, int> P;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int N;
    cin >> N;
    vector<int> H(N);
    REP(i, N) cin >> H[i];

    int maxh = -1;
    int ans = 0;
    REP(i, N) {
        if (H[i] >= maxh) {
            ans++;
            maxh = H[i];
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 888
///mAAria...
#include<bits/stdc++.h>
 
using namespace std;
 
#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define pii pair<int,int>
#define pi 3.1415926535897932384626433832
#define mod 1000000007
//#define mod 998244353
#define inf 1000000000
#define pr1(a) cout << a << "\n"
#define pr2(a,b)cout << a <<  " " <<b<< "\n"
#define pr3(a,b,c) cout << a <<" " << b << " " << c << "\n"

const long double PI = acos(-1);

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

int gcd(int a, int b){
    if(b==0)return a;
    gcd(b,a%b);
}
const int maxn = 2*1e5 + 10;

void solve(){

    string s;
    cin >> s;

 for(int i = 0;i<3;i++){
    if(s[i]=='7'){
        cout << "Yes" <<endl; return;
    }

 }
 cout << "No" << endl;


} 

signed main() 
{   
    IOS;
    int t = 1;
    // cin >> t;

    for(int i = 1;i<=t;i++){
        solve();
    }
    return 0;
} 

 


Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
int a[101][101];
int n,e;
 void floyd(){
    for(int k=0;k<n;++k){
        for(int i=0;i<n;++i){
            if(a[i][k]==INT_MAX) continue;
            for(int j=0;j<n;++j){
                if(a[k][j]==INT_MAX) continue;
                a[i][j]=min(a[i][j],a[i][k]+a[k][j]);
            }
        }
    }
 }
int main(){
    int flag=0;
    fill(a[0],a[0]+101*101,INT_MAX);
    for(int i=0;i<101;++i) a[i][i]=0;
     scanf("%d %d",&n,&e);
     for(int i=0;i<e;++i){
        int v,b,c;
        scanf("%d %d %d",&v,&b,&c);
        a[v][b]=c;
     }
     floyd();
     for(int i=0;i<n;++i){
        if(a[i][i]<0){
            flag=1;
            break;
        }
     }
     if(flag){
        printf("NEGATIVE CYCLE\n");
     }
     else{
        for(int i=0;i<n;++i){
            for(int j=0;j<n;++j){
                if(j) printf(" ");
                if(a[i][j]>=INT_MAX) printf("INF");
                else printf("%d",a[i][j]);
            }
            printf("\n");
        }
     }

    return 0;
}



Measured memory_bytes: 3264
import math
import sys

X, Y = map(int, input().split())

#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return (m+x%m)%m

if (X + Y) % 3 != 0:
    print(0)
    sys.exit()

if X / 2 > Y or Y > X * 2:
    print(0)
    sys.exit()

x = X - ((X + Y) // 3)
y = Y - ((X + Y) // 3)

mod = 10 ** 9 + 7

numerater = 1
for i in range(1, x+y+1):
    numerater =  (numerater * i) % mod

denominator_x = 1
for i in range(1, x+1):
    denominator_x = (mod_inv(i, mod) * denominator_x) % mod

denominator_y = 1
for i in range(1, y+1):
    denominator_y = (mod_inv(i, mod) * denominator_y) % mod

res = (numerater * denominator_x * denominator_y) % mod

print(res)

Measured memory_bytes: 41692
N = int(input())
A = list(map(int, input().split()))
f = [[a] for a in A]
for i in range(N):
    for j in range(1<<N):
        if j & 1<<i:
            f[j] = sorted(f[j]+f[j^1<<i], reverse=True)[:2]
Ans = [sum(f[1])]
for a, b in f[2:]:
    Ans.append(max(Ans[-1], a+b))
print("\n".join(map(str, Ans)))


Measured memory_bytes: 190220
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
typedef long  l;
typedef pair<int,int> P;
const ll INF=100000000000000001;
const double PI=3.141592653589;


int main(){
  int a,b,t; cin>>a>>b>>t;
  int ans=0;
  int i=0;
  while(i+a<=t){
    ans+=b;
    i+=a;
  }
  cout<<ans<<endl;
}


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

int main(){
  int K;
  string s;
  cin>>s>>K;
  int N=s.size();
  for(int i=0;i<N;i++){
    if(s[i]=='a')continue;
    if(123-(int)s[i]<=K){
      K-=123-(int)s[i];
      s[i]='a';
    }
  }
  s[N-1]+=K%26;
  cout<<s<<endl;
}


Measured memory_bytes: 512
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
using namespace std;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
#define endl "\n"
inline bool EQ(double a, double b)
{
    return fabs(a - b) < 1e-9;
}
const int INF = 1 << 29;
typedef long long int ll;
inline int two(int n) { return 1 << n; }

inline int test(int n, int b) { return (n >> b) & 1; }
inline void set_bit(int &n, int b) { n |= two(b); }
inline void unset_bit(int &n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n)
{
    int res = 0;
    while (n && ++res)
        n -= n & (-n);
    return res;
}
template <class T>
void chmax(T &a, const T &b) { a = max(a, b); }
template <class T>
void chmin(T &a, const T &b) { a = min(a, b); }

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

    ll n;
    cin >> n;
    string s = "";
    char a[26];
    REP(i, 26)
    a[i] = 'a' + i;

    // n--;
    // if (n == 0)
    // {
    //     cout << "a" << endl;
    //     return 0;
    // }

    while (n)
    {
        s = (a[(n % 26 - 1 + 26) % 26]) + s;

        // if (n == 26)
        //     break;
        n--;
        n /= 26;
        // if (n == 1)
        //     break;
    }

    cout << s << endl;
    return 0;
}

Measured memory_bytes: 3652
#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, n, m) for (int i = m; i < n; i++)
#define MM(i, n, m) for (int i = m; i <= n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()

typedef long long ll;
/**
 * C問以降は ll を使う.
 * double型にするのを忘れない.
 * nC2の求め方 (1/2)*n*(n-1)
 * vector<型> 変数名(要素数, 初期値)
*/
int main()
{
  	int a, b, c;
  	cin >> a >> b >> c;
  	cout << (a+b >= c ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
 
int main(){
    int n,m,l;
    cin>>n>>m>>l;

    int A[n][m];
    for(int i=0;i<n;i++)
        for(int j=0;j<m;j++)
            cin>>A[i][j];

    int B[m][l];
    for(int i=0;i<m;i++)
        for(int j=0;j<l;j++)
            cin>>B[i][j];

    for(int i=0;i<n;i++){
        for(int j=0;j<l;j++){
            long value=0;
            for(int k=0;k<m;k++)
                value+=A[i][k]*B[k][j];
            cout<<value;
            if(j!=l-1)cout << " ";
        }
        cout<<endl;
    }

    return 0;
}


Measured memory_bytes: 3152
N, Q = map(int, input().split())
s = input()
td = [input().split() for i in range(Q)]

def tracking(i):
  now = s[i]
  for t, d in td:
    if t == now:
      move = -1 if d=='L' else 1
      i += move
      if i < 0 or i > N-1:
        return i
      now = s[i]
  return i

remove = 0
# 左側に消滅するゴーレムの範囲を求める
left = 0; right = N-1
while left+1 < right:
  mid = (left + right) // 2
  pos = tracking(mid)
  if pos == -1:
    left = mid
  else:
    right = mid

pos_l = tracking(left)
pos_r = tracking(right)
if pos_l == -1:
  if pos_r == -1: # left:消滅, right:消滅 <=> 全ゴーレムが左側に消滅
    remove += N
  else: # left:消滅, right:消滅せず
    remove += left + 1
# else: # left:消滅せず, right:消滅せず <=> どのゴーレムも左側に消滅せず
#   remove += 0

# 右側に消滅するゴーレムの範囲を求める
left = 0; right = N-1
while left+1 < right:
  mid = (left + right) // 2
  pos = tracking(mid)
  if pos == N:
    right = mid
  else:
    left = mid

pos_l = tracking(left)
pos_r = tracking(right)
if pos_r == N:
  if pos_l == N: # left:消滅, right:消滅 <=> 全ゴーレムが右側に消滅
    remove += N
  else: # left:消滅せず, right:消滅
    remove += N - right
# else: # left:消滅せず, right:消滅せず <=> どのゴーレムも右側に消滅せず
#   remove += 0

print(N - remove)

Measured memory_bytes: 96460
#include<iostream>
#include<set>
using namespace std;
int main()
{
    int n,i;
    cin>>n;
    int a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    std::set<int> sa(a,a+n);
   std::cout<< sa.size()<<std::endl;
}


Measured memory_bytes: 256
import math
inp = [int(input()) for _ in range(5)]
answer = sum([math.ceil(ent / 10) * 10 for ent in inp])
gaps = [ent % 10 for ent in inp if ent % 10 > 0]
if len(gaps):
	answer = answer - 10 + min(gaps)
print(answer)


Measured memory_bytes: 3060
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<random>
#include<stdio.h>
using namespace std;



static const int MAX_SIZE = 1 << 18; //segment tree のサイズ。この実装では2べきにする必要がある。 2^17 ≒ 1.3 * 10^5

typedef long long Int;
Int segMin[2 * MAX_SIZE - 1], segAdd[2 * MAX_SIZE - 1];

//区間[a, b)に値xを加算する.
void add(int a, int b, Int x, int k = 0, int l = 0, int r = MAX_SIZE)
{
	if (r <= a || b <= l) return; //もし交差しない区間であれば終える.
	
	if (a <= l && r <= b){ //もし今みている区間[l, r)が[a, b)に完全に内包されていれば
		segAdd[k] += x;  //区間[l, r)にkを加算する.
		return;
	}
	
	add(a, b, x, k * 2 + 1, l, (l + r) / 2); //子の区間に(必要があれば)xを加算する.
	add(a, b, x, k * 2 + 2, (l + r) / 2, r); //〃

	//親の区間の最小値は, 子の区間の最小値 + 自分に一様に加算されている値 である.一様に加算される値は更新しなくて良い.
	segMin[k] = min(segMin[k * 2 + 1] + segAdd[k * 2 + 1], segMin[k * 2 + 2] + segAdd[k * 2 + 2]);
}

Int getMin(int a, int b, int k = 0, int l = 0, int r = MAX_SIZE)
{
	if (r <= a || b <= l) return 1e20-1;
	
	if (a <= l && r <= b) return (segMin[k] + segAdd[k]); //完全に内包されていれば,その区間の最小値を返す.
	
	Int left = getMin(a, b, k * 2 + 1, l, (l + r) / 2); //子の区間の最小値を求める.
	Int right = getMin(a, b, k * 2 + 2, (l + r) / 2, r); //子の区間の最小値を求める
	
	return (min(left, right) + segAdd[k]); //親の区間の最小値は, 子の区間の最小値 + 自分に一様に加算されている値 である (大切なので2回書きました!!)
	
}
typedef long long int ll;
int main(){
    ll N,M;cin>>N>>M;
    vector<vector<pair<ll,ll>>> interval(N,vector<pair<ll,ll>>(0));
    for (int i=0;i<M;i++){
        ll l,r,a;
        cin>>l>>r>>a;
      	pair<ll,ll> p;
      	p.first=r-1;
        p.second=a;
        interval[l-1].push_back(p);
    }

	ll ans=0;
    for (int i=N-1;i>-1;i--){
        for (int j=0;j<interval[i].size();j++){
            ll r,a;
          	r=interval[i][j].first;
            a=interval[i][j].second;
            add(i,r+1,-a);
        }
      	ll zero=0;
        ll ans=std::max(zero,-getMin(0,N));
        if (i>0){
            add(i-1,i,-ans);
        }
      	else{
          cout<<ans<<endl;
        }
    }
}

Measured memory_bytes: 15872
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<tuple<string, int, int>> data;
  for(int i = 0; i < N; i++){
    int point;
    string name;
    cin >> name >> point;
    point = 100 - point;
    data.push_back(make_tuple(name, point,i));
  }
  sort(data.begin(), data.end());
  for(int i = 0; i < N; i++){
    int a;
    a = get<2>(data.at(i));
    cout << a + 1 <<endl; 
  }
}



Measured memory_bytes: 256
import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum

def getInputListInt():
    outputoData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData

def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList

def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList

# ===CODE===

a,b = map(int, input().split())

n = math.ceil((b-1)/(a-1))

print(n)

Measured memory_bytes: 13756
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;
const int INF = INT_MAX;

int main() {
	int64_t N, M;
	cin >> N >> M;

	vector<pair<int64_t, int64_t>> v(N);
	for (int64_t i = 0; i < N; i++) {
		cin >> v.at(i).first >> v.at(i).second;
	}
	sort(v.begin(), v.end());

	//for (int i = 0; i < N; i++) {
	//	cout << v.at(i).first << ' ' << v.at(i).second << endl;
	//}

	int64_t sum = 0;
	int64_t cnt = M;
	for (int64_t i = 0; i < N; i++) {
		if (!M) break;
		int64_t A, B;
		A = v.at(i).first;
		B = v.at(i).second;
		if (M < B) {
			sum += A * M;
			M = 0;
		}
		else {
			sum += A * B;
			M -= B;
		}
		//cout << M << endl;
	}

	cout << sum << endl;
}

Measured memory_bytes: 4824
lis = input().split(" ")

K = int(lis[0])
X = int(lis[1])

mini = X - (K - 1)
maxm = X + (K - 1)
list_a = []
for i in range(0, (K - 1) * 2 + 1):
    list_a.append(str((X - (K - 1)) + i))

print(" ".join(list_a))

Measured memory_bytes: 3064
program atcoder_contest_scheduling
  implicit none
  integer, parameter :: maxday = 365, maxtype = 26
  integer :: d, c(maxtype), s(maxtype, maxday), t(maxday), u(maxday)
  integer :: m, n, p, i
  real(8) :: t1, t2
  call cpu_time(t1)
  call random_seed_clock()
  read(*,*) d
  read(*,*) c
  read(*,*) (s(:, i), i = 1, d)
  t = (/(maxloc(s(:, i), 1), i = 1, d)/)
  m = score()
  u = t
  do
    p = next_int(d)
    do i = 1, maxtype
      t(p) = i
      n = score()
      if (m < n) then
        m = n
        u(p) = i
      else
        t(p) = u(p)
      end if
      call cpu_time(t2)
      if (t2 - t1 > 1.979d0) goto 100
    end do
  end do
  100 write(*,'(i0)') (u(i), i = 1, d)
contains
  integer function score() result(res)
    integer :: last(maxtype), i
    last = 0
    res = 0
    do i = 1, d
      last(t(i)) = i
      res = res + s(t(i), i) + dot_product(c, last - i)
    end do
  end
  subroutine random_seed_clock()
    integer :: nseed, clock, seed(1000)
    call system_clock(clock)
    call random_seed(size = nseed)
    seed(1:nseed) = clock
    call random_seed(put = seed(1:nseed))
  end
  integer function next_int(m) result(res)
    integer, intent(in)  :: m
    real(8) :: r
    call random_number(r)
    res = int(m * r) + 1
  end
end program atcoder_contest_scheduling

Measured memory_bytes: 3036
#include <bits/stdc++.h>
#define exrep(i, a, b) for(long long i = a; i <= b; i++)
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vector<ll> > vvl;
typedef vector<vector<P> > vvp;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int n;
int a[23][23];
ll dp[1<<21];
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  cin >> n;
  rep(i,n)rep(j,n)cin >> a[i][j];
  
  dp[0]=1;
  for(int bit=1;bit<(1<<n);bit++){
    int i=__builtin_popcount(bit);
    rep(j,n){
      if(bit>>j&1 && a[i-1][j]==1){
        dp[bit]+=dp[bit^1<<j];
        dp[bit]%=MOD;
      }
    }
  }
  cout << dp[(1<<n)-1] << endl;
      
    
  
  
  return 0;     
}


Measured memory_bytes: 16640
#include <bits/stdc++.h>
using namespace std;
using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;
using msi=map<string,int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()

int main(void){
    int d,e;
    while(cin>>d>>e,d){
        double ans=100000.0;
        rep(i,d+1){
            ans=min(ans,fabs(hypot(i,d-i)-e));
        }
        cout<<fixed<<setprecision(5)<<ans<<endl;
    }
}

Measured memory_bytes: 3236
//ProblemC

//#define USE_STDIO
//#define USE_LOG
//#define FILE_ERR

#ifdef _MYPC
#include "mypc.h"
#endif // _MYPC

#ifndef debug
#define debug(...)
#endif // !LOG

//include
#include <iostream>
#include <string>
#include <vector>
#include <bitset>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <functional>
#include <memory>
#include <complex>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <iomanip>

using namespace std;

//for
#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define forbe(i, begin, end) for(decltype(begin) i = (begin); i != (end); ++i)
#define forbes(i, begin, end, step) for(decltype(begin) i = (begin); i != (end); i += (step))

//int
using ll = long long;
using ull = unsigned long long;
using uint = unsigned;

//pair
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;
#define fi first
#define se second

//vector
template <typename Value>
static inline void fillv(Value& x, const Value& val) { x = val; }
template <typename Vector, typename Value>
static inline void fillv(Vector& v, const Value& val) { for (auto& x : v) fillv(x, val); }

static inline void Solve();

int main(int argc, char* argv[]) {
#ifdef REDIRECT_STDIO
	REDIRECT_STDIO;
#endif // REDIRECT_STDIO

	Solve();
	return 0;
}

//ProblemC
void Solve() {
	int n, d, m;
	cin >> n >> m >> d;

	double b = d == 0 ? n : 2 * (n - d);
	cout  << setprecision(15) << (m - 1) * b / n / n << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<map>
using namespace std;
int main(){
  long n,m;
  cin >> n >> m;
  map<long,long> rests;
  long s = 0;
  for(int i=0;i<n;i++){
    long a;
    cin >> a;
    s = (s + a) % m;
    rests[s]++;
  }
  long ans = 0;
  for(auto r : rests) {
    if(r.first == 0) ans += r.second * (r.second + 1) /2;
    else ans += r.second * (r.second - 1) / 2;
  }
  cout << ans << endl;
}


Measured memory_bytes: 4224
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int n = sc.nextInt();
		int[] a = new int[n];
		
		for(int i=0; i<n; i++){
		    a[i] = sc.nextInt();
		    h = h-a[i];
		    if(h<=0){
		        System.out.println("Yes");
		        return;
		    }
		}
		
		System.out.println("No");
	}
}


Measured memory_bytes: 58924
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pi M_PI
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;
void Main() {
  int n,x,y;
  cin >> n >> x >> y;
  ll a[n],l=-1,r=MAX;
  rep(i,n) R a[i];
  while(l+1<r) {
    ll m=(l+r)/2;
    ll sum=0;
    rep(i,n) {
      ll d=max(0LL,a[i]-m*y);
      sum+=ceil((double)d/(x-y));
    }
    if(sum<=m) r=m;
    else l=m;
  }
  pr(r);
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 1024
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,m,r,c,a[505][505];
int main(){
	scanf("%d%d%d%d",&n,&m,&r,&c);
	if(n%r){
		printf("Yes\n");
		for(int j=1;j<=m;j++)for(int i=1;i<=n;i++){
			if(i%r)a[i][j]=2333;
			else a[i][j]=-2333*(r-1)-1;
		}
		for(int i=1;i<=n;i++){
			for(int j=1;j<=m;j++)printf("%d ",a[i][j]);
			printf("\n");
		}
	}
	else if(m%c){
		printf("Yes\n");
		for(int i=1;i<=n;i++)for(int j=1;j<=m;j++){
			if(j%c)a[i][j]=2333;
			else a[i][j]=-2333*(c-1)-1;
		}
		for(int i=1;i<=n;i++){
			for(int j=1;j<=m;j++)printf("%d ",a[i][j]);
			printf("\n");
		}
	}
	else printf("No\n");
	return 0;
}

Measured memory_bytes: 2432
/**
 *    author:  FromDihPout
 *    created: 2020-06-21
**/

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


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    string s;
    cin >> s;
    int n = (int) s.length();
    if ((n % 2 == 0) ^ (s[0] == s[n - 1])) {
        cout << "Second" << endl;
    }
    else {
        cout << "First" << endl;
    }
    return 0;
}

Measured memory_bytes: 3764
#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int n, k, e[N];

void init() 
{
    for (int i=2; i<N; ++i) 
    {
        e[i] = 1;
    }
    for (int i=2; i<N; ++i) 
    {
        if (e[i] == 1) 
        {
            for (int k,j=i+i; j<N; j+=i) 
            {
                k=j / i;
                while (k % i == 0) 
                {
                    k /= i;
                    e[j]++;
                }
            }
        }
    }
}

const int mod = 1000000007;

int pw  (int a, int b, int m) 
{
    if (b==0)return 1;
    int c = pw(a, b/2, m);
    c = 1LL * c * c % m;
    if (b % 2 == 1) 
        c = c * 1LL * a % m;
    return c;
}

int f[N];

int main() 
{
    cin >> n >> k;
    init();
    int ans = 0;
    for (int i=k; i>=1; --i) 
    {
        f[i] = pw(k / i, n, mod);
        for (int j=i+i; j<=k; j+=i) 
        {
            f[i] = (f[i] - f[j] + mod) % mod;
        }
        ans = (ans + f[i] * 1LL * i) % mod;
    }
    cout << ans;
}

Measured memory_bytes: 7944
#include <iostream>

using namespace std;

int main(){
  int N;
  std::string S;
  cin >> N >> S;
  int ed_min = N;
  int dot_num_right = 0;
  for(unsigned int i = 0; i < S.size(); i++){
        if(S[i] == '.') dot_num_right++;
    }
  int shp_num_left = 0;
  for (int index = 0; index< N+1; index++){
    //std::string last = std::string(index, '.') + std::string(N-index, '#');
    if (index>0){
      if(S[index-1] == '.'){
        dot_num_right--;
      }
      else{
        shp_num_left++;
      }
    }
    int ed = shp_num_left + dot_num_right;

    if(ed < ed_min){
      ed_min = ed;
    }
  }
  std::cout << ed_min << std::endl;
  return 0;
}


Measured memory_bytes: 640
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
vector<pair<int,pair<int,int> > >g[10][110];
int ijk[30][110];
int v[30][110];
int dp[1000];
int tmp[1000];
int main(){
	int a,b,c,d;
	while(scanf("%d%d%d%d",&a,&b,&c,&d),a){
		for(int i=0;i<d;i++){
			for(int j=0;j<a;j++)g[i][j].clear();
		}
		for(int i=0;i<(1<<d);i++)dp[i]=tmp[i]=999999999;
		dp[0]=0;
		for(int i=0;i<b;i++){
			int v,w,x,y,z;
			scanf("%d%d%d%d%d",&v,&w,&x,&y,&z);
			v--;w--;z--;
			g[z][v].push_back(make_pair(w,make_pair(x,y)));
			g[z][w].push_back(make_pair(v,make_pair(x,y)));
		}
		int s,t;scanf("%d%d",&s,&t);s--;t--;
		int e;scanf("%d",&e);
		for(int i=0;i<e;i++){
			int p,q;scanf("%d%d",&p,&q);
			int val=0;
			for(int j=0;j<p;j++){
				int r;scanf("%d",&r);r--;
				val+=(1<<r);
			}
			tmp[val]=q;
		}
		for(int i=0;i<(1<<d);i++){
			for(int j=0;j<(1<<d);j++){
				dp[i|j]=min(dp[i|j],dp[i]+tmp[j]);
			}
		}
		int ret=999999999;
		for(int i=0;i<(1<<d);i++){
			for(int j=0;j<=c;j++)for(int k=0;k<a;k++){
				ijk[j][k]=999999999;
				v[j][k]=0;
			}
			priority_queue<pair<int,pair<int,int> > >Q;
			Q.push(make_pair(0,make_pair(s,0)));
			ijk[0][s]=0;
			while(Q.size()){
				int cost=-Q.top().first;
				int at=Q.top().second.first;
				int time=Q.top().second.second;
				Q.pop();
				if(v[time][at])continue;
				v[time][at]=1;
				for(int j=0;j<d;j++){
					for(int k=0;k<g[j][at].size();k++){	
						int to=g[j][at][k].first;
						int T=cost+((i&(1<<j))?0:(g[j][at][k].second.first));
						int h=time+g[j][at][k].second.second;
						if(h>c||v[h][to]||ijk[h][to]<=T)continue;
						ijk[h][to]=T;
						Q.push(make_pair(-T,make_pair(to,h)));
					}
				}
			}
			for(int j=0;j<=c;j++){
				ret=min(ret,ijk[j][t]+dp[i]);
			}
		}
		if(ret>99999999)printf("-1\n");
		else printf("%d\n",ret);
	}
}

Measured memory_bytes: 1296
#include <stdio.h>
#include <string.h>
int main(){
int n;
scanf("%d", &n);
int beki[]={1000,961,900,841,784,729,676,625,576,529,512,484,441,400,361,343,324,289,256,243,225,216,196,169,144,128,125,121,100,81,64,49,36,32,27,25,16,9,8,4,1};
for(int i=0;;i++){
if(beki[i]<=n){
printf("%d\n", beki[i]);break;
}
}
return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#define int long long
#define endl "\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

	
		
		
const int maxn = 2e5;
vector<int>B(maxn+1);
void update(int i,int val)
{
	while( i && i <= maxn )
	{
		B[i]=max(B[i],val);
		i+=i&-i;
	}
}
int query(int i)
{
	int s=0;
	while( i > 0 )
	{
		s=max(s,B[i]);
		i-=i&-i;
	}
	return s;
}	

int32_t main()
{
	int n , k , c ; cin >> n >> k >> c;
	vector<int>lcount(n+1),lmap(n+1),lgood(n+1);
	vector<int>rcount(n+1),rmap(n+1),rgood(n+1);
	string s;cin>>s;
	s='$'+s;
	fill(B.begin(),B.end(),0);
	for(int i=1;i<=n;i++)
	{
		if(s[i]=='x')continue;
		int mx = query(i-c-1);
		lcount[i]=mx+1;
		if(!lmap[ lcount[i] ]){
			lgood[i]=1;
			lmap[ lcount[i] ]=i;
		}
		update(i,lcount[i]);
	}
	fill(B.begin(),B.end(),0);
	for(int i=n;i>=1;i--)
	{
		if(s[i]=='x')continue;
		int j = n - i + 1;
		int mx = query(j-c-1);
		rcount[i]=mx+1;
		if(!rmap[ rcount[i] ]){
			rgood[i]=1;
			rmap[ rcount[i] ]=i;
		}
		update(j,rcount[i]);
	}
	for(int i=1;i<=n;i++)
	{
		if(s[i]=='x' || lcount[n] > k)continue;
		if(  lgood[i] && rgood[i] )cout<<i<<endl;
	}
		
	
}


Measured memory_bytes: 12736
#include<bits/stdc++.h>
#define N 100005
using namespace std;
int n;
int val[N*2],t[N*2];
int check(int v){
    for(int i=1;i<=n*2-1;i++) t[i]=val[i]>=v? 1:0;
    int posr=2*n,posl=0;
    for(int i=n;i<=2*n-2;i++)
        if(t[i]==t[i+1]){
            posr=i;break;
        }
    for(int i=n;i>=2;i--)
        if(t[i]==t[i-1]){
            posl=i;break;
        }
    if(posr==2*n&&posl==0){
        return t[n]^(n&1)^1;
    }
    return n-posl <= posr-n ? t[posl]:t[posr];
}
int main(){
    scanf("%d",&n);
    for(int i=1;i<2*n;i++) scanf("%d",&val[i]);
    int l=0,r=2*n;
    while(l+1<r){
        int mid=(l+r)>>1;
        if(check(mid)==1) l=mid;
        else r=mid;
    }
    printf("%d\n",l);
    return 0;
}

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

int main() {
    ll x,y,cnt=1;
    cin >> x >> y;
    while(1){
        x*=2;
        if(x<=y) ++cnt;
        else break;
    }
    cout << cnt << "\n";
    return 0;
}

Measured memory_bytes: 3612