akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>

#include <stdio.h>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, k, n) for (int i = (k); i < (n); i++)
#define rrep(i, k, n) for (int i = (k); i >= (n); i++)
#define pb push_back
#define vec vector
#define ref(a) &(a)

const int mod = 1e9 + 7;

typedef long long ll;

using namespace std;

int n;

int solve() {
  int i = 0;
  while (pow(2, i + 1) <= n) i++;
  return pow(2, i);
}

int main() {
  cin >> n;
  cout << solve() << endl;
  return 0;
}

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

typedef long long ll;
typedef vector<int> vi;


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    
    //freopen("E:\\Codes\\Problem\\C++\\AAA.txt", "r", stdin);
    //freopen("C:\\Users\\Dell\\Desktop\\Problem\\BBB.txt", "w", stdout);
	
	int n;
	cin>>n;
	
	int ans=(n*(n+1))/2;
	
	cout<<ans;
	

}



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

#define MAX_D 10

int perm[MAX_D];
int res = 1000000;
int G;
int D;
vector<int> c(MAX_D);
vector<int> p(MAX_D);

void permutation(int n) {
	for (int i = 0; i < n; i++) {
		perm[i] = i;
	}
	do {
		int now = 0, nowG = G;
		for (int i = 0; i < n; i++) {
			if ((nowG+(perm[i]*100+100)-1)/(perm[i]*100+100) < p[perm[i]]) {
				now += (nowG+(perm[i]*100+100)-1)/(perm[i]*100+100);
				break;
			} else {
				now += p[perm[i]];
				nowG -= (perm[i]*100+100)*p[perm[i]]+c[perm[i]];
				if (nowG <= 0) break;
			}
		}
		res = min(res, now);
	} while (next_permutation(perm, perm + n));
	return ;
}

int main(){	
	scanf("%d",&D);
	scanf("%d",&G);
	for(int i = 0 ; i <= D-1 ; i++){
		scanf("%d",&p[i]);
		scanf("%d",&c[i]);
	}
	permutation(D);
	cout << res << endl;
	
	return 0;
}



Measured memory_bytes: 256
N=int(input())
*L,=map(int,input().split())
i=0
ans=0
while i<N:
    j=i+1
    while j<N:
        k=j+1
        while k<N:
            a,b,c=sorted([L[i],L[j],L[k]])
            if c<a+b and len(set([a,b,c]))==3:
                ans+=1
            k+=1
        j+=1
    i+=1
print(ans)

Measured memory_bytes: 9204
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n, m, i, a, sum=0;
    cin >> n >> m;
    for(i=0;i<m;i++)
        {
            cin >> a;
            sum += a;
        }
    //cout << sum << endl;
    if(sum>n)
        cout << -1 << endl;
    else
        cout << n - sum << endl;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x, n;
  cin >> x, cin >> n;
  int p[n];
  for (int i = 0; i < n; i++) {
    cin >> p[i]; 
  }
  int a = 0;
  for (int j = 0; j < 100; j++) {
  int cnt = 0;
    for (int i = 0; i < n; i++) {
      if(p[i] == x + a) {
        a++;
        cnt = 1; 
      }
    }
  if (cnt == 0) break;
  }

  
  int b = 0;
  for (int j = 0; j < 100; j++) {
  int cnt = 0;
    for (int i = 0; i < n; i++) {
      if(p[i] == x - b) {
        b++;
        cnt = 1; 
      }
    }
    if (cnt == 0) break;
    }
  if (a < b) {
    cout << x + a << endl;  
  } else {
    cout << x - b << endl;  
  }
  return 0;
}  

Measured memory_bytes: 3588
import java.io.File;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Deque;
import java.util.Scanner;

public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		String T = sc.next();
		S += S;
		
		System.out.println(S.contains(T)?"Yes":"No");
	}
}

Measured memory_bytes: 21844
#include <iostream>
#include <cstdio>
#include <vector>
#include <set>

using namespace std;

set<int> s;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n; cin>>n;
	if(n == 3) return puts("2 3 25"), 0;
	if(n == 4) return puts("2 3 25 30"), 0;
	if(n == 5) return puts("2 3 25 30 60"), 0;
	long long sum = 0; int k;
	for(int i = 1; i <= n; ++i) {
		if(i % 4 == 1) k = 6 * (i / 4) + 2, s.insert(k), sum += k;
		else if(i % 4 == 2) k = 6 * (i / 4) + 3, s.insert(k), sum += k;
		else if(i % 4 == 3) k = 6 * (i / 4) + 4, s.insert(k), sum += k;
		else k = 6 * (i / 4), s.insert(k), sum += k;
	}
	/*for(set<int>::iterator sit = s.begin(); sit != s.end(); ++sit)
		cout<<*sit<<" ";*/
	//cout<<endl<<sum<<" "<<sum % 6<<endl;
	if(sum % 6 == 2) {
		s.erase(8);
		s.insert(6 * (n / 4 + 1));
	} else if(sum % 6 == 3) {
		s.erase(9);
		s.insert(6 * (n / 4 + 1));
	} else if(sum % 6 == 5){
		s.erase(9);
		s.insert(6 * (n / 4) + 4);
	}
	for(set<int>::iterator sit = s.begin(); sit != s.end(); ++sit)
		cout<<*sit<<" ";
//	puts("");
	return 0;
}

Measured memory_bytes: 1280
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>

typedef long long ll;

using namespace std;

int main(int argc , char *argv[]) {
    int n,l;
    cin >> n >> l;
    int res=0;
    if(l>0) {
        for(int i = 2 ; i <= n ; i++) {
            res += (l+i)-1;
        }
    }
    else {
        if(n<=abs(l)) {
            for(int i = 1 ; i < n ; i++) {
                res += (l+i)-1;
            }
        }
        else {
            for(int i = 1 ; i <= n ; i++) {
                res += (l+i)-1;
            }
        }
       
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
h, w = map(int, input().split())

dp = [[0]*w for _ in range(h)]

for i in range(h):
  s = input()
  for j in range(w):
    if s[j] == '#':
      dp[i][j] = '#'
      for p in range(i-1, i+2):
        if p < 0 or h-1 < p:
          continue
        for q in range(j-1, j+2):
          if q < 0 or w-1 < q:
            continue
          elif dp[p][q] == '#':
            continue
          dp[p][q] += 1
      
for k in dp:
  print(*k, sep='')

Measured memory_bytes: 9084
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
  int n;
  cin>>n;
  int sum=0;
  int p=1;
  int m=n;
  while(m>0){
    sum += m%10;
    m /=10;
  }
  
  if(n%sum==0){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;

namespace ALDS1_3
{
    class Program
    {
        public struct Process
        {
            public readonly string n;
            public readonly int t;
            public Process(string n, int t)
            {
                this.n = n;
                this.t = t;
            }
        }

        static void Main()
        {
            var a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            var b = new List<Process>();
              
            for (var i = 0; i < a[0]; i++)
            {
                var c = Console.ReadLine().Split();
                var d = c[0]; var e = int.Parse(c[1]);
                b.Add(new Process(d, e));
            }

            var f = 0;

            while (b.Count > 0)
            {
               var g = b[0];
               b.RemoveAt(0);
               var k = g.n;
               var v = g.t;
               f += v < a[1] ? v : a[1];
               v -= a[1];
               if (v <= 0)
                   Console.WriteLine("{0} {1}", k, f);
               else
                   b.Add(new Process(k, v));
            }
        }
    }
}

Measured memory_bytes: 14820
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
#define rep2(i,a,n) for(int i=a;i<n;i++)
#define been(ix) (ix).begin(),(ix).end()
using namespace std;
typedef long long ll; 
typedef vector<int> vi;
typedef vector<long long> vl;
const ll INFL = 1e18;
const int INF = 1001001001; 
typedef pair<int,int> P;
#define foreach(ix,i) for(auto& (ix) : (i))
typedef long double ld;
const int mod =1000000007;
const double PI = acos(-1);
int main(){
   string s;cin>>s;
   int n =s.length();
   sort(been(s));
   int g =(n+1)/2;
   int ans=0;
   rep(i,g){
       if(s[i]=='p')ans--;
   } 
   rep2(i,g,n){
       if(s[i]=='g')ans++;
   }
   cout<<ans<<endl;
}

Measured memory_bytes: 3736
import sys
input = sys.stdin.readline
n=int(input())
l=[list(map(int,input().split())) for _ in [0]*n]
dp=[[-float("inf") for _ in [0]*3] for _ in [0]*n]
for i in range(3):
    dp[0][i]=l[0][i]
for i in range(1,n):
    for j in range(3):
        dp[i][j]=max(dp[i-1][(j+1)%3]+l[i][j],dp[i-1][(j+2)%3]+l[i][j])
print(max(dp[n-1][i] for i in range(3)))

Measured memory_bytes: 83036
#include<cstdio>
#include<cstring>

int main(void){
int i,j;

char w[11];
scanf("%s",w);
char e[]="END_OF_TEXT";
char s[1024][1024];
int n=-1;
do{
	n++;
	scanf("%s",s[n]);
}while(strcmp(s[n],e)!=0);
i=0;
while(w[i]!='\0'){
	if((w[i]>='A')&&(w[i]<='A'+25)){
		w[i]=w[i]+'a'-'A';
	};
	i++;
};

for(i=0;i<n+1;i++){
	j=0;
	while(s[i][j]!='\0'){
		if((s[i][j]>='A')&&(s[i][j]<='A'+25)){
			s[i][j]=s[i][j]+'a'-'A';
		};
		j++;
	};
};

int c=0;
for(i=0;i<n+1;i++){
	if(strcmp(s[i],w)==0){
		c++;
	};
};
printf("%d\n",c);

return 0;
}

Measured memory_bytes: 2744
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n;
		while ((n = in.nextInt()) != 0) {
			String str = in.next();
			StringBuilder sb = new StringBuilder();
			for (int j = 0; j < n; j++) {
				sb.setLength(0);
				int counter = 0;
				char c = str.charAt(0);
				for (int i = 0; i < str.length(); i++) {
					if (str.charAt(i) != c) {
						sb.append(counter);
						sb.append(c);
						counter = 0;
						c = str.charAt(i);
					}
					counter++;
				}
				sb.append(counter);
				sb.append(c);
				str = sb.toString().trim();
			}
			System.out.println(str);
		}
	}
}

Measured memory_bytes: 26484
import sys
sys.setrecursionlimit(10 ** 7)

H, N = map(int, input().split())

A, B = [], []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

dp = [[10**12] * (H+1) for _ in range(N+1)]

# dp[i][0]はコスト0
for i in range(N+1):
    dp[i][0] = 0

# i個の魔法
for i in range(N):
    # hの体力
    for h in range(H+1):
        # 最後に倒すとき
        if h == H:
            # 攻撃力がHを超える時
            if A[i] > H:
                dp[i+1][h] = min(dp[i][h], B[i])
            # 超えてない時
            else:
                m = min(dp[i+1][h-A[i]:h])
                dp[i+1][h] = min(dp[i][h], m + B[i])
        # 魔法の攻撃力が足らない
        elif h < A[i]:
            dp[i+1][h] = dp[i][h]
        # 通常時
        else:
            dp[i+1][h] = min(dp[i][h], dp[i+1][h-A[i]] + B[i])


print(dp[N][H])


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

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, k;
    cin >> n >> k;
    vector<int> arr(n);
    for(int i = 0; i < n; ++i) {
        cin >> arr[i];
    }
    vector<int> memo(n);
    memo[0] = 0;
    for(int i = 1; i < n; ++i) {
        memo[i] = abs(arr[i]-arr[i-1]) + memo[i-1];
        for(int j = max(0LL, i-k); j < i; ++j) {
            memo[i] = min(memo[i], abs(arr[i]-arr[j]) + memo[j]);
        }
    }
    cout << memo[n-1] << '\n';
    return 0;
}


























Measured memory_bytes: 1792
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    int x = sc.nextInt();
    int y = sc.nextInt();
    
    if(n <= k){
    System.out.println(n * x);
    }else if(n > k){
    System.out.println(k * x + (n - k)*y);
    }
 }
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
#define int ll
typedef long long ll ;
const int MAX=3e5+10;
const int INF=0x3f3f3f3f;
const int mod=1e9+7;

void solve(){
    int n,x,t;
    cin>>n>>x>>t;
    int total=0;
    int time=0;
    while(1){
        if(total>=n){
            break;
        }
        total+=x;
        time+=t;
    }
    cout<<time;
}

signed main() {
    //ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
    int _=1;
    //cin>>_;
    while(_--){
        solve();
    }
    return 0;
}

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

vector<vector<int>> G(4);
vector<bool> visited(4);

void dfs(int cur,int pre){
    if(G[cur].size() == 0) return;
    visited[cur] = true;
    for(auto a : G[cur]){
        if(a == pre) continue;
        if(visited[a]) continue;
        else {
            dfs(a,cur);
            break;
        }
    }
}

int main(){
    for(int i=0; i<3; i++){
        int a,b;
        cin>>a>>b;
        a--,b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    fill(visited.begin(),visited.end(),false);

    dfs(0,-1);

    bool flag = true;

    for(int i=0; i<4; i++){
        if(!visited[i]) flag = false;
    }

    cout<<(flag ? "YES" : "NO")<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef pair<string,int> P;
const ll MOD=1e9+7;
int a[200001];
int b[200001];
int main()
{
	int n;
	int cnt=0;
	int ans=0;
	cin>>n;
	// double test=0;
	// for(double i=200000;i>0;i--)
	// 	test+=1.0/i;
	// test*=200000.0;
	// cerr<<test<<endl;
	for(int i=1;i<n+1;i++)
		cin>>a[i];
	for(int i=n/2+1;i<n+1;i++)
	{
		ans+=a[i];
		b[i]=a[i];
	}
	for(int i=n/2;i>0;i--)
	{
		cnt=0;
		for(int j=i+i;j<n+1;j+=i)
			cnt+=b[j];
		if((cnt&1)!=a[i])
			b[i]=1;
		else
			b[i]=0;
		ans+=b[i];
	}
	cout<<ans<<endl;
	for(int i=1;i<n+1;i++)
		if(b[i]==1)
			cout<<i<<" ";
	cout<<endl;
	return 0;
}

Measured memory_bytes: 2432
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
int main()
{
  vector<int> x(3);
  cin >> x[0] >> x[1] >> x[2];
  sort(ALL(x));
  
  cout << x[2]*10+x[1]+x[0] << endl;
  return 0;
}

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

using namespace std;
#define ll long long int
#define pb push_back
#define rep(i, a, v) for(int i = a; i <= v; ++i)
#define vi vector<int>
#define vll vector<ll>
#define maxi 1000000007

ll i, j, k;
ll temp;

ll Power(ll a, ll N, ll mod){
    if(N == 0)
        return 1;
    else if(N == 1)
        return a % mod;
    else if(N % 2 == 1){
        a = a % mod;
        temp = Power((a * a) % mod, (N / 2), mod);
        temp = (temp * a) % mod;
        return temp;  
    }
    else if(N % 2 == 0){
        a = a % mod;
        return Power((a * a) % mod, (N / 2), mod);
    }
}

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int n;
    ll a, ans = 0, temp;
    const int max_size = 64;
    array<ll, max_size> counts;
    counts.fill(0);
    cin >> n;
    for(int i = 0; i < n; ++i){
        cin >> a;
        for(int j = 0; a > 0; ++j){
            counts[j] += (a % 2);
            a /= 2;
        }            
    }
    for(int i = 0; i < max_size; ++i){
        temp = (counts[i] * (n - counts[i])) % maxi;
        temp = (temp * Power(2, i, maxi)) % maxi;
        ans += temp;
        ans %= maxi;
    }
    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 256
/* 
	今日も一日がんばるぞい
*/
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<endl

int main(){
    cin.tie(nullptr);
    int n;
    cin >> n;
    int a[n];//ソートするやつ
    vector<int> v;
    REP(i,n){
        scanf("%d",&a[i]);
        v.push_back(a[i]);
    }
    sort(v.begin(),v.end());
    int num1 = v[(n-1)/2];
    int num2 = v[n/2];
    REP(i,n){
        if(a[i]<=num1)COUT(num2);
        else if(num2<=a[i])COUT(num1);
    }
    return 0;
}


Measured memory_bytes: 3828
import java.io.*;
import java.util.StringTokenizer;
 
class Main {
	public static void main (String args[]) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		String buf;

		try {
			while ((buf = br.readLine())!=null) {
				StringTokenizer st = new StringTokenizer(buf);
				double x[] = new double[4];
				double y[] = new double[4];
				for (int i=0;i<4;i++) {
					x[i] = Double.parseDouble(st.nextToken());
					y[i] = Double.parseDouble(st.nextToken());
				}
				double S1 = (x[1]-x[0])*(y[3]-y[0])-(x[3]-x[0])*(y[1]-y[0]);
				double S2 = (x[2]-x[0])*(y[3]-y[0])-(x[3]-x[0])*(y[2]-y[0]);
				if (check(S1,S2)) {
					S1 = (x[2]-x[1])*(y[3]-y[1])-(x[3]-x[1])*(y[2]-y[1]);
					S2 = (x[0]-x[1])*(y[3]-y[1])-(x[3]-x[1])*(y[0]-y[1]);
					if (check(S1,S2)) System.out.println("YES");
					else System.out.println("NO");
				}
				else System.out.println("NO");
			}
		} catch (Exception e) {
			System.out.println("Exception!");
		}
	}

	public static boolean check(double a,double b) {
		if (a>0&&b<0) return true;
		else if (a<0&&b>0) return true;
		return false;
	}
}

Measured memory_bytes: 16964
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
#define PRINT(v) for (auto x : (V)) cout <<x <<" " <<endl;
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll MOD = 1000000007;
const ll INF = 10000000000000000;
vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> y4 = {1, 0, -1, 0}, y8 = {1, 1, 0, -1, -1, -1, 0, 1};
template<class T> struct edge { int from, to; T cost;};
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> inline T powerM(T a,T b){if (b==0) return 1;
T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }
template<class T> inline T power(T a,T b,T m){ if (b==0) return 1;
  T tmp = power(a,b/2,m); if (b%2==0) return tmp*tmp%m; else return tmp*tmp%m*a%m; }
template<class T> inline T gcd(T a, T b){if (b==0) return a; return gcd(b, a%b);}
template<class T> inline T lcm(T a, T b){return a / gcd(a,b) * b;}
// ax+by=gcd(a,b)を解く
template<class T> inline T extgcd(T a,T b,T &x,T &y){if (b==0){x=1; y=0; return a;} T d=extgcd(b,a%b,y,x); y -= a/b*x; return d;}
void hey(){ cout <<"hey" <<endl; }


int main() {
  int n,x; cin >>n >>x;
  int res = 0;
  vector<int> A(n); rep(i, n) cin >>A[i];
  sort(all(A));
  rep(i, n){
    if (A[i] > x) break;
    x -= A[i];
    res++;
    if (i == n-1) if (x > 0) res--;
  }
  cout <<res <<endl;
}


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

#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define ll long long
#define ii pair<ll,ll>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>

using namespace std;

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n,d,a,ans=0;
	cin>>n>>d>>a;
	vii monster(n);
	vll c(n+1);
	for(int i=0;i<n;++i){
		cin>>monster[i].ff >> monster[i].ss;
	}
	sort(all(monster));
	for(int i=0,j=0;i<n;++i){
		while(j<n&&monster[j].ff<=monster[i].ff+2*d)
			++j;
		ll need = max((monster[i].ss-c[i]*a+a-1)/a,0LL);
		c[i]+=need;
		c[j]-=need;
		ans+=need;
		c[i+1]+=c[i];
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 4992
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
typedef  long long ll;
ll gcd(ll x,ll y){
   if(y==0) return x;
   else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
   return x/gcd(x,y)*y;
}
using namespace std;
int main(){
   string s;
   cin>>s;
   bool f;
   (s[0]==s[1] && s[1]==s[2])? cout<<"No":cout<<"Yes";
   
return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
    public static void main(String[]args){
	new Main().run();
    }
    Scanner sc = new Scanner(System.in);
    long n;
    int count;
    long lg = 2000000000;

    void run(){
	while(sc.hasNext()){
	    n = sc.nextLong();
	    if(n!=0) solve();
	}
    }

    void solve(){
	count = 0;
	long fac = 1;
	while(n>0){
	    long a = n;
	    while(a%10 == 0){
		a = a/10;
		count++;
		//System.out.println(a+"**"+count);
	    }
	    fac = fac*(a%lg);
	    while(fac%10==0){
		fac = fac/10;
		count++;
	    }
	    fac = fac%lg;
	    //System.out.println(fac+" "+count);
	    n--;
	}
	
	System.out.println(count);
    }
}

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

using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for (ll i = (ll)(n) - 1; i >= 0; i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1LL << 62)

#define PI (acos(-1))
#define print(x) cout << x << endl
 
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll countDigit(ll n) { return floor(log10(n) + 1); } 
typedef pair <ll,ll> P;
static const ll dy[4] = {0,1,0,-1}, dx[4] = {1,0,-1,0};

template <typename T> 
ostream& operator<<(ostream& os, const vector<T>& v) 
{ 
    for (int i = 0; i < (int)v.size(); ++i) { 
        os << v[i]; 
        if (i != (int)v.size() - 1) 
            os << " "; 
    } 
    return os; 
} 

ll nCrModp(ll n, ll r, ll p)
{
    ll C[r+1];
    memset(C, 0, sizeof(C));

    C[0] = 1;

    for (ll i = 1; i <= n; i++)
    {
        for (ll j = min(i, r); j > 0; j--)
            C[j] = (C[j] + C[j-1])%p;
    }
    return C[r];
}

bool IsPrime(ll num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (ll i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}

int main()
{
    ll X;
    cin >> X;
    while(!IsPrime(X)) {
        X++;
    }
    print(X);
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int a;
  cin>>a;
  if(a==4||a==7||a==8||a==11||a==12||a==14||a==15||a==16||a>17){
     cout<<"Yes"<<endl;
  }
  else{
     cout<<"No"<<endl;
  }
  return 0;
}

Measured memory_bytes: 256
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using P = pair<int32_t, int32_t>;

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  for (int32_t i = 1; i < 100000; ++i) {
    int32_t x;
    cin >> x;
    if (x == 0) {
      break;
    } else {
      std::cout << "Case " << i << ": " << x << std::endl;
    }
  }
  return 0;
}



Measured memory_bytes: 3104
#include<bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i = 0; i < N; i++)
#define all(x) x.begin(), x.end()
#define sort(x) sort(all(x))
#define cou(x) cout << x << endl
using vi = vector<int>;
using lint = long long;
int main() {
	string N;
	cin >> N;
	if (N == "hi" || N == "hihi" || N == "hihihi" || N == "hihihihi" || N == "hihihihihi") {
		cou("Yes");
	}
	else {
		cou("No");
	}
}

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

int main()
{
    int n, k;
    cin>>k;
    n = k%10;

    if(n==2 || n==4 || n==5 || n==7 || n==9)
    {
        cout << "hon";
    }
    else if(n==3)  {
        cout<< "bon";
    }
    else
        cout << "pon";

}


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

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

int main() {

    int N,D;
    cin >> N >> D;
    vector<vector<int>> X(N,vector<int>(D));
    rep(i,N){
        rep(j,D){
            cin >> X[i][j];
        }
    }

    int ans = 0;
    for(int i=0; i<N; i++){
        for(int j=i+1; j<N; j++){
            int s = 0;
            rep(k,D){
                s += pow(X[i][k] - X[j][k],2);
            }
            int k = 0;
            while(k <= s){
                if(k*k == s){
                    ans++;
                    break;
                }
                k++;
            }
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 

using namespace std;
using namespace __gnu_pbds; 
#define     mod            (int)1e9+7
#define     MOD             998244353
#define     ll              long long
#define     mp              make_pair
#define     F               first
#define     S               second
#define     t()             int test;cin>>test;while(test--)
#define     ii              pair<int,int>
#define     que_max         priority_queue <int>
#define     IOS             ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define     endl            "\n"
typedef tree< int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif






 
int main()
 
{  
    #ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    #endif

    IOS;

    int n, k;
    cin>>n>>k;
    std::vector<int> v(n);
    for(auto &i: v)cin>>i;

    int sum = 0;
    sort(v.begin(), v.end()) ;

    for(int i=0; i<k; i++)sum+=v[i];

    cout<<sum<<endl;   
  
   
}

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

const int INF = 100;
int main(){
	ll n;
	cin >> n;
	string u = to_string(n);
	int ans = int(u.size());
	for (ll i = 1; i*i <= n; ++i) {
		if(n % i == 0){
			ll a = i;
			ll b = n/i;
			string s = to_string(a);
			string t = to_string(b);
			if(s.size() < t.size()){
				ans = min(ans, int(t.size()));
			}else{
				ans = min(ans, int(s.size()));
			}
		}
	}
	cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 510000;
ll dy[8] = {0,1,0,-1,1,-1,1,-1};
ll dx[8] = {1,0,-1,0,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-7;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << endl;}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << a << " " << b << " " << c << endl;
}
const int mod = 1e9 + 7;
//const int mod = 998244353;

int main(){
	ll n; cin >> n;
	vector<tuple<ll,ll,ll,ll>> a(n);
	rep(i,n){
		ll w,s,v; cin >> w >> s >> v;
		ll u = w+s;
		a[i] = tie(u,w,s,v);
	}
	sort(rall(a));
	vvl dp(n+1,vl(20001,0));
	rep(i,n){
		ll w,s,v;
		tie(ignore,w,s,v) = a[i];
		rep(j,20001){
			chmax(dp[i+1][j],dp[i][j]);
			if(j-w>=0){
				chmax(dp[i+1][min(j-w,s)],dp[i][j]+v);
			}
		}
	}
	ll ans = 0;
	rep(j,10001) chmax(ans,dp[n][j]);
	cout << ans << endl;
}

Measured memory_bytes: 160640
main = getLine >>= putStrLn.solve.map read.words
solve [n,a,b,c,d]
  | any eval [0..n - 1] = "YES"
  | otherwise = "NO"
  where
    eval m = lo <= b && b <= hi where
      lo = a - m*d + k*c
      hi = a - m*c + k*d
      k = n - m - 1


Measured memory_bytes: 1020
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<int> ret;
  if (n == 3) {
    ret = {2, 5, 63};
  } else if (n == 4) {
    ret = {2, 5, 20, 63};
  } else {
    ret = {2, 3, 4, 6, 9};
    n -= 5;
    int a = 4;
    int b = 9;
    int c = 6;
    const int mxv = 30000;
    while (n > 0) {
      if (a + 6 <= mxv) {
        a += 4;
        ret.insert(a);
        a += 2;
        ret.insert(a);
        n -= 2;
      } else if (b + 12 <= mxv) {
        b += 6;
        ret.insert(b);
        b += 6;
        ret.insert(b);
        n -= 2;
      } else {
        c += 6;
        ret.insert(c);
        n -= 1;
      }
    }
    if (n < 0) {
      ret.erase(6);
      n += 1;
    }
  }
  for (auto it = ret.begin(); it != ret.end(); it++) {
    cout << *it << (next(it) != ret.end() ? ' ' : '\n');
  }
  cout << flush;
  return 0;
}

Measured memory_bytes: 1280
var
  n,i,j,m,ans:longint;
  s:string;
  ch:char;
  b1,b2,b3:boolean;
begin
  readln(n);
  if n=23 then writeln('Christmas Eve Eve');
  if n=22 then writeln('Christmas Eve Eve Eve');
  if n=24 then writeln('Christmas Eve');
  if n=25 then writeln('Christmas');
end.

Measured memory_bytes: 128
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<vector>
#include<functional>
#include <random>
#include<iostream>
#include<iomanip>
using namespace std;

int main() {
	int N, A[1000];

	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}

	int approved = 1;
	for (int i = 0; i < N; i++) {
		if (A[i] % 2 == 0) {
			if (A[i] % 3 != 0 && A[i] % 5 != 0) {
				approved = 0; break;
			}
		}
	}
	if (approved == 1) {
		cout << "APPROVED";
	}
	else {
		cout << "DENIED";
	}
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) throws Exception {
		ArrayList<String> lines = new ArrayList<String>();
		while (true) {
			String line = sc.nextLine();
			if (line.equals("END_OF_TEXT")) break;
			lines.add(line);
		}
		String buffer = "";
		int r = 0;
		int c = 0;
		while (true) {
			char q = sc.next().charAt(0);
			if (q == '-') break;
			switch (q) {
			case 'a':
				c = 0;
				break;
			case 'e':
				c = lines.get(r).length();
				break;
			case 'p':
				c = 0;
				if (r > 0) --r;
				break;
			case 'n':
				c = 0;
				if (r < lines.size() - 1) ++r;
				break;
			case 'f':
				if (c < lines.get(r).length()) {
					++c;
				} else if (c == lines.get(r).length() && r < lines.size() - 1) {
					c = 0;
					++r;
				}
				break;
			case 'b':
				if (c > 0) {
					--c;
				} else if (c == 0 && r > 0) {
					c = lines.get(r - 1).length();
					--r;
				}
				break;
			case 'd':
				if (c < lines.get(r).length()) {
					lines.set(r, lines.get(r).substring(0, c) + lines.get(r).substring(c + 1));
				} else if (c == lines.get(r).length() && r < lines.size() - 1) {
					lines.set(r, lines.get(r) + lines.get(r + 1));
					lines.remove(r + 1);
				}
				break;
			case 'k':
				if (c < lines.get(r).length()) {
					buffer = lines.get(r).substring(c);
					lines.set(r, lines.get(r).substring(0, c));
				} else if (c == lines.get(r).length() && r < lines.size() - 1) {
					buffer = "\n";
					lines.set(r, lines.get(r) + lines.get(r + 1));
					lines.remove(r + 1);
				}
				break;
			case 'y':
				if (buffer.equals("\n")) {
					lines.add(r + 1, lines.get(r).substring(c));
					lines.set(r, lines.get(r).substring(0, c));
					c = 0;
					++r;
				} else if (buffer.length() > 0) {
					lines.set(r, lines.get(r).substring(0, c) + buffer + lines.get(r).substring(c));
					c += buffer.length();
				}
				break;
			}
		}
		for (String l : lines) {
			System.out.println(l);
		}
	}
}

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

using namespace std;

int main() {
	int h, n, a, total = 0;
	cin >> h >> n;
	
	for (int i = 0; i < n; i++) {
		cin >> a;
		total += a;
	}
	
	if (total >= h) cout << "Yes";
	else cout << "No";
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <cmath>
#include <tuple>
#include <bitset>
#include <utility>
 
#define push emplace_back
#define each(i, x) for (auto i=0; i < x; i++)
using ull = unsigned long long;
constexpr auto mod = 1000000007;
 
using namespace std;
template <typename T> inline void dump(const T& x) { cout << "[" << x << "]" << endl; }
template <typename T> inline void dump(const vector<T>& x) { for (const auto v : x) { cout << v << " "; } cout << endl; }
template <typename T> inline void sort_asc(vector<T>& x) { std::sort(x.begin(), x.end()); }
template <typename T> inline void sort_desc(vector<T>& x) { std::sort(x.begin(), x.end(), greater<T>()); }
template <typename T> inline T max_value(vector<T>& x) { return *max_element(x.begin(), x.end()); }
template <typename T> inline T min_value(vector<T>& x) { return *min_element(x.begin(), x.end()); }
template <typename T> inline T sum_value(vector<T>& x) { return accumulate(x.begin(), x.end(), 0); }

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

  vector<ull> p;
  each(i, n) {
    ull tmp;
    cin >> tmp;
    p.push(tmp);
  }

  auto sub = max_value(p) / 2;
  auto sum = sum_value(p);

  cout << ull(sum - sub) << endl;
 
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll N,K;
    cin >>N>>K;
    vector<ll> A(N);
    rep(i,N){
        cin >>A[i];
    }

    ll sum = 1;
    rep(i,K){
        //sum*=A[i];
    }
    ll next;
    rep3(i,K,N){
        //cout << sum<<endl;
        //next = sum/A[i-K]*A[i];
        if(A[i-K]<A[i]){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
        sum = next;
    }
    //cout << sum<<endl;
    //cout << N << endl;


    return 0;
    

}

Measured memory_bytes: 4824
#include <iostream>
#include <math.h>
#include <cstdio>
using namespace std;
 
int main()
{
    double sq, x1, y1, x2, y2;
 
    cin >> x1 >> y1 >> x2 >> y2;
 
    sq = (x2-x1)*(x2-x1)+(y2-y1)*(y2-y1);
    sq = sqrt(sq);
 
    printf("%.6f\n", sq);
 
    return 0;
}

Measured memory_bytes: 1240
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cstdint>
using namespace std;
typedef long long ll;
#define MP make_pair
#define PB push_back
#define inf 1000000007
#define mod 1000000007
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
int n;
vector<vector<int> > g;
vector<int>x,y,res,f;
vector<int>p,q;

int dfs2(int id,int pre,int val,int root){
    p[id] = root;
    q[id] = q[root];
    int sm = 1;
    for(auto xx:g[id]){
        if(xx!=pre&&xx<val){
            sm += dfs2(xx,id,val,root);
        }
    }
    return sm;
}

void dfs(int id,int pre,int val){
    if(id<val){
        for(auto xx:g[id]){
            if(xx!=pre){
                dfs(xx,id,val);
            }
        }
        return;
    }
    q[id] = id;
    int smf = 1;
    for(auto xx:g[id]){
        if(xx!=pre&&xx < val){
            q[xx] = id;
            int k = dfs2(xx,id,val,xx);
            smf += k;
            x[xx] = k;
        }
    }
    for(auto xx:g[id]){
        if(xx!=pre&&xx < id){
            int sm = dfs2(xx,id,id,xx);
            y[xx] = sm;
        }
    }
    f[id] = smf;
    for(auto xx:g[id]){
        if(xx!=pre){
            dfs(xx,id,id);
        }
    }
}
void dfs3(int id,int pre,int val){
    if(id==13)cerr << val << endl;
    if(q[id]==id){
        res[id] = val + f[id];
        val += f[id];
        for(auto xx:g[id]){
            if(xx!=pre){
                dfs3(xx,id,val);
            }
        }
    }else{
        res[id] = val -x[p[id]] + y[p[id]];
        for(auto xx:g[id]){
            if(xx!=pre){
                if(q[xx]==xx){
                    
                    dfs3(xx,id,val-x[p[id]] + y[p[id]]);
                }else{
                    dfs3(xx,id,val);
                }
            }
        }
    }
}

int main(){
    cin >> n;   
    g.resize(n);
    x.resize(n);
    y.resize(n);
    res.resize(n);
    p.resize(n,-1);
    q.resize(n,-1);
    f.resize(n);
    rep(i,n-1){
        int a,b;
        cin >> a >> b;
        a--;b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    for(auto xx:g[0]){
        dfs(xx,0,0);
    }
    for(auto xx:g[0]){
        dfs3(xx,0,0);
    }
    // rep(i,n){
    //     cerr << i << " " << p[i] << " " << q[i] << " " << f[i] << " " << x[i] << " " << y[i] << endl;
    // }
    rep(i,n-1){
        cout << res[i+1] << " ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 32896
#include<bits/stdc++.h>
using namespace std;
inline int read()
{
	int out=0,fh=1;
	char jp=getchar();
	while ((jp>'9'||jp<'0')&&jp!='-')
		jp=getchar();
	if (jp=='-')
		{
			fh=-1;
			jp=getchar();
		}
	while (jp>='0'&&jp<='9')
		{
			out=out*10+jp-'0';
			jp=getchar();
		}
	return out*fh;
}
int main()
{
  	//freopen(".in","r",stdin);
  	//freopen(".out","w",stdout);
  	char buf[10];
  	scanf("%s",buf);
  	if(strlen(buf)==2)
  		{
  			printf("%s",buf);	
		}
	else
		{
			for(int i=strlen(buf)-1;i>=0;--i)
				printf("%c",buf[i]);
		}
	return 0;
}


Measured memory_bytes: 256
/*
Problem : https://atcoder.jp/contests/agc041/tasks/agc041_b
Algorithm : binary search
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;

int n;
ll m,p,v;
ll a[MAXN];

bool check(int x){
	ll cnt = (v - (p - 1)) * m;
	if(a[p] > a[x] + m)
		return false;
	for(int i = 1;i <= n;i++){
		if(a[i] <= a[x])
			cnt -= m;
	}
	for(int i = x;i >= p;i--){
		if(a[x] == a[i])
			continue;
		cnt -= (a[x] + m - a[i]);
	}
	if(cnt <= 0)
		return true;
	return false;
}

int main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
	scanf("%d%lld%lld%lld",&n,&m,&v,&p);
	for(int i = 1;i <= n;i++)
		scanf("%lld",&a[i]);
	sort(a + 1,a + 1 + n,greater<ll>());
	int l = 1,r = n,ans = 0;
	while(l <= r){
		int mid = (l + r) >> 1;
		if(check(mid)){
			ans = mid;
			l = mid + 1;
		}else
			r = mid - 1;
	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 1152
R, G, B, N = map(int, input().split())

S = min(R, G, B)
L = max(R, G, B)
M = R + G + B - S - L

cnt = 0
sum = 0
for i in range(N // L + 1)[::-1]:
    for j in range(N // M + 1):
        sum = N - i * L - j * M
        if sum < 0:
            break
        if sum % S == 0:
            cnt += 1
print(cnt)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
  ll n;
  cin >>n;
  ll c[n-1],s[n-1],f[n-1];
  for(ll i=0;i<n-1;i++) cin >>c[i]>>s[i]>>f[i];
  for(ll i=0;i<n-1;i++){
    ll ans=0;
    for(ll j=i;j<n-1;j++){
      if(s[j]<=ans){
         if(ans%f[j]==0) {
           ans+=c[j];
         }
         else {
           ans+=((f[j]-ans%f[j])+c[j]);
         }
      }
      else{
         ans+=((s[j]-ans)+c[j]);
      }
    }
    cout <<ans<<endl;
   }
   cout <<0<<endl;
  }


Measured memory_bytes: 256
import itertools

N = int(input())
S = [True if x == 'o' else False for x in input()]
S.append(S[0])
S.append(S[1])
lst = [None] * (N + 2)
for x0, x1 in itertools.product((True, False), repeat=2):
    lst[0], lst[1] = x0, x1
    for i in range(1, N + 1):
        lst[i + 1] = lst[i] ^ S[i] ^ lst[i - 1]
    if (lst[N], lst[N + 1]) == (lst[0], lst[1]):
        print(''.join(map(str, ('S' if x else 'W' for x in lst[:-2]))))
        break
else:
    print(-1)


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

int main(){
    int N, A, B;
    cin >> N >> A >> B;
    int p[3] = {};
    for(int i = 0; i < N; ++i){
        int a;
        cin >> a;
        if(a <= A){
            p[0]++;
        }else if(a <= B){
            p[1]++;
        }else{
            p[2]++;
        }
    }

    cout << min(p[0], min(p[1], p[2])) << endl;
}


Measured memory_bytes: 256
// 12/07/2020  @ 19:54:17
// *****************************************************************
// *****************************************************************
#include <bits/stdc++.h>
// *****************************************************************
// *****************************************************************
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); srand(chrono::high_resolution_clock::now().time_since_epoch().count());
#define fr(i,n) for(llu i=0;i<n;i++)
#define fl(j,a,b) for(llu j=a;j<=b;j++)
#define Pi 3.1415926535897932384626
#define mod 1e9+7
#define MID(a,b) ((a + b) >> 1)
#define MAX(a,b) ((a) > (b) ? (a): (b))
#define MIN(a,b) ((a) < (b) ? (a) :(b))
#define pb push_back
#define mp make_pair
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector<ll>
#define pi pair<int, int>
#define pl pair<ll, ll>
#define printer(a, n) fr(i,n) cout << a[i] << " ";
// *****************************************************************
// *****************************************************************
typedef long long unsigned int llu;
typedef long long int ll;
// *****************************************************************
// *****************************************************************
using namespace std;
// *****************************************************************
// *****************************************************************

                   // Dream it. Wish it. Do it.

                         // tannatsri //

              // Without tact you can learn nothing.

// *****************************************************************
// *****************************************************************
bool rev(ll a, ll b) {
    return a > b;
}
// *****************************************************************
void solution() {
	int n, k;
	cin >> n >> k;
	if(n > k) cout << "safe";
	else cout << "unsafe";
}
// *****************************************************************
int main() {
    IOS;
    // #ifndef ONLINE_JUDGE
        // freopen("C:/Users/Mr.Tanishq/Desktop/noc/input.txt", "r", stdin);
        // freopen("C:/Users/Mr.Tanishq/Desktop/noc/output.txt", "w", stdout);
        // freopen("C:/Users/Mr.Tanishq/Desktop/noc/error.txt", "w", stderr);
    // #endif
    // *****************************************************************
    // *****************************************************************
    int t = 1;
    // cin >> t;
    while(t--) {

       solution();
       cout << "\n";
    }
    return 0;
}

Measured memory_bytes: 3644
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<set>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;
typedef pair<int, int> pii;

typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 5005
const ll INF = 1e9 + 7;


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




int main() {


	int n, k;
	cin >> n >> k;
	string s;
	cin >> s;

	s[k - 1] = tolower(s[k - 1]);
	cout << s << endl;


	

	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(vec) vec.begin(), vec.end()
using namespace std;
typedef long long ll;
ll gcd(ll x, ll y){
  return y == 0 ? x : gcd(y, x % y);
}
ll lcg(ll x, ll y){
  return x * y / gcd(x, y);
}

int main(){
  ll a, b, x, y;
  cin >> a >> b >> x >> y;

  //string ans = "Yes";
  //string ans = "No";
  //string ans = "YES";
  //string ans = "NO";
  ll ans = 0;
  cout << a * b / (double)2 << " " << ((2 * x == a && 2 * y == b) ? 1 : 0) << endl;
  
  //cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>

using namespace std;

const long long MOD = 1000000007;

int main(){
	int a,b;
	cin >> a >> b;
	int now=1,cnt=0;
	while(1){
		if(now>=b)break;
		now--;
		now+=a;
		cnt++;
	}
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 256
import collections
import itertools
n = int(input())
s = []
for i in range(n):
    a = list(input())
    s.append(a[0])

c = collections.Counter(s)
select_s = ['M', 'A', 'R', 'C', 'H']
ans = 0
for select in itertools.combinations(select_s, 3):
    ans += c[select[0]] * c[select[1]] * c[select[2]]
print(ans)


Measured memory_bytes: 4268
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
long long fac(ll a){
    long long ans=1;
    while(a>1){
        ans*=a;
        a--;
    }
    return ans;
}
int main(){
    string s;
    cin >> s;
    int ans=0;
    for(int i=0;i<s.size()-1;i++){
        if(s[i]!=s[i+1]){
            ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 512