akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
struct Int
{
	int a[130];
	Int(){memset(a,0,sizeof(a));}
};
Int add(Int p,Int q)
{
	Int ret;
	int k=0;
	for(int i=0;i<130;i++)
	{
		ret.a[i]=(k+p.a[i]+q.a[i])%10;
		k=(k+p.a[i]+q.a[i])/10;
	}
	return ret;
}
bool same(Int p,Int q)
{
	for(int i=0;i<130;i++)if(p.a[i]!=q.a[i])return false;
	return true;
}
void print(Int p)
{
	for(int i=0;i<130;i++)cout << p.a[i];
	cout << endl;
	return;
}
string s1,s2,s3;
bool check(int k)
{
	//cout << s1 << ' ' << s2 << ' ' << s3 << endl;
	if(k==0&&((s1[s1.size()-1]=='X'&&s1.size()>1)||(s2[s2.size()-1]=='X'&&s2.size()>1)||(s3[s3.size()-1]=='X'&&s3.size()>1)))return false;
	Int p,q,r,sum;
	//cout << "どどどどどーん" << endl;
	for(int i=0;i<130;i++)
	{
		//cout << s1[i];
		if(i<s1.size()&&s1[i]=='X')p.a[i]=k;
		else if(i<s1.size())p.a[i]=s1[i]-'0';
		if(i<s2.size()&&s2[i]=='X')q.a[i]=k;
		else if(i<s2.size())q.a[i]=s2[i]-'0';
		if(i<s3.size()&&s3[i]=='X')r.a[i]=k;
		else if(i<s3.size())r.a[i]=s3[i]-'0';
	}
	//cout << endl;
	//print(p);
	//print(q);
	sum=add(p,q);
	/*for(int i=0;i<130;i++)cout << p.a[i];
	cout << endl;
	for(int i=0;i<130;i++)cout << q.a[i];
	cout << endl;i*/
	//for(int i=0;i<130;i++)cout << sum.a[i];
	//cout << endl;
	//print(sum);
	//print(r);
	return same(sum,r);
}
int main()
{
	string s;
	while(cin >> s)
	{
		//cout << s[0]-'0' << endl;
		int len=s.size();
		s1.clear();s2.clear();s3.clear();
		int index=0;
		for(index=0;index<len;index++)
		{
			if(s[index]=='+')break;
			s1+=s[index];
		}
		index++;
		for(;index<len;index++)
		{
			if(s[index]=='=')break;
			s2+=s[index];
		}
		index++;
		for(;index<len;index++)s3+=s[index];
		reverse(s1.begin(),s1.end());
		reverse(s2.begin(),s2.end());
		reverse(s3.begin(),s3.end());
		//cout << s1 << ' ' << s2 << ' ' << s3 << endl;
		bool flag=false; 
		for(int i=0;i<10;i++)
		{
			if(check(i))
			{
				cout << i << endl;
				flag=true;
				break;
			}
		}
		if(!flag)cout << "NA" << endl;
		s.clear();
	}
	return 0;
}

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

int main(){
    int w,h,x,y,r;
    cin >> w >> h >> x >> y >> r;

    if(x - r < 0 || x + r > w ||  y - r < 0 || y + r > h) cout << "No" << endl;
    else cout << "Yes" << endl;

return 0;
}

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

long long solve(long long x, vector<vector<long long>>& cnt)
{
  if (x % 10 == 0) {
    return 0;
  }
  long long base = 1;
  long long order = 0;
  while (base <= x) {
    base = 10 * base;
    order++;
  }
  base = base / 10;
  int upper_digit = x / base;
  int lower_digit = x % 10;
  return cnt.at(lower_digit).at(upper_digit);
}

void update(long long x, vector<vector<long long>>& cnt)
{
  if (x % 10 == 0) {
    return;
  }
  long long base = 1;
  long long order = 0;
  while (base <= x) {
    base = 10 * base;
    order++;
  }
  base = base / 10;
  int upper_digit = x / base;
  int lower_digit = x % 10;
  cnt.at(upper_digit).at(lower_digit)++;
}

int main()
{
  long long res = 0;
  long long n;
  cin >> n;
  vector<vector<long long>> cnt(10, vector<long long>(10, 0));
  for (long long i = 1; i <= n; i++) {
    update(i, cnt);
  }
  for (long long i = 1; i <= n; i++) {
    res += solve(i, cnt);
  }
  cout << res << '\n';
  return 0;
}


Measured memory_bytes: 256
/*input
1 2
*/
/*

**************************
*						 *
* AUTHOR :: knight_coder *
*						 *
**************************

*/
#include<bits/stdc++.h>
#define lld          long long int
#define pb          push_back
#define ppb         pop_back
#define	endl		'\n'
#define mii         map<lld,lld>
#define msi         map<string,lld>
#define mis         map<lld, string>
#define mpi         map<pair<lld ,lld >,lld >
#define pii         pair<lld,lld>
#define vi          vector<lld>
#define vpi 		vector<pii>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (lld)x.size()
#define hell        1000000007
#define rrep(i,m,n)	for(lld i=m;i>=n;i--)
#define rep(i,m,n)	for(lld i=m;i<n;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define what_is(x)  cerr << #x << " is " << x << endl;
#define pr(x) 		cout<< x << " ";
#define pre(x)		cout<< x << endl ;
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>; 
//change null_type to get ordered_map
#define N  100005
void solve()
{
	lld x,y;
	cin >> x >> y;
	rep(i,0,x+1){
		lld tot=i*2+(x-i)*4;
		if(tot==y){
			cout << "Yes" << endl;
			return ;
		}
	} 
	cout << "No" << endl;
	return;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int tests=1;
	//cin>>tests;
	while(tests--)
	{
		solve();
	}
}

Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <utility>
#include <cstring>
#include <string>
#include <sstream>

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

using namespace std;

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

const int diffX[] = {-1, 0, 0, 1};
const int diffY[] = {0, 1, -1, 0};
int cnt;
const int N = 12;
vector<string> table(N);

void run(int, int);

int main(void){
    for(string in; !cin.eof(); getline(cin, in), cout << cnt << endl){
        rep(i, N) getline(cin, table[i]);

        cnt = 0;
        rep(y, N) rep(x, N) if(table[y].at(x) == '1') cnt ++, run(x, y);
    }

    return 0;
}

void run(int x, int y){
    table[y][x] = '0';
    rep(i, 4){
        int xx = x + diffX[i], yy = y + diffY[i]; 
        if(0 <= xx && xx < N && 0 <= yy && yy < N && table[yy][xx] == '1')
            run(xx, yy);
    }
}

Measured memory_bytes: 1192
n,m=map(int,input().split())
aa=list(map(int,input().split()))
bb=list(map(int,input().split()))
mod=10**9+7
ss=0
for i in range(n-1):
    ss+=(aa[i+1]-aa[i])*(i+1)*(n-i-1)
    ss%=mod
tt=0
for i in range(m-1):
    tt+=(bb[i+1]-bb[i])*(i+1)*(m-i-1)
    tt%=mod
print((ss*tt)%mod)

Measured memory_bytes: 83044
#include <iostream>
#define INF 1000000000000000000LL
using namespace std;
using ll = long long;

int main()
{
  string t;
  cin >> t;
  while(t.find("?") != string::npos)
    t.replace(t.find("?"),1,"D");

  cout << t << endl;
  return 0;
}

Measured memory_bytes: 3748
def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > 1: table.append(n)
    return table

n = int(input())
d = [0]*(n+1)
for i in range(2, n+1):
    for j in prime_decomposition(i):
        d[j] += 1
d.sort(reverse=True)
nums = [0]*5
for i in d:
    if i >= 74: j = 5
    elif i >= 24: j = 4
    elif i >= 14: j = 3
    elif i >= 4: j = 2
    elif i >= 2: j = 1
    else: j = 0
    for k in range(j):
        nums[4-k] += 1
print(nums[0]+(nums[1]*(nums[4]-1)+(nums[2]*(nums[3]-1))+nums[3]*(nums[3]-1)*(nums[4]-2)//2))

Measured memory_bytes: 3064
def main():
    N, M = [int(n) for n in input().split()]
    was = [0]*N
    isAc = [False]*N
    acs = 0
    pes = 0
    for _ in range(M):
        p, s = input().split()
        p = int(p) -1
        if s == "AC":
            if isAc[p] == True:
                continue
            isAc[p] = True
            pes += was[p]
            acs+=1
        else:
            was[p] += 1
    print(" ".join([str(acs),str(pes)]))
main()


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

int main(){
  long N, D, X;
  long cho=0;
  cin >> N >> D >> X;
  for(int i=0; i<N; i++){
    int A; cin >> A;
    for(int j=1; j<=D; j+=A){
      cho++;
    }
  }
  cout << cho+X << endl;
  return 0;
}

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

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

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

map<string,int> cntid;
int cntnum=0;
int cntidx[100];
vector<P> poly[100];
vector<int> g[10];
int col[10];
int colcnt[10];
int res=100;

P operator-(const P& a,const P& b){ return P(a.fi-b.fi,a.se-b.se); }
ll cross(P a,P b){ return a.fi*b.se - a.se*b.fi; }
double norm(P a){ return (double)sqrt((double)a.fi*a.fi + (double)a.se*a.se); }
bool intersectSP(P p1,P p2,P q){
  if(p1==q||p2==q)return false;
  return norm(p1-q)+norm(p2-q)-norm(p2-p1)<1e-9;
}
bool intersectSS(P p1,P p2,P q1,P q2){
  if(cross(p2-p1,q2-q1)!=0)return false;
  if(min(p1,p2)==min(q1,q2)&&max(p1,p2)==max(q1,q2))return true;
  return intersectSP(p1,p2,q1)||intersectSP(p1,p2,q2)||intersectSP(q1,q2,p1)||intersectSP(q1,q2,p2);
}

int getid(string s){
  if(cntid.find(s)!=cntid.end())return cntid[s];
  cntid[s]=cntnum++;
  return cntid[s];
}

void dfs(int v,int crtres){
  if(v==cntnum){
    minch(res,crtres);
    return ;
  }
  if(crtres>=res)return ;
  vector<bool> used(10,false);
  for(int nv : g[v])if(col[nv]!=-1)used[col[nv]]=true;
  rep(i,10){
    if(used[i])continue;
    col[v]=i;
    colcnt[i]++;
    dfs(v+1,crtres+(colcnt[i]==1?1:0));
    colcnt[i]--;
  }
  return ;
}

int main(){
  while(1){
    int N;
    cin>>N;
    if(N==0)break;
    cntid.clear(); cntnum=0;
    rep(i,10)g[i].clear();
    rep(i,N){
      string name;
      cin>>name;
      int crtid=getid(name);
      cntidx[i]=crtid;
      poly[i].clear();
      int x,y;
      while(1){
        cin>>x;
        if(x==-1)break;
        cin>>y;
        poly[i].push_back(P(x,y));
      }
    }
    rep(i,N)rep(j,i){
      bool crossed=false;
      rep(l1,poly[i].size())rep(l2,poly[j].size()){
        if(intersectSS(poly[i][l1],poly[i][(l1+1)%poly[i].size()],poly[j][l2],poly[j][(l2+1)%poly[j].size()]))crossed=true;
      }
      if(crossed&&cntidx[i]!=cntidx[j]&&!exist(g[cntidx[i]],cntidx[j])){
        g[cntidx[i]].push_back(cntidx[j]);
        g[cntidx[j]].push_back(cntidx[i]);
      }
    }
    memset(colcnt,0,sizeof(colcnt)); memset(col,-1,sizeof(col)); res=100;
    dfs(0,0);
    cout<<res<<endl;
  }
  return 0;
}



Measured memory_bytes: 3256
#include <cstdio>
#include <cstring>
#include <cmath>
#define ll long long
using namespace std;

const ll MOD = 1e9 + 7;
const int N = 5e4 + 10;
ll S[110][N], B[110][N];

inline int read() {
	int x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar(); }
	return x * f;
}

int main() {
	int n = read(), k = read();
	int r = sqrt(n) + 1;
	S[0][1] = 1;
	for (int i = 0; i < k; i++) {
		for (int j = 1; j < r; j++) S[i][j] = (S[i][j] + S[i][j - 1]) % MOD;
		for (int j = r - 2; j > 0; j--) B[i][j] = (B[i][j] + B[i][j + 1]) % MOD;
		for (int j = 1; j < r; j++) {
			B[i + 1][j] = S[i][j] * (n / j - n / (j + 1));
			if (j == n / j) B[i + 1][j] = 0;
			B[i + 1][j] %= MOD;
		}
		for (int j = 1; j < r; j++) {
			S[i + 1][j] = B[i][j] + S[i][r - 1];
			S[i + 1][j] %= MOD;
		}
	}
	ll ans = 0;
	for (int i = 1; i <= r; i++) ans = (ans + B[k][i] + S[k][i]) % MOD;
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 83456
#include<bits/stdc++.h>
using namespace std;
main(void){
    int n, a, b,sum=0;
    cin>>n>>a>>b;
    for(int i=1;i<=n;i++){
            int t=i,s=0;
        while(t!=0){
            int t2=t%10;
            s+=t2;
            t/=10;
        }
        if(a<=s && b>=s){
            sum+=i;
        }
    }
    cout<<sum;
}


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

using namespace std;
typedef long long ll;
//#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i =0;i<n;++i)
#define mod (ll)(1000000007)

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    ll ans = 0;
    ll abc[6] = {0,0,0,0,0,0};//{A,?,AB,A?,?B,??}
    ll q = 0;
    ll q3[4] = {1,1,1,1}; //?の使用数が0,1,2,3
    for(int i=0;i<S.length();i++){
        if(S[i]=='?'){
            q++;
            if(q>3){
                REP(j,4){
                    q3[j]*=3;
                    if(q3[j]>=mod)q3[j]%=mod;
                }
                //cout << q3 << endl;
            }else if(q==3){
                REP(j,3) q3[j]*=3;
            }else if(q==2){
                REP(j,2) q3[j]*=3;
            }else if(q==1){
                q3[0]=3;
            }
        }
    }
    //cout << q3 << endl;
    for(int i=0;i<S.length();i++){
        if(S[i]=='A'){
            abc[0] += 1;
        }else if(S[i]=='B'){
            abc[2] += abc[0];
            if(abc[2]>=mod)abc[2] %= mod;
            abc[4] += abc[1];
            if(abc[4]>=mod)abc[4] %= mod;
        }else if(S[i]=='C'){
            ll tmp = 0;
            tmp += abc[2]*q3[0]+abc[3]*q3[1]+abc[4]*q3[1]+abc[5]*q3[2];
            if(tmp>=mod)tmp%=mod;
            /*
            if(q==0){
                tmp = abc[2];
            }else if(q==1){
                tmp = abc[2]*3+abc[3]+abc[4];
                if(tmp>=mod)tmp%=mod;
            }else{
                tmp = abc[2]*9+abc[3]*3+abc[4]*3+abc[5];
                if(tmp>=mod)tmp%=mod;
                tmp *= q3*3;
                if(tmp>=mod)tmp%=mod;
            }
            */
            ans += tmp;
            if(ans>=mod)ans %= mod;
        }else{
            ll tmp = 0;
            /*
            if(q==0){
                tmp = abc[2];
            }else if(q==1){
                tmp = abc[2]*3+abc[3]+abc[4];
                if(tmp>=mod)tmp%=mod;
            }else{
                tmp = abc[2]*9+abc[3]*3+abc[4]*3+abc[5];
                tmp *= q3;
                if(tmp>=mod)tmp%=mod;
            }
            */
            tmp += abc[2]*q3[1]+abc[3]*q3[2]+abc[4]*q3[2]+abc[5]*q3[3];
            ans += tmp;
            //cout << i << ":" << ans << endl;
            if(ans>=mod)ans %= mod;
            abc[3] += abc[0];
            if(abc[3]>=mod)abc[3] %= mod;
            abc[5] += abc[1];
            if(abc[5]>=mod)abc[5] %= mod;
            abc[1] += 1;                 
        }
    }
    cout << ans << endl;
    //cout << ans + mod*2 << endl;
    return 0;
}


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

#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long hoge = 0; (hoge) < (n); ++ (hoge)) cerr << #x << "[" << hoge << "]: " << x[hoge] << '\n'

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> Pll;
typedef vector<ll> vll;
const ll INF = LLONG_MAX/10;
const ll MOD = 1e9+7;

ll N;
vector<vll> G;
ll dp[100010][2];

void dfs(ll v,ll p){
  dp[v][0]=dp[v][1]=1;
  for(ll u:G[v])if(u!=p){
    dfs(u,v);
    dp[v][0] = (dp[v][0]*(dp[u][0]+dp[u][1])%MOD)%MOD;
    dp[v][1] = (dp[v][1]*dp[u][0])%MOD;
  }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>N;
  G.resize(N);
  for(ll i=0;i<N-1;i++){
    ll x,y;cin>>x>>y;x--;y--;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  dfs(0,-1);
  cout<<(dp[0][0]+dp[0][1])%MOD<<endl;
  return 0;
}


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

int main(void)
{
    int a, h, m, s;
    char    hoge = ':';
    
    cin >> a;
    cout << a / 3600 << hoge << (a % 3600) / 60 << hoge << (a % 3600 % 60) << endl;
}


Measured memory_bytes: 3100
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i == 0:
            count = 0
            while temp%i == 0:
                count += 1
                temp //= i
            arr.append([i, count])
    if temp != 1:
        arr.append([temp, 1])
    if arr == []:
        arr.append([n, 1])
    return arr

N = int(input())

ans = [str(N)+':']

for x,y in factorization(N):
    ans.extend([x]*y)

print(' '.join(map(str,ans)))


Measured memory_bytes: 5648
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b)  for(int i=(a),i##formax=(b);i< i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formin=(b);i>=i##formin;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max((x),(y))
#define mins(x,y) x=min((x),(y))
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define all(a) ((a).begin()),((a).end())
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define bit(n) (1LL<<(n))
typedef long long ll;
typedef __int128_t lll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>using P=pair<T,Y>;
template<class T,class Y>ostream& operator<<(ostream&o,P<T,Y>&p){return o<<"("<<p.fi<<","<<p.se<<")";}
template<class T>ostream& operator<<(ostream&o,V<T>&v){for(T&t:v)o<<t<<",";return o<<endl;}
template<class T>void uniq(V<T>&v){sort(all(v));v.erase(unique(all(v)), v.end());}

lll gcd(lll a,lll b,lll&x,lll&y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return(x%m+m)%m;}
ll modPow(lll a,lll n,ll m){lll p=1;for(;n;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return p;}
//V<ll>F,R;void setF(int n,int mod){F=R=V<ll>(++n);F[0]=1;FOR(i,1,n)F[i]=F[i-1]*i%mod;R[n-1]=modInv(F[n-1],mod);FORR(i,n-1,1)R[i-1]=R[i]*i%mod;}
//ll comb(int a,int b,int m){return a<b||b<0?0:F[a]*R[b]%m*R[a-b]%m;}

const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7; //998244353;
const int N = 10;
int n, a[N][N];
P<int, int> f(int a){
  P<int, int> r(a, a%10);
  while(r.fi>9) r.fi/=10;
  return r;
}

main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  FOR(i, 1, n+1){
    auto p = f(i);
    a[p.fi][p.se]++;
  }
  int ans = 0;
  FOR(i, 1, n+1){
    auto p = f(i);
    ans += a[p.se][p.fi];
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main(){
  double a,b,x;
  cin>>a>>b>>x;
  double c=2*x/a/b;
  if(c<=a)cout<<setprecision(10)<<180*atan(b/c)/M_PI<<endl;
  else cout<<setprecision(10)<<180*atan((2*b-2*x/a/a)/a)/M_PI<<endl;
}

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

int main() {
  int A,B,C=0;
  cin>>A>>B;

  for(int i=A;i<B+1;i++){
    if(i/10000==i%10 && (i/1000)%10==(i/10)%10){
      C+=1;
    }
  }
  cout<<C<<endl;
}

Measured memory_bytes: 256
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;

const ll INF = 1LL << 32;

int main() {
  ll n, K;
  cin >> n >> K;
  vll xs(n);
  vll ys(n);

  for (ll i = 0; i < n; i++) {
    cin >> xs[i] >> ys[i];
  }

  ll ans = LONG_LONG_MAX;
  for (ll i = 0; i < n; i++) {
    for (ll j = 0; j < n; j++) {
      for (ll k = 0; k < n; k++) {
        for (ll l = 0; l < n; l++) {
          bool cond = xs[i] < xs[j] && ys[k] < ys[l];
          if (!cond) continue;
          ll num = 0;
          for (ll t = 0; t < n; t++) {
            bool inside = xs[i] <= xs[t] && xs[j] >= xs[t] && ys[k] <= ys[t] &&
                          ys[l] >= ys[t];
            if(inside){
              num++;
            }
          }  // t
          if(num >= K) {
            ll tmp = (xs[j] - xs[i])*(ys[l] - ys[k]);
            chmin(ans, tmp);
          }
        } // l
      } //k
    } //j
  } //i

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
n = int(input())
l = list()
for i in range(n):
    l.append(input())
if len(l) != len(set(l)):
    print("No")
    exit()
for i in range(n-1):
    if l[i][-1] != l[i+1][0]:
        print("No")
        exit()
print("Yes")

Measured memory_bytes: 3060
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010


int main(){
  int t, x;

  scanf("%d%d", &t, &x);

  printf("%.10lf\n", (double)t / x);

  return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int age = scan.nextInt();
    int price = scan.nextInt();
    if (6 <= age && age <= 12) {
      System.out.println(price/2);
    }
    else if (age < 6) {
      System.out.println("0");
    }
    else {
      System.out.println(price);
    }
  }
}

Measured memory_bytes: 23636
#include <cstdio>

int main()
{
  int n;
  scanf("%d", &n);
  int v[20];
  int c;
  int ans = 0;
  for (int i = 0; i < n; ++i)
  {
    scanf("%d", v + i);
  }
  for (int i = 0; i < n; ++i)
  {
    scanf("%d", &c);
    if (v[i] - c >= 0)
    {
      ans += v[i] - c;
    }
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define dup(x,y) (((x)+(y)-1)/(y))
#define v(T) vector<T>
#define vv(T) v(v(T))
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<pii> vp;
typedef vector<T> vt;
inline int getInt() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MX = 200005;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
//---------------------------------------------------------------
#define fastio cin.tie(nullptr); std::ios::sync_with_stdio(false);
#define myio ifstream iofi; if(argc>1){iofi.open(argv[1]); std::cin.rdbuf(iofi.rdbuf());}
//--------------------------------------------------------------
// [gcd]
template<class T> T gcd(T a,T b)
{if (a < b) swap(a,b);return b ? gcd(b, a % b) : a;}
template<class T> T lcm(const T a, const T b)
{return (a * b / gcd(a, b));}
void Main(){
  int n;
  cin>>n;
  vl a(n);
  cin>>a;
  vl L(n);
  vl R(n);
  vl M(n);
  L[0] = a[0];
  rep(i,n-1){
    L[i+1] = gcd(L[i],a[i+1]);
  }
  R[n-1] = a[n-1];
  drep(i,n-1){
    R[i] = gcd(R[i+1],a[i]);
  }
  M[0  ] = R[1  ];
  M[n-1] = L[n-2];
  srep(i,1,n-1){
    M[i] = gcd(L[i-1],R[i+1]);
  }
  cout<<*max_element(rng(M))<<endl;
} int main(int argc,char** argv)
{fastio; myio; Main();}


Measured memory_bytes: 3456
#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<stack>
#include<map>
#include<list>
#include<string>
#include<algorithm>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back

#define ll __int64
#define P pair<ll,ll>
#define __int64 long long
ll M=1000000007;

ll n;
map<P,ll>dp;

ll dfs(ll a,ll b){
	if(dp[mp(a,b)])return dp[mp(a,b)]%M;
	
	if(a==0&&b==0)return 1;	
	

	ll ret=0;
	ret=(ret+(dfs(a/2,b/2)))%M;
	if(a>=1&&b>=1)ret=(ret+(dfs((a-1)/2,(b-1)/2)))%M;
	if(a>=2)ret=(ret+(dfs((a-2)/2,b/2)))%M;

	return dp[mp(a,b)]=ret%M;
}


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


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

int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if ((abs(a-c) <= d)||(abs(a-b) <= d && abs(b-c) <= d))
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
    return 0;
}


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

int a, b, c, k;

int main(){
	scanf("%d%d%d%d", &a, &b, &c, &k);
	int x = 0, tmp = a / b;
	while(tmp) x++, tmp >>= 1;
	b = b * (1 << x);
	tmp = b / c;
	while(tmp) x++, tmp >>= 1;
	puts(x <= k ? "Yes" : "No");
	return 0;
}

Measured memory_bytes: 1664
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        k: usize,
        s: usize
    }

    //test
    //
    /*
    let k: usize = 2;
    let s: usize = 2;
    */

    let mut ans: usize = 0;

    for x in 0..k + 1 {
        if x > s {
            break;
        }

        if (x + k * 2) < s {
            continue;
        }

        let mut max: usize = k;
        let mut min: usize = 0;

        if (s - x) < k {
            max = s - x;
        }

        if (x + k) < s {
            min = s - x - k;
        }

        ans = ans + (max - min) + 1;
    }

    //assert_eq!(ans, 6);
    println!("{}", ans);
}


Measured memory_bytes: 4352
import sys
def input(): return sys.stdin.readline().strip()
mod = 998244353


def main():

    """
    各トークンを(最下点、最終的な高さ)に分けるのはできた。
    そしてそれらを最下点位置が浅い順に並べるのも悪くはなかった、増加パートに関しては。

    減少パートは減少度合が小さい順に付け加えたとしても高さが負に潜り込むケースがある。
    （例）高さ3から下るとして、(-1, -1), (-2, 0), (-3, -2)が各トークンとすると
        この順にくっつけると(-3, -2)を加えるときにアウトだが、
        (-2, 0), (-3, -2), (-1, -1)の順だったらOK
    
    なので下る場合には増加パートとは違う方法でくっつけないといけない。
    結論としては、これは左右反転させれば増加していることになるので、右からくっつけるようにすればいい。
    """

    N = int(input())
    S_up = []
    S_down = []
    for _ in range(N):
        s = input()
        max_depth = 0
        height = 0
        for c in s:
            if c == '(':
                height += 1
            else:
                height -= 1
                max_depth = min(max_depth, height)
        if height > 0: S_up.append((max_depth, height - max_depth))
        else: S_down.append((-(height - max_depth), -max_depth))
    S_up.sort(key=lambda x: (x[0], x[1]))
    S_down.sort(key=lambda x: (x[0], x[1]))

    height_left = 0
    while S_up:
        d, h = S_up.pop()
        #print("({}, {})".format(d, h))
        if height_left + d < 0:
            print("No")
            return
        height_left += d+h

    height_right = 0
    while S_down:
        d, h = S_down.pop()
        #print("({}, {})".format(d, h))
        if height_right + d < 0:
            print("No")
            return
        height_right += d+h

    if height_left != height_right: print("No")
    else: print("Yes")





if __name__ == "__main__":
    main()


Measured memory_bytes: 175744
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, StdoutLock, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , bytes ) => { read_value ! ( $ next , String ) . into_bytes ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }
#[allow(dead_code)]
pub fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) {
    let out = stdout();
    let writer = BufWriter::new(out.lock());
    f(writer)
}
#[allow(unused_macros)]
macro_rules ! debug { ( $ ( $ a : expr ) ,* ) => { eprintln ! ( concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) } ; }
#[allow(dead_code)]
fn main() {
    input!{
        a: [usize; 3],
    }
    if a[0] % 2 == 0 || a[1] % 2 == 0 || a[2] % 2 == 0 {
        println!("{}", 0);
    } else {
        let mut x = a;
        x.sort();
        println!("{}", x[0] * x[1]);
    }
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i < (ll)(n); i++)
const ll mo = 1000000007;
const ll INF = 1 << 30;
double ans = 0;

int main()
{
ll n;
cin >> n;
ll t[n] = {};
ll v[n] = {};
double co[50010]={};
double ma[50010]={};
double mi[50010]={};
rep(i, n)
{
    cin >> t[i];
}
rep(i, n)
{
    cin >> v[i];
}
co[0]=0;
ll a=t[0],b=0;
rep1(i,50010){
    if(i<a*2)co[i]=v[b];
    else {
        b++;
        if(b>=n){co[i]=0;break;}
        else co[i]=min(v[b],v[b-1]);
        a+=t[b];
    }
}
rep1(i,50010){
    ma[i]=min(ma[i-1]+0.5,co[i]);
}
for (ll i = 50008; i >=0; i--){
    mi[i]=min(mi[i+1]+0.5,co[i]);
}
rep1(i,50009){
    //ans+=((double)min(ma[i],mi[i])+(double)min(ma[i-1],mi[i-1]))/2.0;
    ans+=(double)min(ma[i],mi[i]);
}

double answer=ans/2.0;

/* for (int i = 0; i <60; ++i) {
    cout << i<<" "<<co[i] << " "<<ma[i]<< " "<<mi[i]<< " "<<min(ma[i],mi[i])<< endl;
} */



cout << fixed <<  answer << endl;
return 0;
}

Measured memory_bytes: 1408
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#define mem(i,a) memset(i,a,sizeof(i))
#define PI acos(-1.0)
#define DMAX 100000+5
#define MOD 20190823
#define eps 1e-8
#define mp make_pair
#define INF 1000000000+9
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
inline void read(ll &f){
    f=0;
    ll x=1;
    char ch=getchar();
    while(ch<48 || ch>57) {
        if(ch=='-') {
            x=-1;
        }
        ch=getchar();
    }
    while(ch<=57 && ch>=48) {
        f=f*10+ch-'0';
        ch=getchar();
    }
    f*=x;
}
ll a,b,c;
int main(){
    read(a),read(b),read(c);
    c-=(a+b);
    if(c<=0){
        cout<<"No"<<endl;
        return 0;
    }
    if(4*a*b<c*c){
        cout<<"Yes"<<endl;
    }   
    else{
        cout<<"No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<unordered_map>
#include<iostream>
#include<algorithm>
#include<utility>
#include<climits>
#include<fstream>
#include<cstring>
#include<cstdlib>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<cmath>
#include<list>
#include<map>
#include<set>
#define inf 0x7f7f7f
#define p(x) (x)*(x)
using namespace std;

typedef vector<vector<int> > vtype;
typedef long long ll;
ll *a = nullptr;

int main()
{
	//ios::sync_with_stdio(false);
	ll n = 0, k = 0,sum = 0;
	cin >> n >> k; 
	a = new ll[n+5]{0};
	for(int i = 0; i < n; ++i)
		cin >> a[i];
	if(k < n){
		sort(a, a+n);
		for(int i = 0; i < n - k; ++i)
			sum += a[i];
	}
	cout << sum << endl;
	delete[] a;
	a = nullptr;
    return 0;
}















Measured memory_bytes: 1792
#include <stdio.h>

void getN(int *x){
    scanf("%d",x);
}
void getElement(int s[],int n){
    int i;
    for(i=0;i<n;i++)scanf("%d",&s[i]);
}

int main(){
    int n;
    getN(&n);
    int S[n];
    getElement(S,n);
    
    int q;
    getN(&q);
    int T[q];
    getElement(T,q);
    
    int i,j;
    int count=0;
    for(i=0;i<q;i++){
        for(j=0;j<n;j++){
            if(T[i]==S[j]){
                count++;
                break;
            }
        }
    }
    printf("%d\n",count);
}


Measured memory_bytes: 2044
a= input()
dict ={}
for num in range(int(a)):
    b= input().split()
    if b[0] in dict:
      dict[b[0]][int(b[1])]=num
    else:
      dict2={}
      dict2[int(b[1])]=num
      dict[b[0]] = dict2

dict = sorted(dict.items())
for i in dict:
  lits_i =i[1]
  dict2 = sorted(lits_i .items(), reverse=True)
  for j in dict2:
    print(j[1]+1)

Measured memory_bytes: 3064
#include"cstdio"
#include"algorithm"
using namespace std;
int main(){
	int Q,H,S,D;
	long long n;
	scanf("%d%d%d%d%lld",&Q,&H,&S,&D,&n);
	long long temp=0;
	int i=0;
	long long b[5];
	b[0]=Q*8,b[1]=H*4,b[2]=S*2,b[3]=D;
	sort(b,b+4);
//	printf("%d %d %d %d\n",b[0],b[1],b[2],b[3]);
	for(i=0;i<2;i++)
	{
		if((b[i]==(8*Q))&&(n>=1))
		{
			temp=temp+Q*n*4;
			n=n%1;
//			printf("Q\n");
		}
		if((b[i]==(4*H))&&(n>=1))
		{
			temp=temp+H*n*2;
			n=n%1;
//			printf("H\n");
		}
		if((b[i]==(2*S))&&(n>=1))
		{
			temp=temp+S*n;
			n=n%1;
//			printf("%lld\n",temp);
//			printf("S\n");
		}
		if((b[i]==D)&&(n>=2))
		{
			
			temp=temp+D*(n/2);
			n=n%2;
		}
		
		if(n==0)
			break;	
	}
	printf("%lld\n",temp);
	return 0;
}

Measured memory_bytes: 128
// Copyright 2019 yaito3014
#include "bits/stdc++.h"
using namespace std;
using namespace literals;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  string S;
  cin >> S;
  int N = S.length();
  vector<int64_t> sumL(N + 1, 0), sumR(N + 1, 0);
  for (int i = 0; i < N; ++i)
    if (S[i] == '<')sumL[i + 1] = sumL[i] + 1;
    else sumL[i + 1] = 0;
  for (int i = N - 1; i >= 0; --i)
    if (S[i] == '>')sumR[i] = sumR[i + 1] + 1;
    else sumR[i] = 0;
  int64_t sum = 0;
  for (int i = 0; i <= N; ++i)
    sum += max(sumL[i], sumR[i]);
  cout << sum << endl;
}


Measured memory_bytes: 8732
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		System.out.println(
				Arrays.stream(scanner.nextLine().split(" ")).sorted().collect(Collectors.toList()).equals(Arrays.asList("5", "5", "7")) ?
					"YES" : "NO");
	}
}

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

int main(void){
	int W,H,x,y,r;
	cin >> W >> H >> x >> y >> r;
	
	if( y - r >= 0 && y + r <= H && x - r >= 0 && x + r <= W )cout << "Yes\n";
	else cout << "No\n";
	return 0;

}


Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <queue>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define int long long
#define INF 1e9 + 7
#define cae cout << ans << endl;
#define cye cout << "Yes" << endl;
#define cne cout << "No" << endl;
#define r0 return 0;
using namespace std;
typedef pair<int,int>P;
typedef long long ll;
signed main() {
    int x;
    int a = 0, b = 0;
    cin >> x;
    a = x / 500;
    x = x - (a * 500);
    b = x / 5;
    cout << (a * 1000) + (b * 5) << endl;
    r0
}


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

#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T>
T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); }
template <typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;

namespace Problem {
using namespace std;

class Helper {
 public:
  int n, m;
  vector<vector<int>> a;
  Helper(LL n, LL m) : n(n), m(m), a(n, vector<int>(m)){};

  void solve() {
    int N = (1 << n) - 1;
    int M = (1 << m) - 1;
    int ma = 0;
    vector<vector<int>> ans;
    a = vector<vector<int>>(N, vector<int>(M));
    vector<vector<int>> b(N + 1, vector<int>(M + 1));
    DBG(N, M)
    for (LL mask = 0; mask < (1ll << (N * M)); ++mask) {
      for (int i = 0; i < N; ++i) {
        for (int j = 0; j < M; ++j) {
          int p = i * M + j;
          a[i][j] = (mask >> p) & 1;
          b[i + 1][j + 1] = a[i][j];
        }
      }
      for (int i = 1; i <= N; ++i) {
        for (int j = 1; j <= M; ++j) {
          b[i][j] += b[i - 1][j];
        }
      }

      for (int i = 1; i <= N; ++i) {
        for (int j = 1; j <= M; ++j) {
          b[i][j] += b[i][j - 1];
        }
      }
      int cnt = 0;
      for (int i1 = 1; i1 <= N; ++i1) {
        for (int i2 = i1; i2 <= N; ++i2) {
          for (int j1 = 1; j1 <= M; ++j1) {
            for (int j2 = j1; j2 <= M; ++j2) {
              int sum = b[i2][j2] - b[i1 - 1][j2] - b[i2][j1 - 1] + b[i1 - 1][j1 - 1];
              cnt += sum % 2;
            }
          }
        }
      }
      //DBG(a, cnt)
      if (cnt > ma) {
        ans = a;
        ma = cnt;
      }
    }
    DBG(ans)
    DBG(ma)
  }
};
class Solver2 {
 public:
  int n, m;
  Solver2(LL n, LL m) : n(n), m(m){};

  void solve() {
    int N = (1 << n) - 1;
    int M = (1 << m) - 1;
    auto a = vector<vector<int>>(N, vector<int>(M));
    DBG(N, M)
    for (int i = 0; i < N; ++i) {
      for (int j = 0; j < M; ++j) {
        int cntn = 0;
        int cntm = 0;
        int ti = i + 1, tj = j + 1;
        while (ti % 2 == 0) {
          cntn++;
          ti /= 2;
        }
        while (tj % 2 == 0) {
          cntm++;
          tj /= 2;
        }
        if (cntn >= cntm)
          a[i][j] = 1;
      }
    }
    for (int i = 0; i < N; ++i) {
      for (int j = 0; j < M; ++j) {
        cout << a[i][j];
      }
      cout << endl;
    }
  }
};
}  // namespace Problem

int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  // std::cout << std::fixed << std::setprecision(12);
  long long n = 0, m;
  std::cin >> n >> m;

  Problem::Solver2 sol(n, m);
  sol.solve();
  return 0;
}


Measured memory_bytes: 5376
def mul(A, B, N, M):
    result = [[0]*N for i in range(N)]
    for i in range(N):
        for j in range(N):
            tmp = 0
            for k in range(N):
                tmp += A[i][k] * B[k][j]
                tmp %= M
            result[i][j] = tmp
    return result

while 1:
    N, M, A, B, C, T = map(int, input().split())
    if N == 0:
        break
    *S, = map(int, input().split())
    P = [[0]*N for i in range(N)]
    for i in range(N):
        P[i][i] = B
    for i in range(N-1):
        P[i+1][i] = A
        P[i][i+1] = C
    base = [[0]*N for i in range(N)]
    for i in range(N):
        base[i][i] = 1
    while T:
        if T & 1:
            base = mul(base, P, N, M)
        P = mul(P, P, N, M)
        T >>= 1
    U = [0]*N
    for i in range(N):
        tmp = 0
        for j in range(N):
            tmp += base[i][j] * S[j]
            tmp %= M
        U[i] = tmp
    print(*U)

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

int main() {
	int A, B, K;
	cin >> A >> B;
	if ((A + B) % 2 == 0){
		K = (A + B) / 2;
		cout << K << endl;
	}
	else {
		printf("IMPOSSIBLE");
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
#define REP(i, b) for(int i = 0; i < (b); i++)
#define REPS(i, b) for(int i = 1; i <= (b); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<double>;
using vs = vector<string>;
using vb = vector<bool>;
using vp = vector<P>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vvb = vector<vb>;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll  INFL = 1e18;

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;
}

signed main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    int N, K; cin >> N >> K;
    vi h(N); REP(i, N) cin >> h[i];
    vi dp(N, INF);
    dp[0] = 0;
    REP(i, N)
    {
        for(int k = 1; k <= K && i+k < N; k++)
            chmin<int>(dp[i+k], dp[i]+abs(h[i]-h[i+k]));
    }
    cout << dp[N-1] << endl;
}

Measured memory_bytes: 1024
// template version 1.12
using namespace std;
#include <iostream>
#include <bits/stdc++.h>

// varibable settings
#define infile "../test/sample-1.in"
#define int long long //{{{
const int INF=1e18;
const int MOD=1e9+7; //}}}

// define basic macro {{{
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ub upper_bound
#define lb lower_bound
#define posl(A, x) (lower_bound(all(A), x)-A.begin())
#define posu(A, x) (upper_bound(all(A),x)-A.begin())
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

#if defined(PCM) || defined(LOCAL)
  #include "lib/dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
#endif
//}}}

int solve(){
  string s,t;cin>>s>>t;
  int ans =0;
  rep(i, 3){
    if (s[i]==t[i]) ans++;
  }
  cout << ans << endl;
  return 0;
}

signed main() { //{{{
#ifdef INPUT_FROM_FILE
  std::ifstream in(infile);
  std::cin.rdbuf(in.rdbuf());
#endif
  solve();
  return 0;
} //}}}


Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};

#[allow(unused_imports)]
use std::io::Write;

fn main() {
    input!{
      n: usize,
      mut ds: [usize; n],
    }
    ds.sort();
    let l = ds[ n/2 - 1 ];
    let r = ds[ n/2 ];
    let ans = r - l;
    println!("{}", ans);
}


Measured memory_bytes: 4352