akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define ll long long
#define rep(i,n) for(int i = 0; i < int(n); i++)
#define vi vector<int>
using namespace std;
const int INF = 1001001001;
const int MOD = 1e9+7;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
template<class T> inline bool chmax(T &a, const T &b){ if(a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b){ if(b<a) { a=b; return 1; } return 0; }

struct mint{ // auto MOD int
  ll x;
  mint(ll x=0) : x((x%MOD+MOD)%MOD){}  //コンストラクタ
  mint operator-() const { return mint(-x); } //符号変換
  mint operator+(const mint &a) const { return mint(*this) += a; } //算術演算子
  mint operator-(const mint &a) const { return mint(*this) -= a; }
  mint operator*(const mint &a) const { return mint(*this) *= a; }
  mint operator/(const mint &a) const { return mint(*this) /= a; }
  mint pow(ll n) const {  //繰り返し累乗
    if (!n) return 1;
    mint a = pow(n>>1);
    a *= a;
    if (n&1) a *= *this;
    return a;
  }
  mint inv() const { return pow(MOD-2); } // for prime mod
  mint& operator+=(const mint a){ if((x+=a.x) >= MOD) x-=MOD;  return *this; } //代入演算子
  mint& operator-=(const mint a){ if((x+=MOD-a.x) >= MOD) x-=MOD;  return *this; }
  mint& operator*=(const mint a){ (x *= a.x) %= MOD;  return *this; }
  mint& operator/=(const mint a){ return (*this) *= a.inv(); }
  friend ostream& operator<<(ostream &stout, const mint &tmp){ stout << tmp.x; return stout; }
};

int main(){
  cin.tie(0), ios::sync_with_stdio(false);
  int n; cin >> n;
  vi a(n); rep(i,n) cin >> a[i];
  mint ans = 1;
  vi remaining(n,3);
  rep(i,n){
    if(a[i] == 0) ans *= remaining[a[i]];
    else ans *= remaining[a[i]] - remaining[a[i]-1];
    remaining[a[i]]--;
  }
  cout << ans;
  cout << "\n";
  return 0;
}


Measured memory_bytes: 3976
#include<bits/stdc++.h>                          
using namespace std;
int a,b,i=1,f;
double x,y;
int main(){
    int a,b;
    cin>>a>>b;
    for(int i=1;i<=20050;i++)
	{
        x=i*0.08;
        y=i*0.1;
        if((int)x==a&&(int)y==b) {cout<<i<<endl;return 0;}
    }
    cout<<-1;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m;
    cin>>n>>m;
    vector<int> a(n);
    for(int i=0;i<n;i++)
    cin>>a[i];
    vector<pair<int,int>> v;
    for(int i=0;i<m;i++)
    {
        int b,c;
        cin>>b>>c;
        v.push_back(make_pair(c,b));
    }
    
    sort(v.begin(),v.end(),greater<>());
    sort(a.begin(),a.end());
    int cou=0;
    for(int i=0;i<m;i++)
    {
        int s =lower_bound(a.begin()+cou,a.end(),v[i].first)-cou-a.begin();
        for(int j=cou;j<cou+min(s,v[i].second);j++)
        {
            a[j]=v[i].first;
        }
        cou+=min(s,v[i].second);
        /*cout<<"s="<<s<<endl;
        cout<<"cou="<<cou<<endl;
        for(int i=0;i<n;i++)
        cout<<a[i]<<' ';
        cout<<endl;*/
    }

    long long ans=0;
    for(int i=0;i<n;i++)
    ans+=a[i];
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1784
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

int main(void) {
    int a, b;
    while (cin >> a >> b) {
        int tmp = a + b;
        int ans = 0;
        while (tmp) {
            tmp /= 10;
            ans++;
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 1160
N, K, Q = map(int, input().split())
A = []

for i in range(Q):
    a = int(input())
    A.append(a)

mn = Q - K + 1
R = [0] * (N + 1)

for i in A:
    R[i] += 1

# print(R, mn)

for ri in R[1:]:
    if ri >= mn:
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 9408
#include <algorithm>
#include <deque>
#include <functional>
#include <iostream>
#include <type_traits>
#include <vector>
using namespace std;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  vector<int> colors;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    auto itr = lower_bound(colors.begin(), colors.end(), a,
                           [](int a, int b) { return a >= b; });
    if (itr == colors.end()) {
      colors.push_back(a);
      continue;
    }
    *itr = a;
  }
  cout << colors.size() << endl;
}


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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

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

	ll n;cin >> n;
	double odd;
	for(int i = 1;i <= n;i++){
		if(i%2)odd += 1;
	}
	cout << Decimal << (odd / n) << endl;

	return 0;
}


Measured memory_bytes: 256
//BISMILLAH
#include <bits/stdc++.h>
using namespace std;
#define sz 100006
long long int dp[sz];
long long int h[sz];
long long int n,k;
     long long int solve(long long int i){
         if(i == n-1) return 0;
         else if(i>=n) return INT_MAX;
         long long int tt = INT_MAX,j;
         if(dp[i] != -1) return dp[i];
         for(j = 1;j<=k;j++){
             if((i+j) <= (n-1)) tt = min(tt,abs(h[i] - h[i+j]) + solve(i+j));
             else break;
         }
         dp[i] = tt;
         return dp[i];
     }
int main(){
    memset(dp,-1,sizeof(dp));
    long long int i,j;
    cin >> n >> k;
    for(i = 0;i<n;i++){
        cin >> h[i];
    }
    long long int res = solve(0);
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 12972
#include <bits/stdc++.h>
using namespace std;
using lint     = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    lint k;
    cin >> k;
    lint x, y;
    cin >> x >> y;
    bool flipx = false;
    bool flipy = false;
    if (x < 0) {
        flipx = true;
        x *= -1;
    }
    if (y < 0) {
        flipy = true;
        y *= -1;
    }
    bool sw = false;
    if (x > y) {
        sw = true;
        swap(x, y);
    }
    if (k % 2 == 0 && (x + y) % 2 == 1) {
        cout << -1 << "\n";
        return 0;
    }
    vector<lint> retx, rety;
    lint currx = 0, curry = 0;
    lint nk = ((x + y + k - 1) / k);
    if ((x + y) % 2 == 1 || (k % 2 == 0 && (x + y) % 2 == 0 && nk % 2 == 1 && nk != 1)) {
        lint xadd = min(x, k);
        currx += xadd;
        curry += k - xadd;
        retx.push_back(currx);
        rety.push_back(curry);
        if (curry > y) {
            lint rem = 2 * k - abs(x - currx) - abs(y - curry);
            lint pls = rem / 2;
            retx.push_back(x + pls);
            rety.push_back(curry - (k - (x + pls - currx)));
            retx.push_back(x);
            rety.push_back(y);
            currx = x;
            curry = y;
        }
    }
    while (currx != x || curry != y) {
        if ((abs(x - currx) + abs(y - curry) + k - 1) / k <= 2) {
            lint rem = 2 * k - abs(x - currx) - abs(y - curry);
            lint pls = rem / 2;
            retx.push_back(x + pls);
            rety.push_back(curry + (k - (x + pls - currx)));
            retx.push_back(x);
            rety.push_back(y);
            currx = x;
            curry = y;
        } else {
            lint xadd = min(x - currx, k);
            currx += xadd;
            curry += (k - xadd);
            retx.push_back(currx);
            rety.push_back(curry);

            xadd = min(x - currx, k);
            currx += xadd;
            curry += (k - xadd);
            retx.push_back(currx);
            rety.push_back(curry);
        }
    }

    int s = retx.size();
    for (int i = 0; i < s; ++i) {
        if (sw)
            swap(retx[i], rety[i]);
        if (flipx)
            retx[i] *= -1;
        if (flipy)
            rety[i] *= -1;
    }
    cout << s << "\n";
    currx = 0, curry = 0;
    for (int i = 0; i < s; ++i) {
        cout << retx[i] << " " << rety[i] << "\n";
        cerr << abs(retx[i] - currx) + abs(rety[i] - curry) << "\n";
        currx = retx[i];
        curry = rety[i];
    }
    return 0;
}

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

using namespace std;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
using vld = vector<ld>;
using vvld = vector<vld>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T& a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T& a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(998244353ll)
const long long INF = 1LL << 60;

// #define mod (ll)(1e9 + 7)

template <ll ModVal>
struct ModInt {
  ll x;

  ModInt(ll _x = 0) : x((_x % ModVal + ModVal) % ModVal) {
  }

  ModInt operator-() const {
    return ModInt(-x);
  }
  ModInt& operator+=(const ModInt a) {
    x += a.x;
    if (x >= ModVal)
      x -= ModVal;
    return *this;
  }
  ModInt& operator-=(const ModInt a) {
    x = x + ModVal - a.x;
    if (x >= ModVal)
      x -= ModVal;
    return *this;
  }
  ModInt& operator*=(const ModInt a) {
    x *= a.x;
    x %= ModVal;
    return *this;
  }

  ll ext_gcd(ll a, ll b, ll& x, ll& y) {
    if (b == 0) {
      x = 1;
      y = 0;
      return a;
    }
    ll tmp = a / b;
    ll d = ext_gcd(b, a - b * tmp, y, x);
    y -= tmp * x;
    return d;
  }

  // 逆元
  ModInt inv() {
    ll u, v;
    ext_gcd(x, ModVal, u, v);
    return ModInt(u);
  }

  ModInt inv(const ModInt a) {
    ll u, v;
    ext_gcd(a.x, ModVal, u, v);
    return ModInt(u);
  }

  ModInt& operator/=(const ModInt a) {
    return (*this) *= inv(a);
  }

  ModInt operator+(const ModInt a) const {
    ModInt retval(*this);
    return retval += a;
  }
  ModInt operator-(const ModInt a) const {
    ModInt retval(*this);
    return retval -= a;
  }
  ModInt operator*(const ModInt a) const {
    ModInt retval(*this);
    return retval *= a;
  }
  ModInt operator/(const ModInt a) const {
    ModInt retval(*this);
    return retval /= a;
  }

  ModInt pow(ll n) {
    ModInt ans(1);
    while (n) {
      if (n & 1)
        ans = ans * x;
      *this = (*this) * (*this);
      n = n >> 1;
    }
    return ans;
  }

  constexpr const ll& value() {
    return this->x;
  }
};

template <ll ModVal>
ostream& operator<<(ostream& os, const ModInt<ModVal>& a) {
  os << a.x;
  return os;
}

using mint = ModInt<mod>;

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);

  ll n, s;
  cin >> n >> s;

  vll a(n + 1);
  REP(i, n + 1) {
    cin >> a[i];
  }

  vector<vector<mint>> dp(n + 1, vector<mint>(s + 1));
  dp[0][0] = 1;
  REP(i, n + 1) {
    rep(j, s + 1) {
      dp[i][j] += dp[i - 1][j] * 2;
      if (j + a[i] <= s) {
        dp[i][j + a[i]] += dp[i - 1][j];
      }
    }
  }

  cout << dp[n][s] << endl;

  return 0;
}


Measured memory_bytes: 73684
list = []
while True:
    a = input().split()
    if '?' in a:
        break
    else:
        list.append(a)

for x in list:
    if '+' in x:
        print(int(x[0]) + int(x[2]))
    elif '-' in x:
        print(int(x[0]) - int(x[2]))
    elif '*' in x:
        print(int(x[0]) * int(x[2]))
    elif '/' in x:
        print(int(x[0]) // int(x[2]))



Measured memory_bytes: 5600
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan= new Scanner(System.in);
		int a=scan.nextInt();
		int b=scan.nextInt();
		int t=scan.nextInt();
		double e=(t+0.5);
		int c=0,d=0;
		while(true)
		{
			d+=a;
			c+=b;
			if(d>e)
			{
				System.out.println(c-b);
				break;
			}
			
		}
		
	}

}


Measured memory_bytes: 26968
#include<stdio.h>
#include<string.h>
int main(void){
    int n,ans=0;
    scanf("%d",&n);
    for(int i=1;9>=i;++i){
        for(int j=1;9>=j;++j){
            if(i*j==n)
            ++ans;
        }
    }
    if(ans>0)
    printf("Yes");
    else
    {
        printf("No");
    }
    
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
//#include <string>
#include <algorithm>
#include <cmath>
//#include <vector>
//#include <limits>

using namespace std;
/*void amin(long long  &x,long long  y)
{
    if ( y < x ) {
        x   =   y;
    }
}*/

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

    int N;//,a;
    long long sum[200001];
    sum[0] = 0;
    long long min_num = 2 * 10000000000;//pow(10, 9.0);

    cin >> N;

    for (int i = 1; i <= N; i++) {
        //cin >> a;
        cin >> sum[i];
        sum[i] += sum[i - 1];// + a;
    }
    
    for ( int i = 1; i < N; i++) {
        min_num = min(min_num, abs(sum[N] - (2 * sum[i])));
        //amin(min_num, abs(sum[N] - (2 * sum[i])));
    }
    cout << min_num << '\n';

}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
#define all(a) a.begin(),a.end()
typedef long long ll;

int digit_sum(ll x){
    int res = 0;
    while(x){
        res += x%10;
        x /= 10;
    }
    return res;
}

using P = pair<double,ll>;

int main(void){
    int k;
    cin>>k;
    vector<P> v;
    rep(d,15){
        ll pow10 = pow(10,d);
        rep(i,1000){
            ll a = i*pow10;
            ll x = pow10-1 + a;
            v.push_back({(double)x/digit_sum(x), x});
        }
    }
    sort(all(v));
    ll max = 0;
    int cnt = 0;
    for(P p : v){
        ll x = p.second;
        if(max >= x) continue;
        max = x;
        cout<<x<<endl;
        cnt++;
        if(cnt == k)break;
    }

    return 0;
}


Measured memory_bytes: 640
n, m = map(int, input().split())
A = [input() for _ in range(n)]
B = [input() for _ in range(m)]

for i in range(n - m + 1):  # 縦方向の探索
    for j in range(n - m + 1):  # 横方向の探索
        flag = 0
        if B[0] == A[i][j:j + m]:
            flag = 1
            for k in range(1, m):
                if B[k] != A[i+k][j:j + m]:
                    flag = 0
            if flag == 1:
                print('Yes')
                exit()
print('No')

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

typedef long long ll;
typedef pair<int, int> pii; 
const int N = 1e5+5, mod = 1e9+7;

void solve() {
    int l, r, d; cin >> l >> r >> d;

    int ans = 0, dd = d;
    while (d <= 100) {
        if (d >= l && d <= r) {
            ++ans;
        }
        d += dd;
    }
    cout << ans << endl;
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int t = 1; 
    while (t--) solve();
    return 0;
}


Measured memory_bytes: 3648
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, a, b = list(map(int, readline().split()))
    if (abs(a - b) - 1) % 2 != 0:
        print("Alice")
    else:
        print("Borys")


if __name__ == '__main__':
    solve()


Measured memory_bytes: 2940
#include<iostream>
using namespace std; // 575

int main() {
	int A[5];
	cin >> A[0] >> A[1] >> A[2] >> A[3] >> A[4];
	int mi = 10, sum = 0;
	for (int i = 0;i < 5;++ i) {
		mi = min(mi, (A[i] + 9) % 10 + 1);
		sum += (A[i] + 9) / 10 * 10;
	}
	cout << sum + mi - 10;
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり
また、コンテスト後に https://31536000.hatenablog.com/ で解説していると思うので、良かったら読んでねー

最後の端数だけ減らしたいので、一番1の位が小さいものを最後に持ち込む(0は除く)
後は単に切り上げ処理したやつの合計
*/

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <utility>

using namespace std;

template<typename T> 
void show(T a){
  for(auto i : a){ cout << i << " "; }
  cout << endl;
}
template<typename T> 
void showmatrix(T a){
  for(auto j: a){for(auto i : j){ cout << i; }cout << endl;}
  cout << endl;
}


int main(int argc, char *argv[]){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> v(n);
  int sum = 0;
  for(auto& i : v){
    cin >> i;
    sum += i;
  }
  for(auto i : v){
    if(sum - i <= i){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


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

struct Data{
  
  int t,s,d;

  bool operator<(const Data& data)const{
    if(data.t != t)return t < data.t;  
    if(data.s != s)return s < data.s;
    return d < data.d;
  }
  
};
int main(){

  int N,M;
  
  while(1){

    cin >>N>>M;
    if(N==0 && M==0)break;
    
    Data data[M];
    for(int i=0 ; i < M ; i++){
      cin >>data[i].t>>data[i].s>>data[i].d;
    }
    
    sort(data,data+M);
    
    bool isinfected[N+1];
    for(int i=1 ; i <= N ; i++)isinfected[i]=false;
    isinfected[1]=true;
    
    int cnt=1;
    for(int i=0 ; i < M ; i++){
      if(isinfected[data[i].s] && !isinfected[data[i].d]){
	isinfected[data[i].d]=true;
	cnt++;
      }
    }
    
    cout <<cnt<<endl;
    
  }
  
  return 0;
}

Measured memory_bytes: 1424
s = input()
q = int(input())
n = len(s)
flag = 0
mae = 0
ushiro = 0
b1 = ["a" for i in range(q)]
b2 = ["a" for i in range(q)]
for i in range(q):
    a = list(input().split())
    if a[0] == "1":
        flag += 1
    elif (flag+int(a[1])) % 2 == 1:
        b1[mae] = a[2]
        mae += 1
    else:
        b2[ushiro] = a[2]
        ushiro += 1

if flag % 2 == 0:
    for i in range(mae):
        print(b1[mae-1-i], end="")
    print(s, end="")
    for i in range(ushiro):
        print(b2[i], end="")
else:
    for i in range(ushiro):
        print(b2[ushiro-1-i], end="")
    print(s[::-1], end="")
    for i in range(mae):
        print(b1[i], end="")

Measured memory_bytes: 8192
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>

using namespace std;

int main(void){
  int N;
  cin >> N;

  vector<int> x(N), y(N);
  for(int i = 0; i < N; i++)
    cin >> x[i] >> y[i];

  double ans = 0;
  
  for(int i = 0; i < N; i++){
    for(int j = i + 1; j < N; j++){
      ans += sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
    }
  }

  cout << setprecision(14) << ans * 2 / N << endl;
      
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
  int y1,m1,d1,y2,m2,d2,day,i=0;
  int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
  for(;i<12;month[i+1]+=month[i],i++);
  while(true){
    cin>>y1>>m1>>d1>>y2>>m2>>d2;
    if (y1==-1)break;
    day=d2-d1+month[m2-1]-month[m1-1]+(y2-y1)*365;
    if(m2<3)y2--;
    if(m1>2)y1++;
    day+=y2/4-(y1-1)/4-y2/100+(y1-1)/100+y2/400-(y1-1)/400;
    cout<<day<<endl;
  }
  return 0;
}

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

using namespace std;

int main()
{
    int N;
    cin >> N;
    unordered_map<string,int> S;
    for (int i = 0; i < N; i++)
    {
        string s;
        cin >> s;
        S[s]=1;
    }

    cout << S.size() << endl;
    return 0;
}

Measured memory_bytes: 17692
n,k = gets.split.map(&:to_i)

arr = []
n.times {arr << gets.split.map(&:to_i)}
arr.sort_by!{|e| e[0]}

sum = 0
arr.each do |a,b|
    k -= b

    if k <= 0
        puts a
        break
    end
end

Measured memory_bytes: 12664
n = gets.to_i
buf=""
arr = []
flag = true
str = gets.chomp
buf = str[-1]
arr.push(str)
(n-1).times do
  str = gets.chomp
  flag = false if str[0] != buf
  buf = str[-1]
  arr.each do |word|
    flag = false if word == str
  end
  arr.push(str)
end

puts flag ? "Yes" : "No"

Measured memory_bytes: 3836
#include<bits/stdc++.h>
using namespace std;
const int N = 82;
int A[N];
int main() {
	string s;
	cin >> s;
	int ans = 0;
	int ctr = 0;
	for (int i = 0; i < 3; i++){
		if (s[i] == 'R')
			ctr++;
		else {
			ans = max(ans,ctr);
			ctr = 0;
		}
	}
	ans = max(ans,ctr);
	cout << ans;
	return 0;
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double PI=acos(-1);
int f[100];
int main()
{
  //  cout << atan(1)*180/PI;
    double a,b,x;
    cin >> a>> b >>x;
    double shangdi=x*2/a/a-b;

    if(shangdi<=0){

        shangdi=2*x/a/b;
   //  cout << shangdi << endl;
      //  cout << 90.0-atan(shangdi/b)*180.0/PI << endl;
        printf("%.10f",atan(b/shangdi)*180.0/PI);
    }else{

        shangdi=b-shangdi;
       // cout << shangdi << endl;
      //  cout << 90.0-atan(a/shangdi)*180.0/PI << endl;
        printf("%.10f",atan(shangdi/a)*180.0/PI);
    }


    return 0;
}




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

class modint {
  public:
    using ll = long long;
    ll num;
    static const ll MOD = 1e9+7;
    static vector<modint> factorial;

    modint(): num(0) {};
    modint(ll _n): num((_n + MOD) % MOD) {}
    modint(const modint &r): num(r.num) {}
    operator ll() const { return (num+MOD)%MOD; }
    friend istream& operator>>(istream& is, modint &r){
        ll num_;
        is >> num_;
        r = num_;
        return is;
    }
    modint operator+(const modint &r) const { return modint(num + r.num); }
    modint operator-(const modint &r) const { return modint(num - r.num); }
    modint operator*(const modint &r) const { return modint(num * r.num); }

    template<typename T>
    modint operator^(const T &r) const {
        if(r == 0) return 1;
        return (((*this)*(*this)) ^ (r/2)) * modint(r&1 ? num : 1);
    }
    modint operator/(const modint &r) const { return num * (r^(MOD-2)); }

    modint operator+=(const modint &r) { return *this = *this + r; }
    modint operator-=(const modint &r) { return *this = *this - r; }
    modint operator*=(const modint &r) { return *this = *this * r; }
    modint operator/=(const modint &r) { return *this = *this / r; }

    template<typename T>
    modint operator^=(const T &r) { return *this = *this ^ r; }

    static modint fact(int n){
        if(n <= 0) return 1;
        if((int)factorial.size() <= n) factorial.resize(n+1);
        if(factorial[n]) return factorial[n];
        return factorial[n] = modint(n) * fact(n-1);
    }

    static modint C(ll n,ll r){
        return n >= r ? fact(n)/(fact(n-r)*fact(r)) : modint(0);
    }
    static modint H(ll a,ll b){
        return C(a+b,a);
    }
};
vector<modint> modint::factorial;


int main(void){
    ll H,W,h,w;
    cin >> H >> W >> h >> w;
    modint res = modint::H(W-1,H-1);
    rep(x,w-1){
        res -= modint::H(H-h,x) * modint::H(h-2,W-x-1);
    }
    res -= modint::H(H-h,w-1) * modint::H(h-1,W-w);
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 8064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
// Welcome to my source code!

int main() {
    int n;
    cin >> n;
    P xy[n];
    for (int i = 0, x, y; i < n; i++) {
        cin >> x >> y;
        xy[i] = P(x, y);
    }
    double sum = 0;
    ll cnt = 0;
    sort(xy, xy+n);
    do {
        cnt++;
        double t = 0;
        for (int i = 1, cx, cy; i < n; i++) {
            cx = xy[i - 1].first, cy = xy[i - 1].second;
            t += sqrt(pow(abs(cx - xy[i].first), 2) + pow(cy - xy[i].second, 2));
        }
        sum += t;
    } while (next_permutation(xy, xy+n));
    sum /= cnt;
    cout << fixed << setprecision(10) << sum << endl;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    // 整数の入力
    int N , M , C;
    cin >> N >> M >> C;
    int b[20], a[20][20];
    int hantei, count;
    for(int j = 0 ; j < M ; j++){
        cin >> b[j];
    }
    for(int i = 0 ; i < N ; i++){
        for(int j = 0 ; j < M ; j++){
            cin >> a[i][j];
        }
    }
    count = 0;
    for(int i = 0 ; i < N ; i++){
        hantei = C;
        for(int j = 0 ; j < M ; j++){
            hantei = hantei + b[j] * a[i][j];
        }
        if (hantei > 0){
            count++;
        }
    }
    
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Text;

class B {
    public static void Main() {
        var s = new StringBuilder();
        foreach (var i in Console.ReadLine())
            switch (i) {
                case 'B': if (s.Length != 0) --s.Length; break;
                default: s.Append(i); break;
            }
        Console.WriteLine(s);
    }
}


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

using namespace std;

#ifndef aa
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
#define double long double
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define frev(a,b,c) for(int a=c; a>=b; a--)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
#define deb(x) cout << x << endl
#define done(x) {cout << x << endl;return;}
const ll infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
//const int mod = 998244353;
const int mod = 1e9 + 7;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vpii;
typedef map<int, int> mii;
typedef set<int> si;
typedef set<pair<int,int>> spii;
typedef queue<int> qi;


const int N = 2e5+5;


void solve() {

  int n;
  cin>>n;
  vi a(n);
  rep(i,0,n)
    cin>>a[i];
  int mx = a[0], ans = 0;
  rep(i,1,n){
    if(a[i]>mx)
      mx=a[i];
    else
      ans+=(mx-a[i]);
  }
  cout<<ans;

}


signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout << fixed << setprecision(15);
    int t = 1;
   //cin >> t;

    while (t--)
        solve();
#ifdef aa
    cout << endl << endl << endl << endl << "Time elapsed: " << (double)(clock() - clk) / CLOCKS_PER_SEC << endl;
#endif
    return 0;
}


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 divide(int a, int b) {
    return (a % mod) * powm(b, mod - 2) % mod;
}

int norm(int a) {
    while (a >= mod) a -= mod;
    while (a < 0) a += mod;
    return a;
}


int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}


Measured memory_bytes: 4780
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    string s;
    cin>>s;
    if(s[0]=='7' || s[1]=='7' || s[2]=='7')
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define rep(i,n) for (int i=0; i<n; i++)
#define REP(i,x,n) for (int i=x; i<n; i++)
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;

int main(){
  int n;
  cin >> n;
  
  vi b(n-1);
  rep(i,n-1) cin >> b.at(i);
  
  vi a(n);
  rep(i,n-1){
    if (i == 0){
      a.at(i) = b.at(i);
      a.at(i+1) = b.at(i);
      continue;
    }
    a.at(i) = min(a.at(i), b.at(i));
    a.at(i+1) = b.at(i);
  }

  int ans = 0;
  rep(i,n) ans += a.at(i);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)
#define RREP(i, n) for (ll i = (n) - 1; i >= 0; --i)
#define ALL(v) (v).begin(), (v).end()
template<class T>
using reverse_priority_queue = priority_queue<T, vector<T>, greater<T>>;


int main(){
    REP(i, 5){
        ll xi;
        cin >> xi;
        if(xi == 0){
            cout << i + 1 << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3624
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0

for i in range(A+1):
    tmp = X - 500 * i
    if tmp >0:
        for j in range(B+1):
            tmp2 = tmp - 100 * j
            if tmp2 > 0:
                for k in range(C+1):
                    tmp3 = tmp2 - 50 * k
                    if tmp3 == 0:
                        count += 1
            elif tmp2==0:
                count += 1
    elif tmp==0:
        count += 1
print(count)


Measured memory_bytes: 3064
S1 = input()
N1 = len(S1)
S2 = S1[:(N1-1)//2]
S3 = S1[(N1+3)-1//2:]
N2 = len(S2)
N3 = len(S3)
flag1 = True
flag2 = True
flag3 = True

for i in range(N1//2):
    if S1[i] != S1[-1-i]:
        flag1 = False
        break

for i in range(N2//2):
    if S2[i] != S2[-1-i]:
        flag2 = False
        break

for i in range(N3//2):
    if S3[i] != S3[-1-i]:
        flag3 = False
        break

print("Yes" if flag1 and flag2 and flag3 else "No")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  ll n; cin >> n;
  map <ll, ll> score;
  for (ll i = 1; i <= n; i++) {
    ll tmp = i;
    for (ll j = 2; j*j <= tmp; j++) {
      if (tmp%j == 0) {
        if (!score.count(j)) score[j] = 0;
        while (tmp%j == 0){
          score.at(j)++;
          tmp /= j;
        }  
      }
    }
    if (tmp != 1) {
      if (score.count(tmp)) score.at(tmp)++;
      else score[tmp] = 1;
    }
  }
  ll res = 1;
  for (auto p : score) {
    res *= p.second+1;
    res %= mod;
  }
  cout << res << endl;
}

Measured memory_bytes: 256
#n,m=map(int,input().split())
#p_3,p_4=map(int,input().split())
n=int(input())
#a=int(input())
#b=int(input())
#S=input()
#T=input()
#recipe=[list(input().split())for _ in range(n)]
#m=int(input())
#have=[list(input().split())for _ in range(m)]
#s=[list(input())for _ in range(n)]
b=list(map(int,input().split()))
#b=list(map(int,input().split()))
#c=list(map(int,input().split()))
#c=list(map(float,input().split()))
#n=int(input())
#s=[list(map(int,input().split()))for _ in range(n)]
#s=[list(input().split())for _ in range(n)]
#s=[input()for _ in range(n)]
if 3<=n:
    ans=b[0]+b[-1]
    for i in range(n-2):
        ans+=min(b[i],b[i+1])
else:
    print(b[0]*2)
    exit()
print(ans)





Measured memory_bytes: 2940
import java.util.Scanner;
 
public class Main {
 
	public Main() {
		// TODO 自動生成されたコンストラクター・スタブ
	}
 
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n,k,count,m,answer,index;
		float ans;
		String s,t;
		
			// 整数の入力
		
		n = sc.nextInt();
		k = sc.nextInt();
		count=0;
		
		for(index=0;index<n;index++) {
			m = sc.nextInt();
			if(m>=k) {
				count++;
			}
		}
		sc.close();
		System.out.print(count);

			// 出力
 
	}
}	

Measured memory_bytes: 46912
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
int INF = 1000000009;
map<ll, ll> mp;
int main()
{
    int n;
    cin >> n;
    vector<ll> a(n);
    set<ll> st;
    rep(i, n)
    {
        cin >> a[i];
        mp[a[i]]++;
        st.insert(a[i]);
    }
    ll ans = 0;
    for(auto e:st){
        ans += max((ll)0,mp[e] * (mp[e] - 1) / 2);
    }
    rep(i,n){
        cout << ans - max((ll)0,(mp[a[i]] * (mp[a[i]] - 1) / 2)) + max((ll)0,((mp[a[i]] - 1) * (mp[a[i]] - 2) / 2)) << endl;
    }
}

Measured memory_bytes: 17024
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
	ll xc=0,xe=0,xd=0,xf=0;
	string s;
	cin>>s;
	char c=s[0];
	char d=s[1];
	char e=s[2];
	char f=s[3];
	for (int i = 0; i < 4; ++i)
	{
		if(s[i]==c)xc++;
		if(s[i]==d)xd++;
		if(s[i]==e)xe++;
		if(s[i]==f)xf++;
	}
	if(xc==2 && xd==2 && xe==2 && xf==2)
		cout<<"Yes\n";
	else cout<<"No\n";

}

Measured memory_bytes: 256
;; AGC 023
(let* ((n (read))
       (s (make-array (list (1+ n)) :initial-element 0))
       (c (make-hash-table :size n :test 'equal))
       (ans 0))
  (setf (gethash 0 c) 1)
  (loop :for i :from 1 :to n
        :do (progn
              (setf (aref s i) (+ (aref s (1- i)) (read)))
              (if (gethash (aref s i) c)
                  (incf (gethash (aref s i) c))
                  (setf (gethash (aref s i) c) 1))))
  (maphash (lambda (key value)
             (declare (ignore key))
             (incf ans (/ (* value (1- value)) 2)))
           c)
  (format t "~A~%" ans))


Measured memory_bytes: 84320
// 17D8104010B 宮本拓輝 10_c c++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main(){
  int score[1001][1001];
  int n;
  cin>>n;
  int result[n];
  for(int s=0;s<n;s++){
    string x,y;
    cin>>x;
    cin>>y;

    for(int i=0;i<x.size();i++){
      for(int j=0;j<y.size();j++){
        if(x[i]==y[j]){
          score[i+1][j+1]=score[i][j]+1;
        }
        else{
          score[i+1][j+1]=max(score[i+1][j],score[i][j+1]);
        }
      }
    }
    //cout<<score[x.size()][y.size()]<<"\n";
    result[s]=score[x.size()][y.size()];

  }
  for(int i=0;i<n;i++){
    cout<<result[i]<<"\n";
  }

  return 0;
}


Measured memory_bytes: 6932
#include <bits/stdc++.h>
using intl = long long;
#define rep(i, n) for(intl i = 0; i < (intl)(n); i++)
#define repd(i, n) for(intl i = (intl)((n) - 1); i >= 0; i--)
#define repi(i, a, b) for(intl i = (intl)(a); i < (intl)(b); i++)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define INF = 1e9;
#define debug(x) cout << #x << ":" << x << endl
using namespace std;
int main(){
    intl a;
    cin >> a;
    intl b;
    cin >> b;
    intl c;
    cin >> c;
    intl five = 0;
    intl seven = 0;
    if(a == 5)five++;
    if(a == 7)seven++;
    if(b == 5)five++;
    if(b == 7)seven++;
    if(c == 5)five++;
    if(c == 7)seven++;
    if((five == 2)&&(seven == 1))cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define f first
#define s second
#define pb push_back
#define reset(a,b) memset(a,b,sizeof a);
#define ALL(x) x.begin(),x.end()
 
template <typename T>
void cetak(T t){cout << t << ')' << endl;}
template <typename T, typename... V>
void cetak(T t, V... v) {cout << t; if (sizeof...(v)) cout << ", "; cetak(v...);}
 
#define debug(x...) cout << '(' << #x << ") = ("; cetak(x) 
#define sz(x) (int)(x.size())
#define lt(x) (int)(x.length())


const int MOD = 1e9 + 7;

int add(int x, int y){
    int ret = x + y;
    if(ret >= MOD) ret -= MOD;
    return ret;
}
int sub(int x, int y){
    int ret = x - y;
    if(ret < 0) ret += MOD;
    return ret;
}
int mul(int x, int y){
    return (long long)x * y % MOD;
}


const int mx = 1e5 + 10;


int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    long long n, m, v, p;
    cin >> n >> m >> v >> p;
    vector<long long> a(n, 0);
    for(int i = 0; i < n; i++) cin >> a[i];
    sort(ALL(a));
    reverse(ALL(a));
    int lo = 0, hi = n - 1, mid, ans = -1;
    while(lo <= hi){
        mid = (lo + hi) >> 1;
        if(mid < p){
            ans = mid;
            lo = mid + 1;
            continue;
        }
        long long vote = v - 1;
        vote -= min(vote, p - 1);
        vote -= min(vote, n - mid - 1);
        vote *= m;
        auto aa = a;
        aa[mid] += m;
        for(int i = p - 1; i < mid; i++){
            if(aa[i] >= aa[mid]) continue;
            vote -= aa[mid] - aa[i];
            aa[i] = aa[mid];
        }
        int ada = 0;
        for(int i = p - 1; i < mid; i++) if(aa[i] > aa[mid]) ada = 1;
        if(vote > 0 || ada){
            hi = mid - 1;
        }
        else{
            ans = mid;
            lo = mid + 1;
        }
    }
    cout << ans + 1 << endl;
}

Measured memory_bytes: 1792
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {
	static int n;
	static List<List<Integer>> list;

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		n = Integer.parseInt(sa[0]);
		list = new ArrayList<>(n);
		for (int i = 0; i < n; i++) {
			list.add(new ArrayList<>());
		}
		for (int i = 0; i < n - 1; i++) {
			sa = br.readLine().split(" ");
			int x = Integer.parseInt(sa[0]) - 1;
			int y = Integer.parseInt(sa[1]) - 1;
			list.get(x).add(y);
			list.get(y).add(x);
		}
		br.close();

		if (dfs(0, -1) == 1) {
			System.out.println("Bob");
		} else {
			System.out.println("Alice");
		}
	}

	static int dfs(int x, int p) {
		int ret = 0;
		for (int next : list.get(x)) {
			if (next != p) {
				int c = dfs(next, x);
				ret ^= c;
			}
		}
		return ret + 1;
	}
}


Measured memory_bytes: 64548
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    int a = N%10; N/=10;
    int b = N%10; N/=10;
    int c = N%10; N/=10;
    cout << ((a == b && b == c)||(b == c && c == N) ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<string> VS;
typedef vector< vector<int> > VVI;
typedef vector< vector<ll> > VVL;
typedef pair<int,int> PII;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
#define ub upper_bound
#define lb lower_bound

int main(){
  string S;
  cin>>S;
  int ans=1;
  rep(i,S.size()/2){
    ans*=(S[i]==S[S.size()-1-i]);
  }
  int ans2=1;
  rep(i,S.size()/2/2){
    ans2*=(S[i]==S[S.size()/2-1-i]);
  }
  if(ans&&ans2) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<vector>
#include<set>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<cmath>
#include<stdlib.h>
#define M 200005
#define N 100
#define ll long long
#define oo 1000000000
#define mod 555555555
using namespace std;
int n,m,cnt[M],A[M],mm;
long long Tr1[2*M],Tr2[2*M],ans;
void Add1(int x,int y){
	while(x<=mm){
		Tr1[x]+=y;
		x+=x&(-x);
	}
}
long long Get1(int x){
	long long res=0;
	while(x){
		res+=Tr1[x];
		x-=x&(-x);
	}
	return res;
}
void Add2(int x,int y){
	while(x<=mm){
		Tr2[x]+=y;
		x+=x&(-x);
	}
}
long long Get2(int x){
	long long res=0;
	while(x){
		res+=Tr2[x];
		x-=x&(-x);
	}
	return res;
}

int main(){
	int i,j;
	long long mx=0;
	cin>>n>>m;
	mm=m*2;
	for(i=1;i<=n;i++)scanf("%d",&A[i]);
	for(i=2;i<=n;i++){
		ans+=A[i]-A[i-1];
		if(A[i]<A[i-1])ans+=m;
	}
	for(i=2;i<=n;i++){
		int a=A[i-1],b=A[i];
		if(a>b)b+=m;
		Add1(a+1,-a-1);
		Add1(b+1,a+1);
		Add2(a+1,1);
		Add2(b+1,-1);
	}
	for(i=1;i<=m;i++){
		long long res=Get2(i)*i+Get1(i);
		res+=Get2(i+m)*(i+m)+Get1(i+m);
		if(res>mx)mx=res;
	}
	cout<<ans-mx<<endl;
	return 0;
}
/*

*/
	
	

Measured memory_bytes: 6272
"use strict"
function main(arg) {

    if(arg.trim().split("\n")[0] === arg.trim().split("\n")[1].substr( 0, arg.trim().split("\n")[0].length)){
        console.log("Yes");
    }
    else{
        console.log("No");

    }

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

// chmin, chmax関数
template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) {
        xmax = x;
        return true;
    }
    return false;
}
template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) {
        xmin = x;
        return true;
    }
    return false;
}

//---------------------------

int main(){
    ll h,w;
    cin >> h >> w;
    ll ans = (h/2)*(w/2) + ((h+1)/2)*((w+1)/2);
    if(h==1 || w==1) ans = 1;
    cout << ans << endl;
    return 0;
}

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

using namespace std;

#define all(v)				((v).begin()), ((v).end())
#define allr(v)				((v).rbegin()), ((v).rend())
#define sz(v)				((int)((v).size()))
#define rep(i, v)		for(int i=0;i<sz(v);++i)
#define lp(i, n)		for(int i=0;i<(int)(n);++i)
#define lpi(i, j, n)	for(int i=(j);i<(int)(n);++i)
#define lpd(i, j, n)	for(int i=(j);i>=(int)(n);--i)
#define ll long long
#define pb					push_back
#define fIO ios_base::sync_with_stdio(0);cin.tie(0);

const ll oo = 1e8;
const double pi = 3.1415926535897;


const double EPS = (1e-7);
int dcmp(double x, double y) {	return fabs(x-y) <= EPS ? 0 : x < y ? -1 : 1;	}


typedef vector<int>                vi;
typedef vector<pair<int,int>>      vii;
typedef vector<ll>                 vll;
typedef vector<double>             vd;
typedef vector< vi >               vvi;
typedef vector< vd >               vvd;
typedef vector<string>             vs;
typedef pair<int, int>             pii;

/**
    * PLEASEEE READDD PROBLEEEM CARFULLY ****
    * Always check for OVERFLOW ll vs int
    * Always check for array bounds
    * Check for function return
    * READ OUTPUT SECTION AGAIN!!!
**/

struct edge{
    int from, to, w;

    edge(){}
    edge(int x, int y, int we): from(x), to(y), w(we){}

    bool operator < (const edge &rhs) const{
        return w > rhs.w;
    }

};

int main(){
    fIO

    int a, b;
    cin >> a >> b;

    // val * (0.08) = a
    // val * (0.1) = b

    int l = 1, r = 10005, ans = -1;

    while(l <= r) {
        int mid = (l + r) >> 1;

        int f = (mid * 0.08);
        int s = (mid * 0.1);

        //cout << mid << " " << f << " " << s << "\n";

        if(f == a && s == b) {
            ans = mid;
            r = mid - 1;
            continue;
        }

        if(f > a || s > b) r = mid - 1;
        else l = mid + 1;
    }
    cout << ans;
}










Measured memory_bytes: 256
#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>;
struct Edge
{
  int to;
  int weight;
  Edge(int t, int w) : to(t), weight(w) {}
};
using Graph = vector<vector<Edge>>;
// using Graph = vector<vector<int>>;

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 dx[8] = {-1, -1, -1, 0, 0, 1, 1, 1}, dy[8] = {-1, 0, 1, 1, -1, 1, 0, -1};

struct UnionFind
{
  vector<int> par;

  UnionFind(int n) : par(n, -1) {}

  int root(int x)
  {
    if (par[x] < 0)
      return x;
    else
      return par[x] = root(par[x]);
  }

  bool isSame(int x, int y)
  {
    return root(x) == root(y);
  }

  bool merge(int x, int y)
  {
    x = root(x);
    y = root(y);
    if (x == y)
      return false;
    if (par[x] > par[y])
      swap(x, y);
    par[x] += par[y];
    par[y] = x;
    return true;
  }

  int size(int x)
  {
    return -par[root(x)];
  }
};

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N, M;
  cin >> N >> M;
  vector<int> p(N);
  for (auto &it : p)
  {
    cin >> it;
    it--;
  }

  UnionFind uf(N);
  for (int i = 0; i < M; i++)
  {
    int x, y;
    cin >> x >> y;
    x--, y--;
    uf.merge(x, y);
  }

  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (p[i] == i)
      ans++;
    else {
      if (uf.root(i) == uf.root(p[i])) {
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3972
#include <iostream>
#include <queue>
#define int long long
using namespace std;
priority_queue<int>q[1010];
int n, p, t, x;
signed main() {
	cin >> n >> p;
	for (int i = 0; i < p; i++) {
		cin >> n >> t;
		if (!n) { cin >> x; q[t].push(x); }
		else if (q[t].size()) {
			if (n == 1)cout << q[t].top() << endl;
			else q[t].pop();
		}
	}
}


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

int main()
{
  string s;
  cin >> s;

  for (int i = 0; i < 4; i++)
    cout << s[i];
  cout << " ";
  for (int i = 4; i < 12; i++)
    cout << s[i];
  cout << endl;
  return 0;
}

Measured memory_bytes: 256
// https://atcoder.jp/contests/abc059/tasks/arc072_a

#include "algorithm"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define fi first
#define se second
using namespace std;
typedef long long ll;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;
template <typename T>
inline bool chmax(T& a, T b);
template <typename T>
inline bool chmin(T& a, T b);
void print_ints(vector<ll> v);
template <typename T>
void drop(T a);

const ll INF = 1e18;

void solve() {
  ll N;
  cin >> N;

  VL as(N);
  rep(i, N) cin >> as[i];

  ll res = INF;

  auto get_min = [&](bool first_plus) {
    ll r = 0;
    ll cur = 0;

    rep(i, N) {
      cur += as[i];

      bool is_plus_digit = first_plus ? i % 2 == 0 : i % 2 == 1;

      if (is_plus_digit && cur <= 0) {
        r += 1 - cur;
        cur += 1 - cur;
      } else if (!is_plus_digit && cur >= 0) {
        r += 1 + cur;
        cur -= 1 + cur;
      }
    }

    return r;
  };

  chmin(res, get_min(true));
  chmin(res, get_min(false));

  cout << res << endl;
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

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

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

void print_ints(vector<ll> v) {
  rep(i, v.size()) {
    if (i > 0) {
      cout << " ";
    }

    cout << v[i];
  }

  cout << endl;
}

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}


Measured memory_bytes: 1152
# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

n,X,Y,Z = map(int,read().split())

N = 1<<(X+Y+Z)
NX = 1<<X
NY = 1<<(X+Y)
NZ = 1<<(X+Y+Z)

MX = (1<<X) - 1
MY = (1<<(Y+X)) - (1<<X)
MZ = (1<<(X+Y+Z)) - (1<<(Y+X))

MMX = MX<<1
MMY = MY<<1
MMZ = MZ<<1

dp = [0]*N
dp[1] = 1

MOD = 10**9+7

for _ in range(n):
    ndp = [0]*N
    #cnt = 0
    #bad = 0
    for mask in range(N):
        if dp[mask]==0: continue
        mx = mask&MX
        my = mask&MY
        mz = mask&MZ
        
        for j in range(1,11):
            nmx = mx << j
            nmx &= MMX

            nmy = my << j
            nmy &= MMY

            nmz = mz << j
            nmz &= MMZ

            nmask = nmx|nmy|nmz|1
            if not nmask&(1<<(X+Y+Z)):
                ndp[nmask] += dp[mask]
                ndp[nmask] %= MOD

    dp = ndp
    #print(sum(dp),"sum")

ans = (pow(10,n,MOD)-sum(dp))
print(ans%MOD)




Measured memory_bytes: 73684