akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <bitset>
#include <vector>
#include <complex>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
int n;
string s , t;

int main(){
    cin >> n >> s >> t;
    rep(i,0,n) if(s.substr(i , n - i) == t.substr(0 , n - i)){
        cout << n + i << endl;
        return 0;
    }
    cout << n + n << endl;
    return 0;
}


Measured memory_bytes: 256
function Main(input) {
  var n = parseInt(input.split("\n")[0], 10);
  if (n === 10 || n === 100 || n === 1000 || n === 10000 || n === 100000) {
    console.log(10);
    return;
  } else {
    var sum = 0;
    while(n > 0) {
      sum += n % 10;
      n = Math.floor(n / 10);
    }
    console.log(sum);
    return;
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define rREP(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int h,w; cin >> h >> w;
    string maze[h];

    rep(i,h) cin >> maze[i];
    bool flag = true;
    int dx[4] = {-1,0,1,0};
    int dy[4] = {0,-1,0,1};
    rep(i,h) rep(j,w)
    {
        if (maze[i][j] == '#')
        {
            bool tmpflag = false;
            rep(k,4)
            {
                if (i+dx[k] >= 0 && i+dx[k] < h && j+dy[k]>=0 && j+dy[k] < w)
                {
                    if (maze[i+dx[k]][j+dy[k]] == '#')
                    {
                        tmpflag = true;
                        break;
                    }
                }
            }
            if (!tmpflag)
            {
                flag = false;
                break;
            }
        }
    }
    if (flag)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using P = pair<ll,ll>;
const ll mod = 1e9+7;
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REPS(i,n) for(ll (i)=1;(i)<=(n);(i)++)
#define RREP(i,n) for(ll (i)=(n-1);(i)>=0;(i)--)
#define RREPS(i,n) for(ll (i)=(n);(i)>0;(i)--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());

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

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

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    int A,B;
    cin >> A >> B;
    cout << (max(A,B) >= 9?":(":"Yay!") << "\n";
}

Measured memory_bytes: 256
# t -> s - > t -> s
sx, sy, tx, ty = map(int, input().split())

dx = tx - sx
dy = ty - sy

ans = []
for i in range(dx):
    ans.append("R")

for j in range(dy):
    ans.append("U")

for i in range(dx):
    ans.append("L")

for j in range(dy):
    ans.append("D")

ans.append("D")

for i in range(dx + 1):
    ans.append("R")

for j in range(dy + 1):
    ans.append("U")

ans.append("L")

ans.append("U")
for i in range(dx + 1):
    ans.append("L")

for j in range(dy + 1):
    ans.append("D")

ans.append("R")

print("".join(ans))


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

const int mod = 1e9 + 7;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n, k;
	cin >> n >> k;
	vector<long long> dp(k + 1);
	dp[0] = 1;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		
		vector<long long> dp2(k + 1);
		for (int j = k - 1; j >= 0; j--) {
			dp2[j + 1] = (dp2[j + 1] + dp[j])%mod;
			if (j + x + 1 <= k) dp2[j + x + 1] = ((dp2[j + x + 1] - dp[j])%mod + mod)%mod;
		}
		long long z{};
		for (int j = 0; j <= k; j++) {
			z = (z + dp2[j])%mod;
			dp[j] = (dp[j] + z)%mod;
		}
	}
	cout << dp[k];
}

Measured memory_bytes: 4784
#include <bits/stdc++.h>
using namespace std;
#define rep(i,ini,n) for(int i=ini;i<n;i++)
#define _rep(i,ini,n) for(int i=ini;i>=n;i--)
#define ToEnd(a) a.begin(),a.end()
uint64_t MOD=1000000007;

bool match(int num,int k1, int k2){
    bool matching;
    int a,b;
    a=to_string(num).at(k1)-'0';
    b=to_string(num).at(k2)-'0';
    if(a==b) matching=true;
    else matching=false;
    return matching;
}

int main(){
    int A,B; cin>>A>>B;

    int ans=0;
    rep(i,A,B+1) if(match(i,0,4) && match(i,1,3)) ans++;
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include<math.h>
using namespace std;

int main() {
	string s;
	int ans=0,x=0;
	cin >> s;
	for (int i = 0; i < s.size(); ) {
		if (s[i] == '0'&&s[i + 1] == '1') {
			ans += 2;
			i += 2;
			while (s[i] == '1'&&x>0) {
				x--;
				ans += 2;
				i++;
			}
		}
		else if (s[i] == '1'&&s[i + 1] == '0') {
			ans += 2;
			i += 2;
			while (s[i] == '0'&&x > 0) {
				x--;
				ans += 2;
				i++;
			}
		}
		else { x++; i++; }
	}
	cout << ans << endl;
}


Measured memory_bytes: 512
#include <stdio.h>
int main(void){
int i,j;
char c,s[9];
for (i=0;i<3;i++){
for (j=0;j<3;j++){
scanf("%c",&s[i*3+j]);
}
scanf("%c",&c);
}
printf("%c%c%c",s[0],s[4],s[8]);
return 0;
}

Measured memory_bytes: 128
#include<stdio.h>

int binarySearch(int A[100000],int key,int n){
	int left=0;
	int right=n;
	int mid;
	
	while(left<right){
		mid=(left+right)/2;
		
		if(key==A[mid]){return 1;}
		else if(key>A[mid]){left=mid+1;}
		else{right=mid;}
	}	
		return 0;
}

int main(void){
	int A[100000];
	int i,q,key,cnt,n;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&A[i]);
	}
	
	scanf("%d",&q);
	for(i=0;i<q;i++){
		scanf("%d",&key);
		if(binarySearch(A,key,n)){cnt++;}
	}
	
	printf("%d\n",cnt);
	
	return 0;
}

	



Measured memory_bytes: 2124
a,b,c,d = map(int, input().split())

if a >= 0 and c >= 0 :
  print(b*d)
elif b <= 0 and d <= 0:
  print(a*c)
elif a>=0 and c <= 0:
  print(max(a*d,b*d))
elif a<=0 and c >= 0:
  print(max(c*b, b*d))
else:
  print(max(a*d,b*d,c*b,a*c))

Measured memory_bytes: 9196
#include <iostream>
#include <cstdlib>

int main()
{
    int a,count,ans;
    
    std::cin>>a;
    
    for(int i =1;i<=a;i+=2)
    {    
        for(int n=1;n<=i;n+=2)
        {
        if(i%n==0)count++;
            
        }
        
        if(count==8)ans++;
        count =0;
             
    }
    
    std::cout<<ans<<std::endl;
    
    return 0;
    
}

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

using namespace std;
using ll = long long;

int main() {
#ifdef LOCAL
    freopen("in1.txt", "r", stdin);
    freopen("out1.txt", "w", stdout);
#endif


    string s;
    cin >> s;
    if(s[s.size()-1] == 's') s += "es";
    else s += "s";
    cout << s << endl;
    return 0;
}

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

using namespace std;
//FILE *fi=freopen("1.txt","r",stdin);
int n;
string s;
char up(char s)
{
    if(s=='Z')
        return 'A';
    return s+1;
}
int main()
{
    cin>>n>>s;
    s='.'+s;
    for(int i=1;i<=s.length()-1;i++)
    {
        for(int j=1;j<=n;j++)
            s[i]=up(s[i]);
    }
    for(int i=1;i<=s.length()-1;i++)
    {
        cout<<s[i];
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <utility>
#include <set>
#include <unordered_set>
#include <stack>
#include <iterator>
#include <random>
#include <fstream>
#include <chrono>
#include <math.h>
using namespace std;
#define int long long
#define forn(i, n) for (int i = 0; i < n; ++i)
vector<int>w;
vector<int>s;
vector<int>v;
int32_t main()
{
    int n;
    cin >> n;
    w.resize(n);
    s.resize(n);
    v.resize(n);
    for(int i = 0; i < n; i++){
        cin >> w[i] >> s[i] >> v[i];
    }
    vector<pair<int,int>> a;
    for(int i = 0; i < n; i++){
        a.push_back({w[i]+s[i], i});
    }
    sort(a.begin(),a.end());
    vector<int>dp(2e4+1,-2e18);
    dp[0] = 0;
    for(int i = 0; i < n; i++){
        auto x  = a[i].second;
        for(int j = 2e4; j >= 0; j--)
        {
            // первый не брать тек элемент
            // второй беру подложить вниз новый элемент
            // это возможно если прочность элемента x больше или равно чем вес j
            if (s[x] >= j && j + w[x] <= 2e4) {
                dp[j + w[x]] = max(dp[j + w[x]],dp[j] + v[x]);
            }
        }
    }
    int ans = -2e18;
    for(int i = 0 ; i < 2e4 + 1 ; i++){
        ans = max(ans, dp[i]);
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPLL(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
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(a > b){a = b; return 1;}return 0;}
typedef long long ll;

// ABC117 D - XXOR
// 2進数の桁数

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll N, K; cin >> N >> K;
  vector<ll> A(N);
  REP(i, N){
    cin >> A[i];
  }
  bool flag = false;
  bitset<40> a(0);
  REP(i, 40){
    bitset<40> bsK(K);
    ll cnt = 0;
    REP(j, N){
      bitset<40> bsA(A[j]);
      if(bsA[39-i] == 1) cnt++;
    }
    if(bsK[39-i] == 1 || flag == true){
      if(cnt*2 < N){
        a.set(39-i);
      }else{
        flag = true;
      }
    }
  }
  ll res = a.to_ullong();
  ll ans = 0;
  REP(i, N){
    ans += A[i]^res;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3976
#include<bits/stdc++.h>
using namespace std;
int n,k,a[100001],ans=1e9,sum;
int main()
{
cin>>n>>k;
for(int i=1;i<=n;i++)cin>>a[i];
sort(a+1,a+n+1);
for(int i=1;i<=n-k+1;i++)
{
sum=a[i+k-1]-a[i];
ans=min(sum,ans);
}
cout<<ans<<endl;
return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define rep(i,n,m) for(int i = (n); i <(m); i++)
#define rrep(i,n,m) for(int i = (n) - 1; i >=(m); i--)
#define pvec(vec) {for (auto v: vec) cout << v << ' '; cout << endl;}
#define pivec(vec) {rep(i, 0, vec.size()) cout << i << ':' << vec[i] << ' '; cout << endl;}

using namespace std;
using ll = long long;

int main()
{
    // read input
    int N, K;
    scanf("%d %d", &N, &K);

    vector<int> logs(N);
    rep(i, 0, N) cin >> logs[i];
    

    // binary search
    int low = 1;
    int high = 1000000010;
    while (low < high)
    {
        int mid = (low+high)>>1;

        int cnt = 0;
        for (int len: logs)
        {
            cnt += len / mid; 
            if (len>0 and len%mid == 0) --cnt;
        }

        //printf("%d %d\n", mid, cnt);

        if (cnt <= K)
            high = mid;
        else
            low = mid+1;
    }
   
    cout << low << endl;
    return 0;
}


Measured memory_bytes: 4020
#include<bits/stdc++.h>
using namespace std;
int N,dp[1<<17],h[1<<17];
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>N;
	for(int i=1;i<=N;i++){
		cin>>h[i]; dp[i]=1e9;
	} dp[1]=0;
	for(int i=1;i<N;i++)
		dp[i+1]=min(dp[i+1],dp[i]+abs(h[i]-h[i+1])),
		dp[i+2]=min(dp[i+2],dp[i]+abs(h[i]-h[i+2]));
	cout<<dp[N];
}

Measured memory_bytes: 1024
#include<iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <set>
#include <queue>
using namespace std;

// dinic
class max_flow {
    struct edge { int to, cap, rev; };
    static const int INT_MAX = 2147483647;
    int V;
    vector<vector<edge>> G;
    vector<int> level;

public:
    max_flow(int V) : V(V) { G.assign(V,vector<edge>()); }

    void add_edge(int from, int to, int cap) {
        G[from].push_back((edge) {to, cap, (int) G[to].size()});
        G[to].push_back((edge) {from, 0, (int) G[from].size()-1});
    }

    void bfs(int s) {
        level.assign(V,-1);
        queue<int> q;
        level[s] = 0; q.push(s);
        while (!q.empty()) {
            int v = q.front(); q.pop();
            for(auto &e: G[v]){
                if (e.cap > 0 and level[e.to] < 0) {
                    level[e.to] = level[v] + 1;
                    q.push(e.to);
                }
            }
        }
    }

    int dfs(int v, int t, int f) {
        if (v == t) return f;
        for (int i = 0; i < (int) G[v].size();i++) {
            edge& e = G[v][i];
            if (e.cap > 0 and level[v] < level[e.to]) {
                int d = dfs(e.to, t, min(f, e.cap));
                if (d > 0) {
                    e.cap -= d;
                    G[e.to][e.rev].cap += d;
                    return d;
                }
            }
        }
        return 0;
    }

    int run(int s, int t) {
        int ret = 0, f;
        while (bfs(s), level[t] >= 0) {
            while ((f = dfs(s, t, INT_MAX)) > 0) ret += f;
        }
        return ret;
    }
};


int main()
{
    // 整数の入力
    long long N,a_i,a_i_1,i;
    a_i_1 = -1;
    vector<long long>B;
    vector<long long> odds;
    vector<long long> evens;
    set<long long>primes;
    cin >> N;
    cin >> a_i;
    B.push_back(a_i);
    a_i_1 = a_i;

    for (i= 1; i< N ; i++) {
        cin >> a_i;
        if (a_i != a_i_1 + 1){
            B.push_back(a_i_1 + 1);
            B.push_back(a_i);
        }
        a_i_1 = a_i;
    }

    B.push_back(a_i_1 + 1);

    for(i=2;i<3163;i++){
        if(all_of(primes.begin(),primes.end(),[i](long long p) {return i % p != 0;})){
            primes.insert(i);
        }
    }

    for (i=0;i<B.size();i++){
        if (B[i] %2 == 0){
            evens.push_back(B[i]);
        }else{
            odds.push_back(B[i]);
        }
    }

    max_flow flow(B.size()+2);
    for(int i=0;i<odds.size();i++){
        flow.add_edge(0,i+1,1);
    }
    for(int i=0;i<evens.size();i++){
        flow.add_edge(odds.size()+i+1,B.size()+1,1);
    }

    for(int i=0;i<odds.size();i++){
        for(int j = 0;j<evens.size();j++){
            if(abs(odds[i] - evens[j]) > 2 &&
                all_of(primes.begin(),primes.end(), [&](long long p){return (abs(odds[i] - evens[j])) == p || (abs(odds[i] - evens[j])) % p != 0;})){
                flow.add_edge(i+1,odds.size()+j+1,1);
            }
        }
    }
    int K = flow.run(0,B.size()+1);
    cout << K + ((odds.size() - K)/2 + (evens.size() - K)/2) * 2 + ((odds.size() - K)%2)* 3 << endl;
    return 0;
}

Measured memory_bytes: 384
#include <stdio.h>
int main(void)
{
  int a, b, c, d;
  scanf("%d%d%d%d", &a,&b,&c,&d);
  do{
    c = c - b;
    a = a - d;
  }while(c > 0 && a > 0);
  if(c <= 0){
    printf("Yes");
  }
  else{
    printf("No");
  }
  return 0;
}

Measured memory_bytes: 1728
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


def gcd(x, y):
    while y:
        x, y = y, x % y
    return x


t = I()
for i in range(t):
    a, b, c, d = LI()
    g = gcd(b, d)
    if b > d or a < b:
        print('No')
    elif c >= b - 1:
        print('Yes')
    elif (a - (b - 1) - 1) // g != (a - (c + 1)) // g:
        print('No')
    else:
        print('Yes')

Measured memory_bytes: 41712
#include <iostream>

using namespace std;

int main() {
  int A1, A2, A3;
  cin >> A1 >> A2 >> A3;
  const char* result = "win";
  if (22 <= A1 + A2 + A3) {
    result = "bust";
  }
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vii = vector<ii>;
const ll MOD = 998244353;
const int INF = 1e9+9;
const int MAXN = 302;


int k, c[MAXN];
string s;
ll dp1[MAXN][MAXN], dp2[MAXN][MAXN];


int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> s >> k;
    int n = 0;
    for (int i = 0; i < (int) s.size(); ++i) {
        if (s[i] == '0') {
            ++n;
        } else {
            ++c[n];
        }
    }
    k = min(k, (int)s.size()-n);
    ++n;
    // cerr << n << "  " << k << endl;

    
    for (int pk = 0; pk <= k; ++pk) {
        for (int m = 0; m <= k; ++m) {
            dp1[pk][m] = 1;
        }
    }
    for (int pos = 1; pos < n; ++pos) {
        for (int i = 0; i < MAXN; ++i) {
            for (int j = 0; j < MAXN; ++j) {
                swap(dp1[i][j], dp2[i][j]);
            }
        }

        for (int pk = 0; pk <= k; ++pk) {
            for (int m = 0; m <= k; ++m) {
                dp1[pk][m] = 0;
                for (int i = 0; i <= c[pos] and i <= pk; ++i) {
                    dp1[pk][m] += dp2[pk-i][m+i];
                    dp1[pk][m] %= MOD;
                }
                for (int i = 1; i <= m; ++i) {
                    dp1[pk][m] += dp2[pk][m-i];
                    dp1[pk][m] %= MOD;
                }
    //             cerr << dp1[pk][m] << " ";
            }
    //         cerr << endl;
        }
    //     cerr << endl << endl;
    }
    cout << dp1[k][0] << endl;
}


Measured memory_bytes: 5080
# Sum of Three Integers
import sys

K, S = map(int, input().split())

def getAns(k, s) :
    cnt = 0
    for x in range(k + 1) :
        for y in range(k + 1) :
            z = s - x - y
            if 0 <= z <= k :
                cnt += 1
    return cnt
print(getAns(K, S))

Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <cstring>

using namespace std;
using ll = long long;
const ll inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
const ll mod = 1e9 + 7;

int main() {
    int n, l, ans = 0, mins = 1000001, selected = 0;
    cin >> n >> l;
    vector<int> apple(n);
    for (int i = 0; i < n; i++) {
        apple[i] = (l + i + 1 - 1);
        ans += apple[i];
    }
    for (const auto &a : apple) {
        if (mins > abs(a)) {
            mins = abs(a);
            selected = a;
        }
    }
    
    cout << (ans - selected) << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long a,b,k;
	cin>>a>>b>>k;
	if(a>=k)cout<<a-k<<" "<<b<<endl;
	else cout<<0<<" "<<max((long long)0,b-k+a);
	return 0;
}

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

int main(){
  string S;
  cin >> S;
  if(S.at(0) == S.at(1) && S.at(0) == S.at(2) && S.at(0) == S.at(3)) cout << "No" << endl;
  else if(S.at(0) == S.at(1)){
    if(S.at(2) == S.at(3)) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  else{
    if(S.at(2) == S.at(0) && S.at(3) == S.at(1)) cout << "Yes" << endl;
    else if(S.at(2) == S.at(1) && S.at(3) == S.at(0)) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<stack>
#include<vector>
#include<list>
#include<iomanip>
#include<map>
#include<queue>
#define pb push_back
#define pu push
#include<string>

using namespace std;

int main()
{
	long long int k,x,a;
	cin>>k>>x;
	a=500*k;
	if(a>=x)
	{
		cout<<"Yes"<<endl;
	}
	else
	{
		cout<<"No"<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>

int main(void){
    double a , b , C ;
    scanf("%lf %lf %lf" , &a , &b , &C) ;
    double Cr ;
    double PI = acos(-1) ;
    Cr = C * PI / 180 ;
    double S , h ;
    
    h = b * sin(Cr) ;
    S = a * h / 2 ;
    
    double c , l ;
    c = pow(a , 2) + pow(b , 2) -2 * a * b * cos(Cr) ;
    c = sqrt(c) ;
    l = a + b + c ;
    
    printf("%f\n%f\n%f\n" , S , l , h) ;
    return 0 ;
}


Measured memory_bytes: 2112
/*****************************************************
 *     created by: nayakashutosh9
 * "Winners Never Quit and Quitters Never Win".
*****************************************************/
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")
using namespace __gnu_pbds;
using namespace std;
#define int long long int
// #define endl '\n'
#define mod 1000000007
#define inf 1e18
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
const int N = 300005;
/**********************************************************************************************/


void solve() {
	int cur = 100;
	int x; cin >> x;
	int ans = 0;
	while (cur < x) {
		ans++;
		cur += (cur / 100);
	}
	cout << ans << endl;
}

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int t = 1, z = 1;
	// cin >> t; cin.ignore();
	while (t--) {
		// cout << "Case #" << (z++) << ": ";
		// clock_t start = clock();
		solve();
		// clock_t end = clock();
		// cout << (end-start) << endl;
		//print execution time in ms
	}

	return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <stack> 
#define LL long long
using namespace std;

LL n,r,c,tep1,tep2,tep3,tep4,ck,cnt[5];
struct zhk{LL num,id;}a[5][100010];
stack<LL>s;

inline LL get_num()
{
	LL now=0;LL fh=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')fh=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){now=(now<<3)+(now<<1)+ch-'0';ch=getchar();}
	return now*fh;
}
inline bool cmp1(zhk a,zhk b){return a.num<b.num;}
inline bool cmp2(zhk a,zhk b){return a.num>b.num;}

int main()
{
	r=get_num();c=get_num();n=get_num();
	for(int i=1;i<=n;i++)
	{
		tep1=get_num();tep2=get_num();
		tep3=get_num();tep4=get_num();
		if(tep1!=0&&tep1!=r&&tep2!=0&&tep2!=c)continue;
		if(tep3!=0&&tep3!=r&&tep4!=0&&tep4!=c)continue;
		if     (tep1==0){a[1][++cnt[1]].num=tep2;a[1][cnt[1]].id=++ck;}
		else if(tep2==c){a[2][++cnt[2]].num=tep1;a[2][cnt[2]].id=++ck;}
		else if(tep1==r){a[3][++cnt[3]].num=tep2;a[3][cnt[3]].id=++ck;}
		else if(tep2==0){a[4][++cnt[4]].num=tep1;a[4][cnt[4]].id=++ck;}
		if     (tep3==0){a[1][++cnt[1]].num=tep4;a[1][cnt[1]].id=ck;}
		else if(tep4==c){a[2][++cnt[2]].num=tep3;a[2][cnt[2]].id=ck;}
		else if(tep3==r){a[3][++cnt[3]].num=tep4;a[3][cnt[3]].id=ck;}
		else if(tep4==0){a[4][++cnt[4]].num=tep3;a[4][cnt[4]].id=ck;}
	}
	sort(a[1]+1,a[1]+cnt[1]+1,cmp1);sort(a[2]+1,a[2]+cnt[2]+1,cmp1);
	sort(a[3]+1,a[3]+cnt[3]+1,cmp2);sort(a[4]+1,a[4]+cnt[4]+1,cmp2);
	for(int i=1;i<=4;i++)
	for(int j=1;j<=cnt[i];j++)
	{
		if(s.size()&&s.top()!=a[i][j].id)s.push(a[i][j].id);
		else if(s.size())s.pop();
		else if(!s.size())s.push(a[i][j].id);
	}
	if(s.size())puts("NO");
	else puts("YES");
	return 0;
}

Measured memory_bytes: 6656
#include<iostream>
#include<cstdio>
#define N 2010
using namespace std;

int n,m,Q,qz[N][N],ha[N][N],lie[N][N];
bool mm[N][N];
char str[N];

int main()
{
	int i,j,a,b,c,d;
	cin>>m>>n>>Q;
	for(i=1;i<=m;i++)
	{
		scanf("%s",str+1);
		for(j=1;j<=n;j++)
		{
			mm[i][j]=(str[j]=='1');
		}
		for(j=1;j<n;j++) if(mm[i][j]==mm[i][j+1]&&mm[i][j]) ha[i][j]=1;
		if(i>=2)
			for(j=1;j<=n;j++) if(mm[i][j]==mm[i-1][j]&&mm[i][j]) lie[i-1][j]=1;
	}
//	for(i=1;i<=m;i++){for(j=1;j<=n;j++) cout<<lie[i][j]<<" ";puts("");}return 0;
	for(i=1;i<=m;i++)
	{
		for(j=1;j<=n;j++)
		{
			qz[i][j]=qz[i-1][j]+qz[i][j-1]-qz[i-1][j-1]+mm[i][j];
			ha[i][j]+=ha[i-1][j]+ha[i][j-1]-ha[i-1][j-1];
			lie[i][j]+=lie[i-1][j]+lie[i][j-1]-lie[i-1][j-1];
		}
	}
	for(i=1;i<=Q;i++)
	{
		scanf("%d%d%d%d",&a,&b,&c,&d);
		printf("%d\n",
		qz[c][d]-qz[c][b-1]-qz[a-1][d]+qz[a-1][b-1]-
		(ha[c][d-1]-ha[c][b-1]-ha[a-1][d-1]+ha[a-1][b-1])-
		(lie[c-1][d]-lie[c-1][b-1]-lie[a-1][d]+lie[a-1][b-1])
		);
	}
}

Measured memory_bytes: 53120
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>

using namespace std;

long long MOD = 1000000007;

int main(){
    long long N;
    cin >> N;
    long long ans=0;
    for(long long i=1; i*i<N; i++){
        if(N%i==0){
            long long m=N/i;
            m--;
            if(m>i){
                ans+=m;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FR first
#define SE second
#define MOD 998244353
#define inv4 748683265

using namespace std;

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

ll pow_mod(ll x,int k) {
  ll ans=1;
  while (k) {
  	if (k&1) ans=ans*x%MOD;
  	x=x*x%MOD;
  	k>>=1;
  }
  return ans;
}

const int Maxn=5000000+5;

int facd[Maxn],facv[Maxn];

void pre(int n) {
  facd[0]=1;
  for(int i=1;i<=n;i++) facd[i]=(ll)facd[i-1]*i%MOD;
  facv[n]=pow_mod(facd[n],MOD-2);
  for(int i=n-1;i>=0;i--) facv[i]=(ll)facv[i+1]*(i+1)%MOD;
}

inline ll C(int n,int m) {
  return (n<m)?0:(ll)facd[n]*facv[m]%MOD*facv[n-m]%MOD;
}

int main() {
  int n;
  scanf("%d",&n);
  n>>=1;
  pre(n);
  int ans=1;
  for(int i=1;i<=n;i++) ans=ans*9LL%MOD;
  ll s1=0,s2=inv4,s3=pow_mod(4LL,n);
  for(int i=1;i<=n;i++) {
  	if (i>1) s1=(s1+(s1-C(i-1,(i-2)>>1)*s2)*4LL)%MOD;
  	if (i&1) {
	  s2=s2*4LL%MOD;
	  s1=(s1+C(i,i>>1)*s2)%MOD;
    }
    s3=s3*inv4%MOD;
    ans=(ans-2LL*s3*C(n,i)%MOD*s1)%MOD;
  }
  printf("%d\n",(ans+MOD)%MOD);
  return 0;
} 

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

using namespace std;

#define ll long long

vector<int> construct(int n, int a, int b) {
	assert(a + b <= n + 1 && ((ll)a) * b >= n);
	vector<int> res(n, 0);
	int ptr = 0;
	for (int i = b; i > 0; --i)
		res[ptr++] = i;
	if (ptr == n)
		return res;
	vector<int> bsz(a - 1, (n - b) / (a - 1));
	for (int i = 0; i < (n - b) % (a - 1); ++i)
		++bsz[a - 2 - i];
	int bmx = b;
	for (int i = 0; i < bsz.size(); ++i) {
		bmx += bsz[i];
		int nx = bmx;
		for (int j = 0; j < bsz[i]; ++j)
			res[ptr++] = nx--;
	}
	return res;
}

signed main() {
	int N, A, B;
	cin >> N >> A >> B;

	if (A + B > N + 1 || ((ll)A) * B < N) {
		cout << -1 << endl;
	}
	else {
		vector<int> ans = construct(N, A, B);
		for (auto pi : ans)
			cout << pi << " ";
		cout << endl;
	}

	return 0;
}

Measured memory_bytes: 3380
// ABC139C.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

//#include "pch.h"
#include <iostream>
#include<vector>
using namespace std;
int main()
{
	int N;
	cin >> N;
	vector<int>H(N);
	vector<int>dp(N);
	for (int i = 0; i < N; i++)
	{
		cin >> H.at(i);
	}
	// 後ろから見ていったほうが簡単
	for (int j = N - 1; j >= 1; j--)
	{
		if (H.at(j - 1) >= H.at(j))
		{
			dp.at(j - 1) = dp.at(j) + 1;
		}
		else
		{
			dp.at(j - 1) = 0;
		}
	}
	// 最大値を探す
	int max = 0;
	for (int k = 0; k < N; k++)
	{
		if (max < dp.at(k)) {
			max = dp.at(k);
		}
	}
	cout << max << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define int long long
int n,a[100007],b[100007];
long long pend1=0,pend2=0;
signed main(){
	ios_base::sync_with_stdio(0);
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	for(int i=1;i<=n;i++){
		cin>>b[i];
		if(a[i]%2!=b[i]%2){
			b[i]++;
			if(pend2==0) pend1++;
			else pend2--;
		}
		long long vl=abs(a[i]-b[i])/2;
		if(a[i]<b[i]){
			if(pend1>=vl) pend1-=vl, vl=0;
			else vl-=pend1, pend1=0;
			pend2+=vl;
		}
		else if(a[i]>b[i]){
			vl*=2LL;
			if(pend2>=vl) pend2-=vl, vl=0;
			else vl-=pend2, pend2=0;
			pend1+=vl;
		}
	}
	if(pend1*2<=pend2) cout<<"Yes";
	else cout<<"No";
}


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

using namespace std;
using ll = long long;

const int MOD = 1000000007;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<int> D(N + 1, 0);
  for (int i = 2; i <= N; i++) {
    int n = i;
    for (int j = 2; j <= n; j++) {
      while (n % j == 0) {
        D[j]++;
        n /= j;
      }
    }
  }
  int res = 1;
  for (int i = 2; i <= N; i++) {
    res = 1LL * res * (D[i] + 1) % MOD;
  }
  cout << res << '\n';
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <bitset>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <unordered_map>
#define Debug 0
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 1000000007;

Int mod_pow(Int x, Int n) {
    Int res = 1;
    while(n > 0) {
        if(n & 1) res = (res * x) % MOD; //ビット演算(最下位ビットが1のとき)
        x = (x * x) % MOD;
        n >>= 1; //右シフト(n = n >> 1)
    }
    return res;
}

//最大公約数
template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

//最小公倍数
template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

void fast_input() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}


int main(){
    int N, K; cin >> N >> K;
    vector<pair<int, int>> RLE;
    string S; cin >> S;
    S.push_back('2');
    char first = S[0];
    int cnt = 0;
    for (int i = 0; i < S.length(); i++) {
        if (first == S[i]) cnt++;
        else {
            RLE.push_back({first - '0', cnt});
            first = S[i];
            cnt = 1;
        }
    }
    cnt = 0;
    int ans = 0;
    size_t tail = 0;
    size_t head = 0;
    while (head < RLE.size() && tail < RLE.size()) {
        if (RLE[head].first) {
            cnt += RLE[head].second;
            head++;
        } else {
            if (K > 0) {
                cnt += RLE[head].second;
                head++;
                K--;
            } else {
                if (RLE[tail].first == 0){
                    cnt -= RLE[tail].second;
                    tail++;
                    K++;
                } else {
                    cnt -= RLE[tail].second;
                    tail++;                    
                }
            }
        }
        ans = max(ans, cnt);
    }
    cout << ans << endl;
}




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

using namespace std;

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

#define mt make_tuple
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sqr(x) ((ll)(x) * (x))

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

    vvi v(n), dp(n);

    for(int i = 0; i < n; i++)
    {
        v[i].resize(3);
        dp[i].resize(3);

        for(int j = 0; j < 3; j++)
        {
            cin >> v[i][j];
        }
    }

    dp[0][0] = v[0][0];
    dp[0][1] = v[0][1];
    dp[0][2] = v[0][2];

    for(int i = 1; i < n; i++)
    {
        dp[i][0] = v[i][0] + max(dp[i-1][1], dp[i-1][2]);
        dp[i][1] = v[i][1] + max(dp[i-1][0], dp[i-1][2]);
        dp[i][2] = v[i][2] + max(dp[i-1][0], dp[i-1][1]);
    }

    cout << max(dp[n - 1][0], max(dp[n - 1][1], dp[n - 1][2])) << '\n';

    return 0;
}


Measured memory_bytes: 11136
n=int(input())
pop=[]
jop=[]
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        pop.append(i)
for j in range(len(pop)):
    jop.append(max(len(str(pop[j])),len(str(n//pop[j]))))
print(min(jop))


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

int main(){
    int n;
    cin>>n;
    int v[n],c[n];
    int ans=0;
    for(int i=0;i<n;i++) cin>>v[i];
    for(int i=0;i<n;i++) cin>>c[i];
    for(int i=0;i<n;i++){
        if(v[i]>c[i]) ans+=v[i]-c[i];
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#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>;
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(x) x.begin(),x.end()
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

int n;
vector<int>a;
ll solve(){
   ll ans=0;
   

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

    cin>>n;
    a.resize(1000000);
    for(int x=1;x<=100;x++)
     for(int y=1;y<=100;y++)
      for(int z=1;z<=100;z++){
          int res=x*x+y*y+z*z+x*y+y*z+x*z;
          a[res]++;
      }
      for(int i=1;i<=n;i++){
          cout<<a[i]<<endl;
      }
    //cout<<solve()<<endl;
    return 0;
}

Measured memory_bytes: 7160
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp15
{
    class Class56
    {
        static void Main()
        {
            string s = Console.ReadLine();

            List<int> list = new List<int>();
            int sp = -1, gp = -1;
            for(int i = 0; i < s.Length; i++)
            {
                if (sp == -1 & s[i] == 'A') sp = i;
                if(sp!=-1&s[i] == 'Z')
                {
                    gp = i;
                    list.Add(gp - sp+1);
                    
                    
                }
            }
            Console.WriteLine(list.Max());
        }
    }
}


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

#define ll long long

#define fr(i,a,b) for (ll i = (a), _b = (b); i <= _b; i++)
#define frr(i,a,b) for (ll i = (a), _b = (b); i >= _b; i--)
#define rep(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (ll i = n - 1; i >= 0; i--)
#define fill(ar,val) memset(ar, val, sizeof(ar))
#define fill0(ar) fill((ar), 0)
#define debug(x) cout<<#x<<": "<<x<<endl

#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second

typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef vector<ii> vii;
typedef vector<int> vi;

#define INF 1000000000000000000
#define PI 3.14159265358979323846L

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

    ll n;
    cin >> n;

    string s;
    cin >> s;

    ll r = 0;
    ll b = 0;

    rep(i,n)
    {
    	if(s[i]=='R')
    		r++;
    	else
    		b++;
    }

    if(r>b)
    	cout << "Yes" << endl;
    else
    	cout << "No" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
map<string,int>mp1;
map<string,int>mp2;
string nn[120],mm[120];
int main(){
	int n,m,mx=0;
	cin>>n;
	for(int i=0;i<n;++i){
		cin>>nn[i];
		mp1[nn[i]]++;
	}
	cin>>m;
	for(int i=0;i<m;++i){
		cin>>mm[i];
		mp2[mm[i]]++;
	}
	for(int i=0;i<n;++i){
		mx=max(mx,mp1[nn[i]]-mp2[nn[i]]);
	}
	cout<<mx<<endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(const char c[]){
  int i=0;
  for(i=0;c[i]!='\0';i++){
    putchar_unlocked(c[i]);
  }
}
int X;
int A;
int B;
int main(){
  rd(X);
  rd(A);
  rd(B);
  if(B<=A){
    wt_L("delicious");
    wt_L('\n');
  }
  else if(B<=A+X){
    wt_L("safe");
    wt_L('\n');
  }
  else{
    wt_L("dangerous");
    wt_L('\n');
  }
  return 0;
}
// cLay varsion 20190721-1

// --- original code ---
// int X, A, B;
// {
//   rd(X,A,B);
//   wt( if[B<=A, "delicious", B<=A+X, "safe", "dangerous"] );
// }


Measured memory_bytes: 256
def examD():
    M = I()
    cur = 0; ans = 0
    for i in range(M):
        c, d = LI()
        cur += d*c
        ans += d
    ans += (cur-1)//9 -1
    print(ans)

def examE():
    return

import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examD()


Measured memory_bytes: 41452
#include <stdio.h>
#include <math.h>
int gcd(long int a,long int b);
int main(){
    while(1){
        long int a,b,yaku,bai;
        if(scanf("%ld %ld",&a,&b)==EOF)break;
        yaku=gcd(a,b);
        bai=a/yaku*b;
        printf("%ld %ld\n",yaku,bai);
    }
    return 0;
}

int gcd(long int a,long int b){
    while(b!=0){
        long int r = a%b;
        a=b;
        b=r;
    }
    return a;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)

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

  bool f=1;
  string s;
  cin >> s;
  rep(i, s.size()) {
    if(i%2 == 0) {
      if(s[i]=='L') f=0;
    }
    else {
      if(s[i]=='R') f=0;
    }
  }
  if(f==1) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>

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

using namespace std;

int main(){
	int n;
	char str[5001];
	scanf("%d%s",&n,str);

	int ans=0;
	char *s=str;
	while(1){
		// Z algorithm
		int z[5000]; // z[i] := |longest common prefix of s and s[i...]|
		z[0]=n;
		int i=1,j=0;
		while(i<n){
			while(i+j<n && s[j]==s[i+j]) j++;
			z[i]=j;
			if(j==0) { i++; continue; }
			int k=1;
			while(i+k<n && k+z[k]<j) z[i+k]=z[k], k++;
			i+=k;
			j-=k;
		}

		for(i=0;i<n;i++){
			ans=max(ans,min(z[i],i));
		}

		n--;
		s++;
		if(n==0) break;
	}

	printf("%d\n",ans);

	return 0;
}


Measured memory_bytes: 128
class Point:
    def __init__(self, t, a):
        self.t = t
        self.a = a


N = int(input())
points = []
for _ in range(N):
    t, a = map(int, input().split())
    points.append(Point(t, a))

T = 1
A = 1

for p in points:
    # n = int(max((math.ceil(T/p.t)), (math.ceil(A/p.a))))
    n = max((-1*T//p.t)*-1, (-1*A//p.a)*-1)
    T = n*p.t
    A = n*p.a
print(T+A)


Measured memory_bytes: 3188
/* ☻ ☻ ☻ ☻ ☻ ☻ ☻ ☻ ☻ ☻ ☻ ☻ ☻ */
/* ☻ Name : Souvik Mahato  ☻ */
/* ☻ Nick : WIZARDO        ☻ */
/* ☻ Institution : IIEST   ☻ */
/* ☻ ☻ ☻ ☻ ☻ ☻ ☻ ☻ ☻ ☻ ☻ ☻ ☻ */

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

#define ll long long int
#define in(v) (v).begin(),(v).end()
#define rin(v) (v).rbegin(),(v).rend()
#define inf 1e9+7



int solvius()
{
    int n;
    cin>>n;
    vector<int> dp(3);
    for(int i=0;i<n;i++)
    {
        vector<int> a(3),new_dp(3,0);
        cin>>a[0]>>a[1]>>a[2];
        for(int j=0;j<3;j++)
        {
            for(int k=0;k<3;k++)
                if(j!=k)
                    new_dp[k] = max(new_dp[k],dp[j]+a[k]) ;
        }
        dp = new_dp;
    }
    cout<<*max_element(in(dp));
    return 0;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);    
	ll t=1;
   // cin>>t;
	while(t--)
		solvius();
    return 0;
}

Measured memory_bytes: 3652
S = input()

from collections import deque

answer = 0
queue = deque()
target = {'A','C','G','T'}
for s in S:
    if s in target:
        queue.append(s)
    else:
        answer = max(answer, len(queue))
        queue.clear()
answer = max(answer, len(queue))
print(answer)


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

using namespace std;

#define LIMIT 100
typedef pair<int64_t, int64_t> ii;
typedef int64_t ll;
int gcd(ll a, ll b) { return (b==0)?a:gcd(b, a%b); }
int lcm(ll a, ll b) { ll i=(a/gcd(a,b))*b; assert(i>0); return i; }

//  ***** MAIN *****
int main(){
  //ios::sync_with_stdio(false);
  cin.tie(NULL);
  int a, b, c, x;

  cin >> a >> b >> c >> x;

  int o = 0;

  for (int i = 0; i <= a; ++i) {
    for (int j = 0; j <= b; ++j) {
      for (int k = 0; k <= c; ++k) {
        if(500*i + 100*j + 50*k == x) o++;
      }
    }
  }

  std::cout << o << std::endl;

  return 0;
}



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

int main() {
    string S, T;
    bool a;
    a = false;
    cin >> S >> T;
    for (int i = 0; i < S.size(); i++){
        if(S.at(i) != T.at(i))a = true;
    }
    if(a) cout << "No" << endl;
    else  cout << "Yes" << endl;
}


Measured memory_bytes: 3628
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string> //文字列
#include <iomanip> //doubleの桁数指定 setprecision()
#include <list> //前後に数値を入れれる配列
#include <map> //map
#include <vector> //vecror



#define REP(i,m,n) for(ll i = (ll) (m);i < (ll) (n);i++) //forの短縮
#define rep(i,n) REP(i,0,n) //REPが0の時
#define ll long long int

using namespace std;

double PI = acos(-1); //円周率]
ll mod = 1e9 + 7;

//常設関数↓

//最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

//最小公倍数
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}

//degree → radian
long double chg_DegRad(long double deg) {
	return deg * PI / 180.0;
}

//radian → degree
long double chg_RadDeg(long double rad) {
	return rad * 180.0 / PI;
}
 
//桁数
ll CountDigit(ll n) {
	ll digit = 1;
	while ((n /= 10) != 0) digit++;
	return digit;
}

//距離
double dis(double xa, double ya, double xb, double yb) {
	return pow(pow(xa - xb, 2.0) + pow(ya - yb, 2.0), 0.5);
}


//abs()平均
//pow(,)累乗


//提出コード↓

ll k, n;
ll d[10];


int main() {
	cin >> n >> k;
	rep(i, k) cin >> d[i];

	while (true) {
		bool f = false;
		vector<int> vec;
		int tmp = n;
		
		while (tmp) {
			vec.push_back(tmp % 10);
			tmp /= 10;
		}

		rep(i, vec.size()) {
			rep(j, k) {
				if (vec[i] == d[j]) {
					f = true;
					break;
				}
			}
		}
		if (f) n++;
		else {
			cout << n << endl;
			break;
		}

	}
	





	return 0;
}



Measured memory_bytes: 256
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def f(a, b):
    return pow(a, 5) - pow(b, 5)
 
def main():
    x = int(readline())    
    for i  in range(-1000, 1001):
        for j in range(-1000, 1001):
            if i**5 - j**5 == x:
                print(i, j)
                return
if __name__ == '__main__':
    main()


Measured memory_bytes: 9188
#include <vector>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <iomanip>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP1(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define RANGE(i,min,max) for(int i=(min), i##_len=((max)+1); i<i##_len; ++i)
constexpr int m_max=1e5;
vector<pair<int,int>> wl(m_max);
int N,M;
constexpr int INF = 1e6; 
int main(){
    cin >> N >> M;
    wl.resize(M);

   for(auto& w: wl) cin >> w.first >> w.second;
   int res = 0, right = INF;
   sort(wl.rbegin(), wl.rend());
   REP(i,M) if(wl.at(i).second <= right) res++, right=wl.at(i).first;
   cout << res << endl;
}

Measured memory_bytes: 1152
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main
{
    public static void main(String[] args) throws IOException
    {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String s, s1;
		while((s=br.readLine())!=null)
		{
			int[] a = new int[4], b = new int[4];
			int hit=0, blow=0;
			for(int i=0; i<4; i++) a[i] = Integer.parseInt(s.split(" ")[i]);
			s1=br.readLine();
			for(int i=0; i<4; i++) b[i] = Integer.parseInt(s1.split(" ")[i]);
			
			for(int i=0; i<4; i++){
				for(int j=0; j<4; j++){
					if(a[i] == b[j] && i==j) hit++;
					else if(a[i] == b[j])   blow++;
				}
			}
			System.out.println(hit + " " + blow);
		}
    }
}

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

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define ll long long
const ll mod = 1e9+7;
int inf = 1000000000; //10e9

int main() {

    string s;
    cin >> s;

    int slength = s.size();

    if(s[slength-1] == 's'
    ){
        cout << s << "es" << endl;
    }else{
        cout << s << "s" << endl;
    }

    return 0;

}

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

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main(){
    gearup;
    ll n;cin>>n;
    vl a(n),b(n);
    rep(i,n)cin>>a[i];
    rep(i,n)cin>>b[i];
    ll a_sum = accumulate(all(a),0LL);
    ll b_sum = accumulate(all(b),0LL);
    if(a_sum < b_sum){
        out(-1);
        return 0;
    }
    ll res = 0;
    ll dif = 0;
    vl p;
    rep(i,n){
        if(a[i]<b[i])res++,dif+=b[i]-a[i];
        else p.emplace_back(a[i]-b[i]);
    }
    if(dif == 0){
        out(res);
        return 0;
    }
    sort(rall(p));
    rep(i,p.size()){
        dif -= p[i];
        res++;
        if(dif <= 0){
            out(res);
            return 0;
        }
    }
}

Measured memory_bytes: 2936
#include <stdio.h>
#define MAX 100
#define INFTY (1<<21)
#define BLACK 2
#define GRAY 1
int n;
int a[MAX][MAX];

int omomi(void);

int main(){
  int i,j,e;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      scanf("%d",&e);
      if(e == -1)a[i][j] = INFTY;
      else a[i][j] = e;
    }
  }

  printf("%d\n",omomi());
  return 0;
}

int omomi(){
  int u,minv,i,sum=0,v;
  int d[MAX],p[MAX],color[MAX];

  for(i=0;i<n;i++){
    d[i] = INFTY;
    p[i] = -1;
    color[i] = 0;
  }

  d[0] = 0;

  while(1){
    minv = INFTY;
    u = -1;
    for(i = 0;i<n;i++){
      if(minv > d[i] && color[i] != BLACK){
        u = i;
        minv = d[i];
      }
    }
    if(u == -1)break;
    color[u] = BLACK;
    for(v = 0;v<n;v++){
      if(color[v] != BLACK && a[u][v] != INFTY){
        if(d[v] > a[u][v]){
          d[v] = a[u][v];
          p[v] = u;
          color[v] = GRAY;
        }
      }
    }
  }
  for(i = 0;i<n;i++){
    if(p[i] != -1)sum += a[i][p[i]];
  }

  return sum;
}


Measured memory_bytes: 2112