akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
    #include<algorithm>
    #include<cmath>
    #include<climits>
    using namespace std;
    typedef long long int lli;
    typedef vector<int> vi;
    typedef vector<long long int> vlli;
    typedef pair<int,int> pii;
    typedef pair<long long int,long long int> plli;
    typedef vector< vi > vvi ;
    typedef vector< vlli > vvlli  ;
    #define fi(i,a,b) for(int i=a;i<=b;i++)
    #define flli(i,a,b) for(long long int i=a;i<=b;i++)
    #define bi(i,a,b) for(int i=a;i>=b;i--)
    #define blli(i,a,b) for(long long int i=a;i>=b;i--)
    #define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
    #define all(x) x.begin(),x.end()
    #define sz(x) x.size()
    #define pi 2*acos(0.0)
    #define pb push_back
    #define tr(v,it) for(decltype(v.begin()) it=v.begin();it!=v.end();it++)
    #define present(v,num) (v.find(num)!=v.end())
    #define cpresent(v,num) (find(v.begin(),v.end(),num)!=v.end())
    #define pq priority_queue
    #define mp make_pair
    const int inf=INT_MAX;
    const lli INF =LLONG_MAX;
    const lli mod = 1e9+7;
    int main() {
        #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        #endif
        fast;
        lli l,r,d;cin>>l>>r>>d;
        lli c1=r/d;
        lli c2=(l-1)/d;
        lli ans=c1-c2;cout<<ans;
        cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
        return 0;
    }

Measured memory_bytes: 3784
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
 
  for( int i = 0; i < N; i++){
    string h;
    cin >> h;
    if (h == "Y"){
      cout << "Four" << endl;
      break;
    }
    if (i == N-1){
      cout << "Three" << endl;
    }
  }
}

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

#define int long long
typedef vector<int> vint;
typedef pair<int, int> pint;
const double PI = 3.141592653589793238462643383279;
const int DY[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int DX[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
template<typename T, typename U> inline bool chmax(T &a, const U &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T, typename U> inline bool chmin(T &a, const U &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
struct Init {
    Init() {
        cout << fixed << setprecision(20);
    };
} init;

int N, X;
int m = LLONG_MAX;
int f(int n, int x) {
    chmin(m, n);
    return x ? n / x * x * 2 + f(x, n % x) : 0;
}
signed main() {
    cin >> N >> X;
    cout << N + f(N - X, X) - m << endl;
}


Measured memory_bytes: 256
#!/usr/bin/python3
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
check_list = [0] * n
ac_count = 0
wa_count = 0
wa_list = [0] * n
for i in range(0, m):
    p, s = input().split()
    if check_list[int(p) - 1] == 0:
        if s == "WA":
            wa_list[int(p) - 1] += 1
        else:
            ac_count += 1
            check_list[int(p) - 1] = 1
            wa_count += wa_list[int(p) - 1]
print(ac_count, wa_count)


Measured memory_bytes: 4596
n = int(input())
a = list(map(int, input().split()))

cnt = 1
sa = 0
for i in range(1, n):
    new = a[i] - a[i-1]
    if new * sa < 0:
        cnt += 1
        sa = 0
        continue
    if new != 0:
        sa = new
print(cnt)

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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<=(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define Eback(s) s.erase(s.end()-1,s.end())
#define rev(v) reverse(all(v))
#define minvec(v) *min_element(all(v))
#define maxvec(v) *max_element(all(v))
#define sumvec(v) accumulate(all(v),0)
#define mapmax(v) v.rbegin()->first
#define mapmin(v) v.begin()->first
#define pb push_back
#define pf push_front
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
#define OK puts("OK")
#define OK1 puts("OK1")
#define OK2 puts("OK2")
#define SIZE(s) (int)s.size()
#define INF ((1LL<<62)-(1LL<<31))
#define zero(x,n) setw(x) << setfill('0') << n

typedef long long ll;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long> vll;
typedef vector<vll> vvll;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;

typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
typedef vector<pair<ll,ll>> vpll;

const double pi = acos(-1.0);
const int mod=1000000007;
const int mod2=998244353;

template<class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
	ost << "{" << p.first << ", " << p.second << "} ";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{";
	for (int i = 0; i<(int)v.size(); i++) {
		if (i)ost << " ";
		ost << v[i];
	}
	ost << "} \n";
	return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{";
	for (auto p:v) {
		ost << "{" << p.first << ", " << p.second << "} ";
	}
	ost << "} ";
	return ost;
}

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

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

void YES(bool b) {cout << (b?"YES\n":"NO\n");}
void Yes(bool b) {cout << (b?"Yes\n":"No\n");}
void yes(bool b) {cout << (b?"yes\n":"no\n");}
void Yay(bool b) {cout << (b?"Yay!\n":":(\n");}

long long powmod(long long a,long long b){
    long long c=1;
    while(b>0){
        if(b&1) c=a*c%mod;
        a=a*a%mod;
        b>>=1;
    }
    return c;
}

ll gcd(ll x, ll y) {return __gcd(x,y);}
ll lcm(ll x, ll y) {return x/__gcd(x,y)*y;}

int main()
{
	ll n;
	cin >> n;
	vll a(n),b;
	rep(i,n) cin >> a[i];
	ll sum=sumvec(a);
	if(sum%10!=0){
		cout << sum << endl;
		return 0;
	}
	rep(i,n){
		if(a[i]%10!=0) b.pb(a[i]);
	}
	sort(all(b));
	if(SIZE(b)==0) cout << 0 << endl;
	else cout << sum-b[0] << endl;
	return 0;
}


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

typedef long long ll;
ll n,W,w[110],v[110],sum[4][110],mx;
vector<ll> wt[4];

int main()
{
	cin>>n>>W;
	for(ll i=1;i<=n;i++){
		cin>>w[i]>>v[i];
		wt[w[i]-w[1]].push_back(-v[i]);
	}
	for(ll i=0;i<4;i++) sort(wt[i].begin(),wt[i].end());
	for(ll i=0;i<4;i++){
		for(ll j=0;j<wt[i].size();j++) sum[i][j+1]=sum[i][j]-wt[i][j];
	}
	for(ll l1=0;l1<=wt[0].size();l1++){
		for(ll l2=0;l2<=wt[1].size();l2++){
			for(ll l3=0;l3<=wt[2].size();l3++){
				for(ll l4=0;l4<=wt[3].size();l4++){
					if(l1*w[1]+l2*(w[1]+1)+l3*(w[1]+2)+l4*(w[1]+3)<=W){
						mx=max(mx,sum[0][l1]+sum[1][l2]+sum[2][l3]+sum[3][l4]);
					}
				}
			}
		}
	}
	cout<<mx<<endl;
	return 0;
}

Measured memory_bytes: 256
def main():
    import bisect
    n, m, *py = map(int, open(0).read().split())
    d = [[] for _ in range(n + 1)]
    for i, j in zip(*[iter(py)] * 2):
        d[i].append(j)

    for i in d:
        i.sort()

    ans = ''
    for i, j in zip(*[iter(py)] * 2):
        k = bisect.bisect_right(d[i], j)
        id = str(i).zfill(6) + str(k).zfill(6)
        ans += id + '\n'

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 26460
<?php
define("MOD", 10**9+7);
fscanf(STDIN, "%d%d", $n, $k); //n部屋、k回移動
$k = min($n-1, $k);//0人の部屋の数の上限
prepareMod($n);
$count = 0;
for($i = 0; $i <= $k; $i++){
    $count += nCm($n, $i) * nHm($n-$i, $i);
    $count %= MOD;
}
echo $count,"\n";

/**
 * とても高速なnCm関数です
 *  prepareModで事前計算しておき、
 *  nCmを呼び出しましょう。
 *  AtCoderの2秒制約ならN=10^6ぐらいまで通ります
 */

function prepareMod($n){
    global $f, $invf;
    $f[0] = $invf[0] = $invf[1] = 1;
    for($i = 1; $i <= $n; $i++)$f[$i] = $f[$i-1]*$i%MOD;
    for($i = 2; $i <= $n; $i++)$invf[$i] = (MOD - intdiv(MOD, $i))*$invf[MOD%$i]%MOD;
    for($i = 2; $i <= $n; $i++)$invf[$i] = $invf[$i]*$invf[$i-1]%MOD;
}
function nHm($n, $m){
    global $f, $invf;
    return nCm($n+$m-1, $m);
}
function nCm($n, $m){
    global $f, $invf;
    if($n < 0 || $n - $m < 0)return 0;
    return $f[$n] * $invf[$n-$m] % MOD * $invf[$m] % MOD;
}


Measured memory_bytes: 25588
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int x1 = sc.nextInt();
		int y1 = sc.nextInt();
		int x2 = sc.nextInt();
		int y2 = sc.nextInt();
		int x3;
		int y3;
		int x4;
		int y4;

		if (y1 >= y2) {
			x3 = x2 + (y1 - y2);
			x4 = x1 + (y1 - y2);
		} else {
			x3 = x2 - (y2 - y1);
			x4 = x1 - (y2 - y1);
		}

		if (x1 >= x2) {
			y3 = y2 - (x1 - x2);
			y4 = y1 - (x1 - x2);
		} else {
			y3 = y2 + (x2 - x1);
			y4 = y1 + (x2 - x1);
		}

		System.out.println(x3 + " " + y3 + " " + x4 + " " + y4);

	}
}

Measured memory_bytes: 21712
#include<iostream>
#include<vector>
#include<algorithm>
 
using namespace std;
int main()
{
	int N,d[110],ans=1;
	cin >> N;
	for(int i=0; i<N; i++){
		cin >> d[i];
	}
	sort(d,d+N);
	for(int i=1; i<N; i++){
		if(d[i-1] != d[i]) ans++; 
	}
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
int a;
int i[10][3];
i[0][2]=1;
i[1][2]=2;
i[2][2]=4;
i[3][2]=8;
i[4][2]=16;
i[5][2]=32;
i[6][2]=64;
i[7][2]=128;
i[8][2]=256;
i[9][2]=512;
while(cin>>a)
{
    for(int h=0;h<10;h++)
    {
        i[h][0]=0;
        i[h][1]=0;
    }
    for(i[0][0]=0;i[0][0]<=1;i[0][0]++)
    {
    for(i[1][0]=0;i[1][0]<=2;i[1][0]+=2)
    {
    for(i[2][0]=0;i[2][0]<=4;i[2][0]+=4)
    {
    for(i[3][0]=0;i[3][0]<=8;i[3][0]+=8)
    {
    for(i[4][0]=0;i[4][0]<=16;i[4][0]+=16)
    {
    for(i[5][0]=0;i[5][0]<=32;i[5][0]+=32)
    {
    for(i[6][0]=0;i[6][0]<=64;i[6][0]+=64)
    {
    for(i[7][0]=0;i[7][0]<=128;i[7][0]+=128)
    {
    for(i[8][0]=0;i[8][0]<=256;i[8][0]+=256)
    {
    for(i[9][0]=0;i[9][0]<=512;i[9][0]+=512)
    {
    if(i[0][0]+i[1][0]+i[2][0]+i[3][0]+i[4][0]+i[5][0]+i[6][0]+i[7][0]+i[8][0]+i[9][0]==a)
    {
    for(int j=0;j<10;j++)
    {
    if(i[j][0]!=0)
    {
    i[j][1]++;
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    int l=0;
    for(int k=0;k<10;k++)
    {
    if(l==0&&i[k][1]>0)
    {
    cout<<i[k][2];
    l++;
    }
    else if(i[k][1]>0)
    {
    cout<<" "<<i[k][2];
    }
    }
    cout<<endl;
}
return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

int main() {
	ll N, K; cin >> N >> K;
	vector<ll> A(N);
	for(int i = 0; i < N; i++) cin >> A[i];
	for(int i = 0; i < N - K; i++) {
		if(A[i + K] > A[i]) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

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

using namespace std;

int K,A[100010];
typedef long long LL; 

int main()
{
	scanf("%d",&K);
	for (int i=1;i<=K;i++)scanf("%d",&A[i]);
	
	LL L = 2, R = 2, NL, NR;
	for (int i=K;i>=1;i--)
	{
		LL v = A[i];
		
		NL = ((L + v - 1) / v) * v;
		NR = (R / v) * v;
		NR += (v - 1);
		
		if (NL > NR) return 0*puts("-1");
		L = NL;
		R = NR;
	}
	printf("%lld %lld\n",NL,NR);
} 

Measured memory_bytes: 640
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stack>
#include <deque>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <deque>

#include <set>
#include <bitset>
#include<unordered_map>
#include<vector>
#include<map>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
#define endl '\n'
#define exit(s) return cout<<s,0;
#define sz(s) (int)(s.size())
#define all(s) s.begin(),s.end()
#define allr(s) s.rbegin(), s.rend()
#define watch(x) cout << (#x) << " = " << x << endl
#define DNT ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int main() {
	ll n, m, sum = 0;
	cin >> n;
	vector<ll>v(n);
	for (int i = 0; i < n; i++) { cin >> v[i]; 
	
	sum += v[i];
	}
	cin >> m;
	while (m--)
	{
		ll x, y;
		cin >> x >> y;
		x--;
		cout << sum + (y - v[x]) << endl;
	}


	return 0;
}

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

int get_group(int v) {
    switch (v) {
        case 1:
        case 3:
        case 5:
        case 7:
        case 8:
        case 10:
        case 12:
            return 1;
        case 4:
        case 6:
        case 9:
        case 11:
            return 2;
        case 2:
            return 3;
    }
    
    return -1;
}

int main() {
    int x, y;
    cin >> x >> y;
    cout << ((get_group(x) == get_group(y)) ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long K = sc.nextLong();
        long remainder = N % K;
        long residual = K - remainder;
        if (remainder < residual) {
            System.out.println(remainder);
        } else {
            System.out.println(residual);
        }
    }
}

Measured memory_bytes: 21844
#include<iostream>
#include<vector>
#define rep(i,n) for(int i=0; i<(n); ++i)
using ll = long long;

int main(){
    int n; std::cin >> n;
    std::vector<ll> a(n);
    rep(i,n) std::cin >> a[i];
    ll ret=0;
    for(int i=1; i<n; ++i){
        if(a[i] < a[i-1]){
            ret += a[i-1] - a[i];
            a[i] = a[i-1];
        }
    }
    std::cout << ret << std::endl;
    return 0;
}

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


int main(){
  int n;
  cin >> n;
  int sum = 0;
  vector<int> v(n, 0);
  for(int i = 0; i < n; i++){
    cin >> v[i];
    sum += v[i];
  }
  sort(v.begin(), v.end());
  int c = 0;
  for(int i = 0; i < n; i++){
    if(v[i] % 10 != 0){ c = v[i]; break; }
  }

  if(c == 0){
    cout << 0 << endl;
  }
  else{
    if(sum % 10 == 0){
    cout << sum - c << endl;
    }
    else{
      cout << sum << endl;
    }
  }
}       

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define Debug(x) printf("x = %d\n", x);
#define Error_cor() puts("OK here")
#define For(i, a, b) for (int i = a; i <= b; i++)
#define Rep(i, a, b) for (int i = a; i >= b; i--)
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
	freopen(".in", "r", stdin);
	freopen(".out", "w", stdout);
#endif
using namespace std;
typedef long long ll;
namespace IO {
	inline ll read() {
		ll x = 0; char c; int f = 1;
		while (c < '0' || c > '9') {if (c == '-') f = -f; c = getchar();};
		while (c >= '0' && c <= '9') {x = (x << 1) + (x << 3) + (c ^ 48);c = getchar();};
		return x * f;
	}
	inline void write(ll x) {
		static char buf[15];
		static int len = -1;
		if (x < 0) {
			putchar('-'); x = -x;
		}
		do {
			buf[++len] = (x % 10) + 48; x /= 10;
		}while (x);
		while (len >= 0)
			putchar(buf[len--]);
	}
	inline void writeln(ll x){
		write(x);
		putchar('\n');
	}
	inline void writesp(ll x) {
		write(x);
		putchar(' ');
	}
	inline void spwrite(ll x){
		putchar(' ');
		write(x);
	}	
}
const int INF = 0x3f3f3f3f;
int main(void) {
	ll n = IO::read();
	ll k = IO::read();
	ll l = n / k;
	ll res = (l + 1) * k - n;
	cout << min(res, n % k) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  char s;
  vector<char> v{'a','i','u','e','o'};
  cin>>s;
  for(int i=0;i<5;i++){
    if(s==v.at(i)){
      cout<<"vowel"<<endl;
      return 0;
    }
  }
  cout<<"consonant"<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <set>
#define ll long long 
#include <string>
#define pb push_back
#define mp make_pair
# define pi 3.14159265358979323846
#define mod 1000000007
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
void fastio()
{
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

}
ll int multiply(ll int a,ll int b)
{
	ll int ans=(a%mod*b%mod)%mod;
	return ans;
}
ll int add(ll int a, ll int b)
{
	ll int ans=(a%mod+b%mod)% mod;
	return ans;
}
 
void solve()
{
	ll int n;
	cin>>n;
	if (n==1)
		cout<<0<<endl;
	if (n==0)
		cout<<1<<endl;
	
}

int main()
{ 
	fastio();
    ll int t;
    // cin>>t;
    t=1;
    while(t--)
    {
    	solve();
    }
}

	
		
	
	
	
	





Measured memory_bytes: 3688
N,X = map(int,input().split())
L_list = list(map(int,input().split()))

ans = 0
D_list = [0]

for i in range(1,N+1):
    D = D_list[i-1]+L_list[i-1]
    D_list.append(D)

for k in D_list:
    if k <= X:
        ans += 1

print(ans)

Measured memory_bytes: 3060
#include <iostream>

using namespace std;

int tab[100007][3];
int dp[100007][3];

int main()
{
    int N;
    cin >> N;
    for(int i=1; i<=N; i++)
        for(int j=0; j<3; j++)
            cin >> tab[i][j];
    for(int i=0; i<3; i++)
        dp[1][i]=tab[1][i];
    for(int i=2; i<=N; i++)
        for(int j=0; j<3; j++)
            dp[i][j]=max(dp[i-1][(j+2)%3], dp[i-1][(j+1)%3])+tab[i][j];
    cout << max(max(dp[N][0], dp[N][1]),dp[N][2]);
}

Measured memory_bytes: 2560
#include <vector>
#include <math.h>
#include <iostream>

using namespace std;

int main(){

  int N;
  cin >> N;
  vector<int> h;
  for(int i=0; i<N; i++){
    int height;
    cin >> height;
    h.push_back(height);
  }

  vector<int> C(N);

  C[0] = 0;
  C[1] = (int)abs(h[1] - h[0]);
  for(int i = 2; i < N; i++){
    C[i] = (int)min(C[i-1] + (int)abs(h[i-1] - h[i]), C[i-2] + (int)abs(h[i-2] - h[i]));
  }
  cout << C[N-1] << "\n";
  
  return 0;
}


Measured memory_bytes: 1144
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

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

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007; // 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};

struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cerr << fixed << setprecision(10);
  }
} iosetup;
/*-------------------------------------------------*/
int main() {
  int a, b, x; cin >> a >> b >> x;
  if (x <= 0.5 * b * a * a) {
    cout << atan((double)a * b * b / (2 * x)) * 180 / M_PI << '\n';
  } else {
    cout << atan(2.0 * (a * a * b - x) / a / a / a) * 180 / M_PI << '\n';
  }
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main() {
        const int alpha_num = 'z' - 'a' + 1;
        int alpha[alpha_num] = {};
        int n;
        cin >> n;
        vector<string> S(n);
        for (int i = 0; i < n; i++) {
                cin >> S[i];
        }

        for (char& c : S[0]) {
                alpha[c - 'a']++;
        }
        for (int i = 1; i < S.size(); i++) {
                int tmp[alpha_num] = {};
                for (char& c : S[i]) {
                        tmp[c - 'a']++;
                }
                for (int j = 0; j < alpha_num; j++) {
                        alpha[j] = min(tmp[j], alpha[j]);
                }
        }

        for (int i = 0; i < alpha_num; i++) {
                for (int j = 0; j < alpha[i]; j++) {
                        cout << (char)('a' + i);
                }
        }
        cout << endl;
        return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using pl = pair<ll, ll>;
const ll INF = ll(1e18);
const ll mod = 998244353;
const double pi = acos(-1);
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define rnfor(i,a,b) for(ll (i) = (b) - 1; (i) >= (a); --(i))
#define pf(x) cout << (x) << endl
#define all(x) (x).begin(),(x).end()
#define yes pf("Yes")
#define no pf("No")
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; }
const int dx[8]={1,0,-1,0,1,1,-1,-1};
const int dy[8]={0,1,0,-1,1,-1,1,-1};

ll gcd(ll a,ll b){
    if(a < b)swap(a, b);
    if(b == 0) return a;
    return gcd(b,a%b);
}

ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b;
}

ll factorial(ll n){
    ll ans = 1;
    rep1(i, n){
        ans *= i;
        ans %= mod;
    }
    return ans;
}

ll power(ll a, ll b){
    ll ans = 1;
    a %= mod;
    while(b) {
        if(b & 1LL) ans = ans * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return ans % mod;
}

vector<ll> FactorialInv, Factorial;

void init_combination(ll MAX){
    Factorial.resize(MAX + 1);
    FactorialInv.resize(MAX + 1);
    Factorial[0] = 1;
    for(int i = 1; i <= MAX; i++){
        Factorial[i] = Factorial[i - 1] * i % mod;
    }
    FactorialInv[MAX] = power(Factorial[MAX], mod - 2);
    for(ll i = MAX - 1; i >= 0; i--) {
        FactorialInv[i] = FactorialInv[i+1] * (i+1) % mod;
    }
}

ll combination(ll a, ll b){
    if((a == b) || (b == 0)){
        return 1;
    }
    if(a < b) return 0;
    if(b < 0) return 0;
    ll ans = Factorial[a] * FactorialInv[b] % mod;
    ans = ans * FactorialInv[a - b] % mod;
    return ans;
}

//modの値の確認をすること
int main(){
    ll n;
    cin >> n;
    vector<ll> c(1e5 + 1,0);
    ll cnt = 0;
    rep0(i, n){
        ll a;
        cin >> a;
        ++c[a];
        cnt += a;
    }
    ll q;
    cin >> q;
    rep0(i, q){
        ll b,d;
        cin >> b >> d;
        cnt += c[b] * (d - b);
        c[d] += c[b];
        c[b] = 0;
        pf(cnt);
    }
    return 0;
}


Measured memory_bytes: 4048
#include <iostream>

using namespace std;

string S;

int main()
{
    cin >> S;
    for(int i=0;i<S.length();i++) {
        S[i] = tolower(S[i]);
    }
    if(S[S.length()-1] == 's') S += "es";
    else S+= 's';

    cout << S << endl;

    return 0;
}


Measured memory_bytes: 3636
H, W = map(int, input().split())
a = []
for i in range(H):
    s = input()
    if "#" in s:
        a.append(s)

d = [i for i in range(W)]

for i in range(W):
    f = 0
    for j in a:
        if j[i] == "#":
            f = 1
            break
    if f == 0:
        d.remove(i)

ans = [""] * H
for i in range(len(a)):
    for j in d:
        ans[i] += a[i][j]
    print(ans[i])



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

namespace atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int N = int.Parse(input[0]);
            int A = int.Parse(input[1]);
            int B = int.Parse(input[2]);
            int sum = 0;

            for(int i=1;i<=N;i++){
                string str = i.ToString();
                char[] chars = str.ToCharArray();
                int SOD = 0;
                foreach(char c in chars){
                    SOD += int.Parse(c.ToString());
                }
                if(SOD >= A && SOD <= B){// A < SOD < B
                    sum += i;
                }
            }
            Console.WriteLine(sum);
        }
    }
}


Measured memory_bytes: 13140
N = int(input())
B = list(map(int, input().split()))

A =[0]* N
A[N-1] = B[N-2]
A[0] = B[0]

for i in range(1,N-1):
    A[i] =  min((B[i-1],B[i]))

ans = sum(A)
print(ans)

Measured memory_bytes: 38384
// AOJ DSL_2_B Range Sum Query (RSQ)
// 2018.5.5 bal4u

#include <stdio.h>
#include <stdlib.h>

#if 1
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
#else
#define gc() getchar()
#define pc(c) putchar(c)
#endif
int in()
{
	int n = 0, c = gc();
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

void out(int n)
{
	int i;
	char ob[20];

	if (!n) pc('0');
	else {
		i = 0; while (n) ob[i++] = n%10 + '0', n/=10;
		while (i--) pc(ob[i]);
	}
	pc('\n');
}


// Binary Indexed Tree
#define MAX_N  100002
int bit[MAX_N]; int sz;

// i番目の値にvを加算する
void add(int i, int v)
{
    while (i <= sz) {
		bit[i] += v;
		i += (i & -i);
	}
}
 
// bit[0]... bit[i]の合計を得る
int sum(int i)
{
	int s = 0;
     while (i > 0) {
		s += bit[i];
		i -= (i & -i);
	}
    return s;
}


int main()
{
	int n, q, op, x, y, s;

	sz = n = in(), q = in();
	while (q--) {
		op = in(), x = in(), y = in();
		if (op) {
			s = sum(y);
			if (x > 1) s -= sum(x-1);
			out(s);
		} else add(x, y);
	}
	return 0;
}



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

const int R = 5;
const int S[] = {0,60,70,80};

bool exist[R][R];
int G[R][R];
int dp[R][R][1<<(R*2)];


void push(int i, int j, int k) {
  G[i][j] = (G[i][j] + k) % 4;
  G[i][j+1] = (G[i][j+1] + k) % 4;
  G[i+1][j] = (G[i+1][j] + k) % 4;
  G[i+1][j+1] = (G[i+1][j+1] + k) % 4;
}

int main() {
  int Tc;
  cin >> Tc;
  while(Tc--) {
    for(int i = 0; i < R; ++i) {
      for(int j = 0; j < R; ++j) {
	cin >> G[i][j];
	exist[i][j] = G[i][j] != 0;
	G[i][j] -= 1;
      }
    }
    fill(dp[0][0], dp[R][0], -1);
    dp[0][0][0] = 0;
    for(int i = 0; i+1 < R; ++i) {
      for(int j = 0; j+1 < R; ++j) {
	for(int b = 0; b < (1<<(R*2)); ++b) {
	  if(dp[i][j][b] == -1) continue;
	  int ni = i, nj = j + 1;
	  if(nj == R-1) {
	    ++ni;
	    nj = 0;
	  }
	  int base;
	  if(j == 0) base = ( ((b>>(1*2))&3) ) % 4;
	  else base = ( ((b>>(0*2))&3) + ((b>>(4*2))&3) + ((b>>(1*2))&3) ) % 4;
	  for(int k = 0; k < 4; ++k) {
	    int nb = (b >> 2) | (k<<(4*2));
	    int d = exist[i][j] ? S[(G[i][j] + base+k)%4] : 0;
	    if(j+1 == R-1 && exist[i][j+1]) {
	      d += S[( G[i][j+1] + ((b>>(1*2))&3) + k ) % 4];
	    }
	    dp[ni][nj][nb] = max(dp[ni][nj][nb], dp[i][j][b] + d);
	  }
	}
      }
    }
    int ans = 0;
    for(int b = 0; b < (1<<(2*R)); ++b) {
      vector<int> v;
      v.push_back(0);
      for(int j = 1; j < R; ++j) {
	v.push_back((b>>(j*2))&3);
      }
      v.push_back(0);
      int sum = 0;
      for(int j = 0; j < v.size(); ++j) {
	if(exist[R-1][j]) sum += S[(G[R-1][j]+v[j]+v[j+1])%4];
      }
      ans = max(ans, dp[R-1][0][b] + sum);
    }
    cout << ans << endl;
  }
  return 0;
}

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

#define INF 1000000007
#define LINF 1000000000000000007

using namespace std;

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

Int gcd(Int x, Int y){
	if(y == 0)
		return x;
	return gcd(y, x % y);
}

Int lcm(Int x, Int y){
	return x * y / gcd(x, y);
}

bool sosuu(int x){
	bool b = 1;
	if(x == 1) b = 0;
	for(int i = 2; i * i <= x; i++){
		if(x % i == 0) {
			b = 0;
			break;
		}
	}
	return b;
}

int n, m, x;

int main(){
	int l = 0, r = 0;
	cin >> n >> m >> x;
	for(int i = 0; i < m; i++){
		int a;
		cin >> a;
		if(a < x) l++;
		else r++;
	}
	
	cout << min(l,r) << endl;
	
	return 0;
}

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

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    map<int, int> primeFactors;
    vector<int> primes;
    for (int i = 1; i <= N; i++)
    {
        int num = i;
        for (int j = 2; j * j <= num; j++)
        {
            while (num % j == 0)
            {
                primeFactors[j]++;
                num /= j;
                if (primeFactors[j] == 1)
                {
                    primes.push_back(j);
                }
            }
        }
        if (num > 1)
        {
            primeFactors[num]++;
            if (primeFactors[num] == 1)
            {
                primes.push_back(num);
            }
        }
    }
    //最大のN=100でも要素はたかだか50未満のため全探索
    ll answer = 0;
    int size = primes.size();
    //三種混合(aの4乗 * bの4乗 * cの2乗)(5 * 5 * 3通り)
    for (int i = 0; i < size; i++)
    {
        if (primeFactors.at(primes.at(i)) < 4)
        {
            continue;
        }
        for (int j = i + 1; j < size; j++)
        {
            if (primeFactors.at(primes.at(j)) < 4)
            {
                continue;
            }
            for (int k = 0; k < size; k++)
            {
                if(k != i && k != j && primeFactors.at(primes.at(k)) >= 2)
                {
                    answer++;
                }
            }
        }
    }
    //aの14乗 * bの4乗(15 * 5)通り
    for(int i = 0; i < size; i++)
    {
        if (primeFactors.at(primes.at(i)) < 14)
        {
            continue;
        }
        for(int j = 0; j < size; j++)
        {
            if (i != j && primeFactors.at(primes.at(j)) >= 4)
            {
                answer++;
            }
        }
    }
    //aの24乗 * bの2乗(25 * 3)通り
    for(int i = 0; i < size; i++)
    {
        if (primeFactors.at(primes.at(i)) < 24)
        {
            continue;
        }
        for(int j = 0; j < size; j++)
        {
            if (i != j && primeFactors.at(primes.at(j)) >= 2)
            {
                answer++;
            }
        }
    }
    //　1種で74乗(75通り)
    for(int i = 0; i < size; i++)
    {
        if(primeFactors.at(primes.at(i)) >= 74)
        {
            answer++;
        }
    }
    cout << answer << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define maxn 510
int f[maxn][maxn],A,B;
int main(){
	cin>>B>>A;
	for(register int i=51;i<=100;++i)for(register int j=1;j<=100;++j)f[i][j]=1;
	int h=100,w=100;
	for(register int i=1;i<=50;i+=2){
		for(register int j=1;j<=100;j+=2){
				--A;
				if(!A)break;
				f[i][j]=1;
		}if(!A)break;
	}
	for(register int i=100;i>=51;i-=2){
		for(register int j=1;j<=100;j+=2){
			--B;
			if(!B)break;
			f[i][j]=0;
		}if(!B)break;
	}cout<<h<<" "<<w<<endl;
	for(register int i=1;i<=100;++i,cout<<endl)for(register int j=1;j<=100;++j){
		if(f[i][j])putchar('#');
		else putchar('.');
	}
	return 0;
}


Measured memory_bytes: 384
s = input()

words = ['dream','dreamer','erase','eraser']

while len(s)>4:
    if s[-5:] == words[0]:
        s = s[:-5]
        continue
    elif s[-7:] == words[1]:
        s = s[:-7]
        continue
    elif s[-5:] == words[2]:
        s = s[:-5]
        continue
    elif s[-6:] == words[3]:
        s = s[:-6]
        continue
    else:
        break

if len(s) > 0:
    print("NO")
else:
    print("YES")

Measured memory_bytes: 3316
A = [int(input()) for _ in range(4)]
count = 0
for i in range(A[0] + 1):
    for j in range(A[1] + 1):
        for k in range(A[2] + 1):
            sum = i * 500 + j * 100 + k * 50
            if sum == A[3]:
                count += 1
print(count)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(int)(a); (i)<(int)(b); ++(i))
#define rFor(i, a, b) for(int (i)=(int)(a)-1; (i)>=(int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
template<class T> bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T> bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}
template<class T> T div_floor(T a, T b){
    if(b < 0) a *= -1, b *= -1;
    return a>=0 ? a/b : (a+1)/b-1;
}
template<class T> T div_ceil(T a, T b){
    if(b < 0) a *= -1, b *= -1;
    return a>0 ? (a-1)/b+1 : a/b;
}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod * mod;
constexpr int MAX = 200010;

int main(){
    int n;
    scanf("%d", &n);
    multiset<int> S;
    rep(i, n){
        int d;
        scanf("%d", &d);
        S.insert(d);
    }
    int m;
    scanf("%d", &m);
    rep(_, m){
        int t;
        scanf("%d", &t);
        if(S.find(t) != S.end()) S.erase(S.find(t));
        else{
            puts("NO");
            return 0;
        }
    }
    puts("YES");
}

Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265358979323
#define ll long long int
#define vi vector <int>
#define vl vector <ll>
#define all(v) (v).begin(),(v).end()
#define pb push_back
 
ll power(ll a, ll b){//a^b
    ll res=1;
    while(b>0){
        if(b&1){res=(res*a);b--;}
        a=(a*a);
        b>>=1;
    }
    return res;
}
 
ll gcd(ll a, ll b){return (b==0)?a:gcd(b,a%b);}
 
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n;
	cin>>n;
	string s;
	cin>>s;
	ll c=1;
	for(ll i=1;i<n;i++)
		if(s[i]!=s[i-1])
			c++;
	cout<<c<<"\n";
}

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

using LL = long long;

#define ALL(a) begin((a)), end((a))
#define FOR(i, a, b) for (int(i) = (a); (i) < (b); (i)++)
#define RFOR(i, a, b) for (int(i) = (a); (i) > (b); (i)--)
#define debug(x) cout << #x << " : " << x << '\n'

const int INF = 1e9;
const int MOD = 1e9 + 7;
const LL LINF = 1e16;

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

  string ans = "No";
  int N;
  cin >> N;

  if (9 == N / 10 || 9 == N % 10) {
    ans = "Yes";
  }

  cout << ans << '\n';

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
#define ALL(a)  (a).begin(),(a).end()
 
const ll mod = 1000000007;
const ll LINF = 1e13;
const ll LLINF = 1e18;
const ll ALPHABET = 26;
 
template <class T>
void Swap(T& r, T& l) {
  T tmp = r;
  r = l;
  l = tmp;
}
 
template<typename T>
istream& operator >> (istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x; //for(int i=0; i<vec.size(); i++) is >> x[i]; とかでもいい
  return is;
}


int main(){
    ll N;
    cin >> N ;
    vector<ll> a(N,0);// 
    cin >> a;
    vector<ll> dig = vector<ll>(70);

    for (ll j = 0; j < 60; j++){
        dig[j] = 0;
    }
    

    for(int i=1;i< a.size();i++){
        for (ll j = 0; j < 60; j++){
            if ( (a[i] >> j)& 1){
                dig[j]++;//1 no kazu
            }
        }
    }


    

    ll ans = 0;

    // a ^ b :排他的論理和
    // やり方はあってたけど桁あふれしてた。
    for (ll i = 0; i < N-1; i++){


        cerr << "a " << a[i] <<endl;

        ll num = N-1 -i; //何このわか
        for (ll j = 0; j < 60; j++){
            ll q = 1;
            for(int k=0;k<j;k++)q*=2;

            if ( (a[i] >> j) & 1  ){
                ans +=(num - dig[j]) * (q % mod);
                ans %= mod;
            }else{
                ans +=dig[j] * (q % mod);
                ans %= mod;
            }
        }

        for (ll j = 0; j < 60; j++){
            if ( (a[i+1] >> j) & 1){
                dig[j]--;
            }
        }
        

    }

    
    cout << (ans % mod) <<endl;
    
}


Measured memory_bytes: 2560
#include<iostream>

using namespace std;

int main() {
	int x[3001], y[3001];
	int i = 0;

	while (1) {
		cin >> x[i] >> y[i];
		if (x[i] == 0 && y[i] == 0) {
			break;
		}
		i++;
	}

	for (int j = 0;j < i;j++) {
		if (y[j] < x[j]) {
			int box;
			box = y[j];
			y[j] = x[j];
			x[j] = box;
		}
		cout << x[j] << " " << y[j] << endl;
	}


	return 0;
}


Measured memory_bytes: 3092
import java.util.*;

public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    sc.close();
    
    if (1 <= A && A <= 9 && 1 <= B && B <= 9) {
      System.out.println(A * B);
    } else {
      System.out.println(-1);
    }
  }
}

Measured memory_bytes: 21844
import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n,x,cou=0;
        while(true){
            n = sc.nextInt();
            x = sc.nextInt();
            if(n==0){
                break;
            }
            cou=0;

            for(int i=1;i<n-1;i++){
                for(int l=i+1;l<n;l++){
                    for(int k=l+1;k<=n;k++){
                        if(i+l+k==x){
                            //System.out.println(i+" "+l+" "+k);
                            cou++;
                        }
                    }
                }
            }

            System.out.println(cou);
        }
        sc.close();
    }
}


Measured memory_bytes: 26600
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
using namespace std;

int main()
{
    int a, b, h;
    cin >> a >> b >> h;

    int ans = (a + b) * h / 2;
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, j, n) for (int i = j; i < (n); ++i)
#define SORT(a) sort(a.begin(), a.end())
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
const int inf = 1001001001;

int main()
{
    int n, c;
    cin >> n >> c;
    int cost[c][c];
    vi array[3], table[3];
    int grid[n][n];
    rep(i, c)
    {
        rep(j, c)
        {
            int d;
            cin >> d;
            cost[i][j] = d;
        }
    }
    rep(i, n)
    {
        rep(j, n)
        {
            int v;
            cin >> v;
            v--;
            int index = (i + j + 2) % 3;
            grid[i][j] = v;
            array[index].push_back(v);
        }
    }
    rep(k, 3)
    {
        rep(i, c)
        {
            int sum = 0;
            for (int e : array[k])
            {
                sum += cost[e][i];
            }
            table[k].push_back(sum);
        }
    }

    int ans = inf;
    rep(i, c)
    {
        rep(j, c)
        {
            rep(k, c)
            {
                if (i == j || i == k || j == k)
                    continue;
                ans = min(ans, table[0][i] + table[1][j] + table[2][k]);
            }
        }
    }
    cout << ans << endl;
}

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

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int f(int a) {
  return (a * a + 4) / 8;
}

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

  int a, b, c, d; cin >> a >> b >> c >> d;
  int cnt = 0;
  for(int i=0;i<=100;++i) {
    if(a <= i && i < b && c <= i && i < d) cnt++;
  }
  cout << cnt << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <ctype.h>
#include <algorithm>
#include <cmath>
#include <vector>

#define REP(i, n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
#define square(x) (x) * (x)

const int INF = 1e9;

using namespace std;

int main() {
    int h, w;
    ostringstream os;
    while(1){
        cin >> h >> w;
        if (h + w == 0)
            break;
        REP(i, h){
            os << "#";
            if (i == 0 || i == h-1)
                REP(i, w-2) os << "#";
            else
                REP(i, w-2) os << ".";
            os << "#";
            os << endl;
        }
        os << endl;
    }
    cout << os.str();
    return 0;
}

Measured memory_bytes: 1316
//in the name of god
//if you read this code please search about imam hussain
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define pb push_back
#define endl "\n";
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define read freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);

const int maxn=2e3+5;
const int mod=1e9+7;
const int inf=1e9;
const int del=728729;
ll x[maxn];
int main(){
	ll n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> x[i];
	}

	sort(x, x+n);
	
	int count = 0;
	for (int i = n - 1; i >= 2; i--){
		for (int k = i - 1; k >= 1; k--){
			for (int j = k-1; j >= 0; j--){
				if (x[k] + x[j]>x[i]) {
					count++;
				}
				else break;
			}
		}
	}
	cout << count << endl;
	return 0;
}



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

using namespace std;

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

#define INF 2<<29
#define F first
#define S second

ll nc2(ll n){
  return n*(n-1)/2;
}

int main(){
  ll n;
  ll num;
  ll cnt=0;
  ll ans=0;
  ll ruiseki[200005];
  ll a;

  scanf("%lld",&n);
  fill(ruiseki,ruiseki+n+1,0);
  for(ll i=1;i<=n;i++){
    scanf("%lld",&a);
    ruiseki[i]=ruiseki[i-1]+a;
  }
  
  sort(ruiseki,ruiseki+n+1);

  ruiseki[n+1]=-1;
  num=ruiseki[0];
  for(ll i=0;i<=n;i++){
    cnt++;
    if(num!=ruiseki[i+1]){
      ans+=nc2(cnt);
      num=ruiseki[i+1];
      cnt=0;
    }
  }
   
  printf("%lld\n",ans);

  return (0);
}

Measured memory_bytes: 1792
X = int(input())
W = 100000 + 1
H = 6
S = [100, 101, 102, 103, 104, 105]

dp = [[-1] * W] * H

for i in range(H):
    for j in range(W):
        if j == S[i]:
            dp[i][j] = 1
        if j - S[i] >= 0 and dp[i][j - S[i]] == 1:
            dp[i][j] = 1
        if i - 1 >= 0 and dp[i - 1][j] == 1:
            dp[i][j] = 1
        if dp[i][j] == 1 and j + S[i] <= 100000:
            dp[i][j + S[i]] = 1

if dp[5][X] == 1:
    print(1)
else:
    print(0)

Measured memory_bytes: 3828
#include<iostream>
#include<algorithm>

#define INF 10000000

using namespace std;

main(){

  int node, edge, source, dst1, dst2;
  
  while(cin >> node >> edge >> source >> dst1 >> dst2){
    if(node == 0)break;
    source--;
    dst1--;
    dst2--;
    
    int d[node][node];
    fill(&d[0][0], &d[node-1][node], INF);

    for(int i=0; i<node; i++){
      d[i][i] = 0;
    }

    for(int i=0; i<edge; i++){
      int f, t;
      cin >> f >> t;
      cin >> d[f-1][t-1];
    }

    for(int i=0; i<node; i++){
      for(int j=0; j<node; j++){
	for(int k=0; k<node; k++){
	  d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
	}
      }
    }

    int ans = INF;

    for(int i=0; i<node; i++){
      ans = min(ans, d[source][i] + d[i][dst1] + d[i][dst2]);
    }

    cout << ans << endl;
  }
}

Measured memory_bytes: 1192
#include <bits/stdc++.h>
#define INF 1e9
#define ll long long
using namespace std;

ll dp[3005][3005]; // sのi文字目までとTのj文字目までのLCSの長さ
string s, t;

void backtrack(int i, int j){
    if(i == 0 || j == 0){
        return;
    }
    if(s[i-1] == t[j-1]){
        backtrack(i - 1, j - 1);
        cout << s[i-1];
    }else{
        if(dp[i-1][j] >= dp[i][j-1]){
            backtrack(i - 1, j);
        }else{
            backtrack(i, j - 1);
        }
    }
}

int main(){
    cin >> s >> t;
    dp[0][0] = 0;
    for(int i = 0; i < s.size(); i++){
        for(int j = 0; j < t.size(); j++){
            if(s[i] == t[j]){
                dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j] + 1);
            }
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i+1][j]);
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j+1]);
        }
    }
    backtrack(s.size(), t.size());
    cout << endl;
    return 0;
}


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

typedef long long ll;

int main(int argc, char *argv[])
{
	string s, t;

	cin >> s >> t;

	int n = int(s.size()), m = int(t.size());
	vector<vector<int>> is(26);

	for (int i = 0; i < n; i++) {
		is[s[i] - 'a'].push_back(i);
	}
	for (int i = 0; i < n; i++) {
		is[s[i] - 'a'].push_back(i + n);
	}


	ll ans = 0;
	int p = 0;
	for (int i = 0; i < m; i++) {
		int c = t[i] - 'a';
		if (is[c].size() == 0) {
			cout << -1 << endl;
			return 0;
		}
		p = *lower_bound(is[c].begin(), is[c].end(), p) + 1;
		if (p >= n) {
			p -= n;
			ans += n;
		}
	}
	ans += p;
	cout << ans << endl;
	return 0;
}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define eee(a) (cerr << (#a) << ": " << (a) << endl);
#define ppp(a) (cout << (a) << endl);
#define cop(a) for(auto x:(a)){cout << x << endl;}


using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using mint = map<int, int>;

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

const char sp = ' ';
const char cmm = ',';
const int MOD = 1e9+7;
const int INF = 1e9;
const ll LINF = 1e18;

ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powmod(ll b, ll e){ll r=1;while(e>0){if(e&1)r=(r%MOD)*(b%MOD)%MOD;b=(b%MOD)*(b%MOD)%MOD;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

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; }
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
    int len = v.size();
    s << '[';
    for (int i = 0; i < len; ++i) {
        s << v[i]; if (i < len-1) s << ", ";
    }
    s << ']';
    return s;
}

struct aaa{
    aaa(){
        // comment this out when you use scanf or printf
        // cin.tie(0); ios::sync_with_stdio(0);
        cout<<fixed<<setprecision(15);
    };
}fastio;

int main(){

    double n;
    cin >> n;
    vector<double> a(n);
    rep(i, n) scanf("%lf", &a[i]);
    double sum = 0;
    rep(i, n){
        sum += 1.0/a[i];
    }
    ppp(1.0/sum);

    return 0;
}


Measured memory_bytes: 256
/*
“Being happy doesn't mean that everything is perfect. It means
that you decided to look beyond the imperfections.”
*/

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

#define int int64_t
#define pr(x) cout << x << endl;
#define vi vector<int>
#define vii vector< vector<int> >
#define mp make_pair
#define ii pair<int,int>
#define fr(i,x,n) for(i = x ; i< n ; i++)
#define f(i,n) for(i = 0 ; i< n ; i++)
#define ff first
#define ss second
#define pb push_back
#define SIZE 200001
#define mod 1000000007
#define int_max 1e12
void solve();
 
int power(int a, int b)
{
    if(b==0) return 1;
    else if(b&1) return a*power(a*a,b/2);
    else return power(a*a, b/2);
}

int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
    solve();
    return 0;
}
int fact(int n)
{
    int i, k=1;
    fr(i, 2, n+1) k*=i;
    return k;
}

int  j=1, n, t, dot=0, i, k, a, x, y,z,c, toko;

void solve()
{
    // cin >> t;while(t--)
    {
       string s;
       cin >> s;
       if(s[0]=='S') pr("Cloudy")
       if(s[0]=='C') pr("Rainy")
       if(s[0]=='R') pr("Sunny")
    }
}

Measured memory_bytes: 256