akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
typedef long long ll;
typedef unsigned un;
typedef std::string str;
typedef std::pair<ll,ll> pll;
ll read(){ll x=0,f=1;char c=getchar();while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}return f*x;}
ll max(ll a,ll b){return a>b?a:b;}
ll min(ll a,ll b){return a<b?a:b;}
void umax(ll& a,ll t){if(t>a)a=t;}
void umin(ll& a,ll t){if(t<a)a=t;}
const ll INF=1ll<<50;
#define MAXN 200011
struct edge
{
    ll v,nxt;
}e[MAXN<<1|1];
ll cnt=1,last[MAXN];
void adde(ll u,ll v)
{
    e[++cnt].v=v;
    e[cnt].nxt=last[u],last[u]=cnt;
}
ll f[MAXN],ans=0,cut=0;
bool ring[MAXN];
void dfs1(ll u,ll now_dep,ll fa)
{
    f[u]=(now_dep&1?1:-1);
    for(ll i=last[u];i;i=e[i].nxt)
    {
        ll v=e[i].v;
        //printf("u=%lld,v=%lld,i=%lld,cut=%lld\n",u,v,i,cut^1);
        if(v==fa||i==cut||i==(cut^1))continue;
        //puts("Enter");
        dfs1(v,now_dep+1,u);
        f[u]+=f[v];
    }
    ans+=abs(f[u]);
}
ll dfn[MAXN],tim=0,s[MAXN],top=0,a[MAXN],cnt_ring=0;
void dfs2(ll u,ll fa=0)
{
    dfn[u]=++tim;s[++top]=u;
    for(ll i=last[u];i;i=e[i].nxt)
    {
        ll v=e[i].v;
        if(v==fa)continue;
        if(!dfn[v])dfs2(v,u);
        else
        {
            cut=i;
            while(s[top]!=v)ring[s[top--]]=1;
            ring[v]=1;
        }
        if(cut)return;
    }
    --top;
}
bool cmp(ll x,ll y){return f[x]<f[y];}
int main()
{
    ll n=read(),m=read();
    for(ll i=1;i<=m;++i)
    {
        ll u=read(),v=read();
        adde(u,v),adde(v,u);
    }
    if(m==n-1)
    {
        dfs1(1,1,0);
        //for(ll i=1;i<=n;++i)printf("f[%lld]=%lld\n",i,f[i]);
        printf("%lld",f[1]?-1ll:ans);
        return 0;
    }
    else
    {
        dfs2(1);
        ll rt=e[cut].v;
        dfs1(rt,1,0);
        for(ll i=1;i<=n;++i)
            if(ring[i])a[++cnt_ring]=i;
        if(cnt_ring&1)
        {
            if(f[rt]&1)return puts("-1"),0;
            ll d=f[rt]/2;
            ans=abs(d);
            for(ll i=1;i<=cnt_ring;++i)f[a[i]]-=d;
            f[rt]-=d;
            for(ll i=1;i<=n;++i)ans+=abs(f[i]);
            printf("%lld",ans);
        }
        else
        {
            if(f[rt])return puts("-1"),0;
            std::sort(a+1,a+cnt_ring+1,cmp);
            ll mid=f[a[cnt_ring>>1]],ans=0;
            for(ll i=1;i<=cnt_ring;++i)
                ans+=abs(f[a[i]]-mid);
            for(ll i=1;i<=n;++i)
                if(!ring[i])ans+=abs(f[i]);
            printf("%lld",ans);
        }
    }
    return 0;
}

Measured memory_bytes: 18496
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n,i,ans=0;
    cin>>n;
    ll b[n-1];
    for(i=0;i<n-1;i++){
    	cin>>b[i];
	}
	ans+=b[0];
	ans+=b[n-2];
	if((n-1)>=2){
		for(i=0;i<n-2;i++){
			ans+=min(b[i],b[i+1]);
		}
	}
	cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
    WRITER:kakitamasziru/OxOmisosiru
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG //FOR THE DEBUG! COMMENT OUT THIS WHEN SUBMITTING!
#endif
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include <limits>//setprecision
//#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
//#include <unordered_map> // unordered_map
//#include <unordered_set> // unordered_set
#include <bitset> // bitset
//#include <cctype> // isupper, islower, isdigit, toupper, tolower
//It is so troublesome that I include bits/stdc++.h !
using namespace std;

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; }
const long long INF = 100100100100;
const int MOD = 1000000007;
typedef pair<int,int> P;
//NのM乗を求める(繰り返し二乗法)
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //最下位ビット(*N)が1の時は単独でNをかける
    if (M & 1) res = (res * N) % MOD;

    return res %= MOD;
}
long long nCr(long long n, long long r) {
    long long A = 1, B = 1;
    //Aが分子Bが1/r!
    for (long long i = n - r + 1; i <= n; i++) {
        A = A * i % MOD;
    }
    for (long long i = 1; i <= r; i++) {
        B = B * i % MOD;
    }
    B = mod_pow(B, MOD - 2);
    B %= MOD;
    //Bは割るのではなく掛ける
    return (A * B) % MOD;
}

long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}
 
long long lcm(long long a, long long b) {
    return a * b / gcd(a, b);
}

long long A,B;

bool ok(long long key,long long index){
    string S = to_string(index);
    long long nagasa = S.size();
    if(index*A+nagasa*B > key) return true;
    else if(index*A+nagasa*B <= key) return false;
}

long long binary_search(long long key,long long size){
    //left,right,midはいずれもindex
    long long left = -1,right = size;
    while(right - left > 1){
        long long mid = left + (right-left)/2;
        long long hantei = ok(key,mid);
        if(hantei) right = mid;
        else left = mid;
    }
    if(left == -1)return 0;
    return left;
}

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

    // PLEASE GIVE ME THE "ACCEPTED" !
}

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

int main() {
  int A, B;
  cin >> A >> B;
  if(A>=13) {
    cout << B << endl;
  }
  else if(A<=5) {
    cout << "0" << endl;
  }
  else {
    cout << B/2 << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
using Ml = map<ll, ll>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;

int main() {
  ll a;
  double b;
  cin >> a >> b;
  ll b100 = round(b*100);
  cout << a * b100 / 100 << endl;

  return 0;
}


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

using namespace std;

int n,vis['z'+100];
char s[100];
priority_queue<char> pq;

int main(){
	scanf("%s",s+1); n=strlen(s+1);
	for (int i=1;i<=n;++i)
		vis[s[i]]=1;
	for (char i='a';i<='z';++i)
		if (!vis[i]) pq.push(i);
	if (n==26){
		for (int i=n;i;--i){
			if (!pq.empty()&&pq.top()>s[i]){
				char t=s[i];
				for (;!pq.empty()&&pq.top()>t;pq.pop()) s[i]=pq.top();
				for (int j=1;j<=i;++j) putchar(s[j]);
				puts("");
				return 0;
			}
			pq.push(s[i]);
		}
		puts("-1");
	}
	else{
		++n;
		for (;!pq.empty();pq.pop()) s[n]=pq.top();
		for (int i=1;i<=n;++i)
			putchar(s[i]);
		puts("");
	}
	
	return 0;
}
			

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



int main() {
    int n, m;
    cin >> n >> m;
    
    vector<int> ac(n+1), wa(n+1);
    
    rep(i,m) {
        int p;
        string s;
        cin >> p >> s;
        
        if(ac[p] == 0 && s == "AC") {
            ac[p]++;
        }
        
        if(ac[p] == 0 && s == "WA") {
            wa[p]++;
        }
    }
    
    int co, pe;
    co = pe = 0;
    for(int i = 1; i <= n; i++) {
        co += ac[i];
        if(ac[i] > 0)
            pe += wa[i];
    }
    
    cout << co << " " << pe << endl;
    
    
    return 0;
}




Measured memory_bytes: 3992
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
 
int main(){
    int N,M;cin>>N>>M;
    vector<long long>X(M);
    for(int i=0;i<M;i++)cin>>X[i];
    sort(X.begin(),X.end());
    vector<long long>diffs;
    for(int i=1;i<X.size();i++)diffs.push_back(X[i]-X[i-1]);
    sort(diffs.begin(),diffs.end(),greater<long long>());

    long long res=X.back()-X[0];
    for(int i=0;i<min((int)diffs.size(),N-1);i++)res-=diffs[i];
    cout<<res<<endl;
}

Measured memory_bytes: 2168
# coding: utf-8
# Your code here!
N,M,Q=map(int,input().split())

q=[]
for _ in range(Q):
    a,b,c,d=map(int,input().split())
    q.append([a,b,c,d])

ans=[]
def saiki(num,lis):
    if num==N:
        temp=0
        for a,b,c,d in q:
            if lis[b-1]-lis[a-1]==c:
                temp+=d
        ans.append(temp)
    else:
        for i in range(lis[-1],M+1):
            saiki(num+1,lis+[i])
saiki(0,[1])

print(max(ans))
    

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

using namespace std;

long long  a[105];
int  main(){
    long long  n,m;
    cin>>n>>m;
    long long  tot  = 0;
    for(int i = 1;i<=n;i++){
    	cin>>a[i];
        tot+=a[i];
        a[i] = a[i] * 4 *m;
	}
	long long   num =0;
	long long   res = tot;
	for(int i=1;i<=n;i++){
		if(a[i] >= res) num++; 
	}
	
	if(num >= m) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
} 

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

namespace Algorithm
{
    class Program
    {
        static string s;
        static void Main(string[] args)
        {
            s = Console.ReadLine();
            var ans = Dfs(0, "");
            Console.WriteLine(ans);
        }

        static long Dfs(int n, string siki)
        {
            if (n == s.Length)
            {
                var ans = siki.Split('+').Select(long.Parse).ToArray();
                siki = "";
                return ans.Sum();
            }

            var ans1 = Dfs(n + 1, siki + s[n].ToString());

            var ans2 = 0L;
            if (n != s.Length - 1)
                ans2 = Dfs(n + 1, siki + s[n] + "+");

            return ans1 + ans2;
        }
    }
}


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

int main(){
	int N,W;
	cin>>N>>W;

	int v[1000],w[1000];
	for(int i=0;i<N;i++)
		cin>>v[i]>>w[i];

	int DP[101][10001];
	for(int i=0;i<=N;i++)
		DP[i][0]=0;
	for(int j=0;j<=W;j++)
		DP[0][j]=0;

	for(int i=1;i<=N;i++){
		for(int j=0;j<=W;j++){
			if(j<w[i-1])
				DP[i][j]=DP[i-1][j];
			else{
				if(DP[i-1][j]>DP[i-1][j-w[i-1]]+v[i-1])
					DP[i][j]=DP[i-1][j];
				else
					DP[i][j]=DP[i-1][j-w[i-1]]+v[i-1];
			}
		}
	}
	
	cout<<DP[N][W]<<endl;
	
	return 0;
}

	

Measured memory_bytes: 7016
import java.io.*;
import java.io.ObjectInputStream.*;
import java.util.*;
import java.util.regex.*;


public class Main {

	final static long MOD = (long)1e9+7;
	//final static long MOD = 998244353;

	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static long cnt=0;
	public static PrintWriter pw = new PrintWriter(System.out);
	public static void main(String[] args) throws Exception {
		slove(args);
		if(in!=null){
			in.close();
		}
		pw.flush();
		pw.close();
	}

	public static void slove(String[] args) throws Exception{
		long N = nextLong();

		long ans=0;
		for(long r=1;r*r<=N;r++) {
			if((N-r)%r==0 && (N-r)/r > r) {
				ans+=(N-r)/r;
			}
		}

		pw.println(ans);
	}


public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}



Measured memory_bytes: 25732
a,b=map(int,input().split())
s=0
for i in range(a,b+1):
    x=list(str(i))
    y=[]
    for k in range(len(x)):
        y.append(x[-1-k])
    z=""
    for j in y:
        z+=j
    if i==int(z):
        s+=1
print(s)

Measured memory_bytes: 3060
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Set<Integer> set = new HashSet<>();
		for (int i = 0; i < 3; i++) {
			set.add(sc.nextInt());
		}
		if (set.size() == 2) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}




Measured memory_bytes: 22740
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, k = map(int, readline().split())
ab = [list(map(int, readline().split())) for _ in range(n)]
ab.sort()
for a, b in ab:
    if b >= k:
        print(a)
        exit()
    k -= b


Measured memory_bytes: 27844
#解説方針
#標準入力
n, m = map(int, input().split())
#逆元
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

def pmt(n, r, p):
    if (r < 0) or (n < r):
        return 0
    #r = min(r, n - r)
    return fact[n] * factinv[n - r] % p
  
p = 10 ** 9 + 7
N = m + 1
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用
 
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

#print(pmt(3, 2, p))
#(-1)**K * (NCK) * (MPK) * (M-KPN-K)**2をKについて足し合わせる
ans = 0
for i in range(n + 1):
  a = (-1) ** i
  b = cmb(n, i, p)
  c = pmt(m, i, p)
  d = pmt(m - i, n - i, p)
  #print(a, b, c, d)
  ans += (a * b * c * (d ** 2)) % p
  
print(ans % p)

  
  
  




Measured memory_bytes: 189196
// H - Grid 1
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007

int dp[1001];
char a[1001];

int main(){
	int H,W; cin>>H>>W;
	dp[1] = 1;
	while(H--){
		scanf("%s",a);
		for(int w=1; w<=W; w++) dp[w] = a[w-1]=='.'? (dp[w] + dp[w-1]) % MOD: 0;
	}
	printf("%d\n",dp[W]);
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <numeric>
#include <string.h>
#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define repn(i, x) for (int i = 1; i <= (int)(x); i++)
#define repr(i, x) for (int i = ((int)(x) - 1); i >= 0; i--)
#define reprn(i, x) for (int i = ((int)(x)); i > 0; i--)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long int64;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long  INFL = 1e18;
const int MOD = 1000000007;
class UnionFind {
public:
	vector<int> Parent;

	UnionFind(int N) {
		Parent = vector<int>(N, -1);
	}

	int root(int A) {
		if (Parent[A] < 0) return A;
		return Parent[A] = root(Parent[A]);
	}

	int size(int A) {
		return -Parent[root(A)];
	}

	bool connect(int A, int B) {
		A = root(A);
		B = root(B);
		if (A == B) {
			return false;
		}
		if (size(A) < size(B)) swap(A, B);

		Parent[A] += Parent[B];
		Parent[B] = A;

		return true;
	}
};
void solve() {
	int N, M;
	cin >> N >> M;
	vector<int> A(M), B(M);
	for (int i = 0; i < M; ++i) {
		cin >> A[i] >> B[i];
		A[i]--;
		B[i]--;
	}
	vector<int64> ans(M);
	ans[M - 1] = (int64)N * (N - 1) / 2;

	UnionFind Uni(N);
	
	for (int i = M - 1; i >= 1; --i) {
		ans[i - 1] = ans[i];

		if (Uni.root(A[i]) != Uni.root(B[i])) {
			ans[i - 1] -= (int64)Uni.size(A[i]) * Uni.size(B[i]);
			Uni.connect(A[i], B[i]);
		}
	}

	for(int i = 0; i < M; ++i) {
		cout << ans[i] << endl;
	}
	return;
}

int main() {
	solve();
  return 0;
}

Measured memory_bytes: 3328
#include <iostream>
#include <iomanip>
#include <math.h>
#include <algorithm>
#include <functional>
#include <stdio.h>
#include <vector>
#include <string>
#include <map>
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
//#define rep(i, n) for(int (i) = 0, TmP = (n); (i) < (int)TmP ; ++(i))
//#define int long long
#define asort(v, n) sort((v), (v + n)) //Using array
#define vsort(v) sort((v).begin(), (v).end()) // Using vector
#define vint vector<int>

using namespace std;

signed main(){
  double n, pi = 3.14159265358979323846264338327; 
  cin >> n;
  cout << 2 * pi * n << endl;
}



Measured memory_bytes: 3688
N, M = map(int, input().split())

Map = [[] for _ in range(N)]
reached = [False]*N

for _ in range(M):
    aa, bb = map(int, input().split())
    Map[aa-1].append(bb-1)
    Map[bb-1].append(aa-1)

cnt = 0

def DFS(x):
    global cnt
    global reached

    reached[x] = True

    if all(reached):
        cnt += 1
        reached[x] = False

        return

    for i in Map[x]:
        if reached[i]:
            continue

        else:
            DFS(i)

    reached[x] = False


DFS(0)
print(cnt)


Measured memory_bytes: 3064
#include<iostream>
#include <string> 
#include <vector>  
#include<math.h>
#include <algorithm>
#define INF 1000000000
#define LM 55555
using namespace::std;


long long A[200000], B[200000], D[200000], bc, now, C, H, W, X, Y, N,M, ans, r,l;



int main() {
	cin >>N;
	ans = -1;
	vector<long long>p;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		A[i] = A[i] - i - 1;
		D[i] = 0;
		B[i] = 0;
	}
	sort(A, A+N);
	H = 0;
	D[0] = A[0];
	for (int i = 0; i < N; i++) {
		if (A[i] != A[i - 1] && i != 0) {
			H++;
			D[H] = A[i];
		}
		B[H]++;
	}

	
	ans = 2000000000;
	M = 0;
	l = 0;
	r = N;
	for (int i = A[0]; i <= A[N - 1]; i++) {
		if (i == A[0]) {
			for (int j = 0; j < N; j++) {
				C += abs(A[j] - i);
			}
		}
		else {
			C = C + l - r;
		}
		if (i == A[0]) {
			bc = C;
			if (C < ans)ans = C;
		}
		else {
			if (bc < C) {
				cout << bc << endl;
				return 0;
			}
			else {
				bc = C;
				if (C < ans)ans = C;
			}
			}
		if (D[M] == i) {
			l += B[M];
			r -= B[M];
				M++;
		}
	}

	cout << ans << endl;
	return 0;

}




Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int N,K,i;
  double max,mae,ato;
  
  cin >> N >> K;
  vector<double> p(N);
  max=0;
  mae=0;
  ato=0;
   for(i=0;i<N;i++)
  {
    cin >> p.at(i);
  }
  for(i=0;i<K;i++)
  {
    mae=mae+p.at(i);
  } 
   max=mae;
  //cout << mae << endl;
  for(i=0;i<N-K;i++)
  {
    mae=mae+p.at(i+K)-p.at(i);
   // cout << mae << max << endl;
    
    if(max<=mae)
    {
      max=mae;
    }
  }
   printf("%.7lf",(max+K)/2);
}

  


Measured memory_bytes: 1792
using System;
using System.Collections.Generic;
using System.Linq;
namespace AOJ {
  public class AOJ {
    public static void Main(string[] args) {
      var n = Console.ReadLine().Split(' ').ToList().Select(int.Parse).ToArray();
      Console.WriteLine(
        n[0] > n[1] ? "a > b" :
        (n[0] < n[1] ? "a < b" : "a == b"));
    }
  }
}

Measured memory_bytes: 9392
/*input

*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define int long long 
#define double long double
#define f first
#define s second
#define mp make_pair
#define pb push_back

#define RE(i,n) for (int i = 1; i <= n; i++)
#define RED(i,n) for (int i = n; i > 0; i--)
#define REPS(i,n) for(int i = 1; (i*i) <= n; i++)
#define REP(i,n) for (int i = 0; i < (int)n; i++)
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REPD(i,n) for (int i = n-1; i >= 0; i--)
#define FORD(i,a,b) for (int i = a; i >= b; i--)

#define all(v) v.begin(),v.end()
#define pii pair<int,int>
#define vi vector<int>
#define vvi vector<vi>
#define print(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout << *it << " "; cout << endl;
#define debug(x) cout << x << endl;
#define debug2(x,y) cout << x << " " << y << endl;
#define debug3(x,y,z) cout << x << " " << y << " " << z << endl;

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

const int INF = 1e18+1;
const int MOD = 1e9+7;
const double PI = 3.14159265358979323846264338;

int raise(int a,int n,int m = MOD){
  if(n == 0)return 1;
  if(n == 1)return a;
  int x = 1;
    x *= raise(a,n/2,m);
    x %= m;
    x *= x;
    x %= m;
    if(n%2)x*= a;
    x %= m;
    return x;
}

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

void solve(){
  	int r;cin >> r;
  	cout << r*r;
}

signed main(){
  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  //freopen(".in","r",stdin);freopen(".out","w",stdout);
  int t = 1;
  //cin >> t;
  while(t--){
    solve();
  }
  return 0;
}

Measured memory_bytes: 384
def count_p(x, n):
    y = 0
    i = n
    while(True):
        if i == 0:
            return 0
        xx = x - (n - i) + 3 - 2 ** (i + 1)
        if xx >= 0:
            y = 2 ** i - 1
            if xx > 0:
                y += count_p(xx - 1, i) + 1
            break
        else:
            i -= 1
    return y

n, x = map(int, input().split())
ans = count_p(x, n + 1)
print(ans)


Measured memory_bytes: 3060
//............Created by:- Arth Raj...........................//
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define vii vector<pair<int,int>>
#define tez ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define lp(i,a,b) for(int i=a;i<b;i++)
#define rlp(i,a,b) for(int i=b;i>=a;i--)
#define ld long double
#define tl tuple<ll,ll,ll>
#define all(x) (x).begin(),(x).end()
#define bs(x,b) binary_search(all(x),b)
#define vip vector<pair<int,pair<int,int>>>
#define pip pair<int,pair<int,int>>
#define INF 1e18
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
ll abm(ll a, ll b, ll m) {ll ans = 1; a = a % m; while (b > 0) {if (b & 1)ans = (ans * a) % m; a = (a * a) % m; b = b / 2;} return ans % m;}
ll ncr(ll n, ll r, ll m) {if (r == 0)return 1; ll fac[n + 5]; fac[0] = 1; lp(i, 1, n + 1) {fac[i] = fac[i - 1] * i % m;} return (((fac[n] * abm(fac[r], m - 2, m)) % m) * (abm(fac[n - r], m - 2, m))) % m;}
int main()
{
	int n;
	cin >> n;
	int arr[n + 1][3];
	lp(i, 1, n + 1)
	{
		cin >> arr[i][0] >> arr[i][1] >> arr[i][2];
	}
	arr[0][0] = arr[0][1] = arr[0][2] = 0;
	int dp[n + 1][3];
	dp[0][0] = dp[0][1] = dp[0][2] = 0;
	lp(i, 1, n + 1)
	{
		dp[i][0] = max(dp[i - 1][1] + arr[i][1], dp[i - 1][2] + arr[i][2]);
		dp[i][1] = max(dp[i - 1][0] + arr[i][0], dp[i - 1][2] + arr[i][2]);
		dp[i][2] = max(dp[i - 1][1] + arr[i][1], dp[i - 1][0] + arr[i][0]);
	}
	cout << max(dp[n][0], max(dp[n][1], dp[n][2])) << endl;
	return 0;
}

Measured memory_bytes: 5924
#include<stdio.h>

int main(){
  int H[100], W[100], i, j, cnt=0, var;
  while(1){
    scanf("%d %d", &H[cnt], &W[cnt]);
    if(H[cnt]==0 || W[cnt]==0){
      break;
    }
    cnt++;
  }
  
  for(var=0;var<cnt;var++){
    
    for(j=0;j<H[var];j++){
      for(i=0;i<W[var];i++){
        printf("#");
      }
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 572
x1, y1, x2, y2 = [int(i) for i in input().split()]
dx = x2 - x1
dy = y2 - y1
x3 = x2 - dy
y3 = y2 + dx
x4 = x1 - dy
y4 = y1 + dx
print('{} {} {} {}'.format(x3,y3,x4,y4))



Measured memory_bytes: 2940
// C - Traveling Plan
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define rp(i,s,e) for(int i=(s);i<(e);++i)

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

	vi A(N+2);
	int all_dist = 0;
	rp(i,1,N+1){
		cin>>A[i];
		all_dist += abs(A[i-1]-A[i]);
	}
	all_dist += abs(A[N]-A[0]);

	rp(i, 1, N+1)
		cout<< all_dist
			- abs(A[i]-A[i-1]) - abs(A[i]-A[i+1])
			+ abs(A[i+1]-A[i-1]) <<endl;
}

Measured memory_bytes: 1664
use std::vec::Vec;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    let n: usize = read();
    let mut a: Vec<usize> = read_vec();
    let mut b: Vec<usize> = read_vec();
    let mut c: Vec<usize> = read_vec();
    let mut ans = 0;
    for i in 0..n {
      ans += b[a[i] - 1];
      if i > 0 {
        if a[i-1] + 1 == a[i]  {
          ans += c[a[i - 1] - 1];
        }
      }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {
	public static void main(String[] args) {

		Scanner sysin = new Scanner(System.in);
		final int n = sysin.nextInt();
		List<Job> jobs = IntStream.range(0, n)
							.mapToObj(i -> new Job(sysin.nextInt(), sysin.nextInt()))
							.sorted()
							.collect(Collectors.toList());
		sysin.close();

		int now = 0;
		for (Job job : jobs) {
			now += job.time;
			if (job.deadline < now) {
				System.out.println("No");
				System.exit(0);
			}
		}

		System.out.println("Yes");
	}

}

class Job implements Comparable<Job>{
	public final int time, deadline;

	public Job(int time, int deadline) {
		this.time = time;
		this.deadline = deadline;
	}

	@Override
	public int compareTo(Job o) {
		return this.deadline - o.deadline;
	}
}

Measured memory_bytes: 121412
n = int(input())
List = [[] for i in range(10)]
for i in range(n):
    s = input()
    List[len(s) - 1].append(s)

count = 0
for each_list in List:
    each_list = list(set(each_list))
    count += (len(each_list))



print(count)

Measured memory_bytes: 111240
n = gets.chomp.to_i
ary = []
n.times do
  ary << gets.chomp
end
# p ary

words = []
end_word = "."
flag = false
ary.each do |word|
  if words.include?(word)
    flag = true
    # puts(word)
    break
  end
  if !(end_word == '.' or word[0] == end_word)
    # puts(word)
    flag = true
    break
  else
    end_word = word[-1]
  end
  words << word
end

if flag
  puts "No"
else
  puts "Yes"
end


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

int main() {
  int x, y, z, u;
  cin >> x >> y >> z >> u;

 if ( x + y > z + u ) {
   cout << "Left" << endl;
 }
  else if ( x + y == z + u ) {
    cout << "Balanced" << endl;
 }
  else if( x+ y < z+ u ) {
    cout << "Right" << endl;
 }
}


Measured memory_bytes: 3632
import java.util.*;
import java.util.Collections;
public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int total = 0;
        ArrayList<Integer> takos = new ArrayList<Integer>();
        for(int i = 0;i < N;i++){
            takos.add(sc.nextInt());
        }
        for(int i = 0;i < N;i++){
            for(int j = i + 1;j < N;j++){
                total += takos.get(i) * takos.get(j);
            }
        }
        System.out.println(total);
    }
}


Measured memory_bytes: 24916
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <climits>

using namespace std;

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

typedef long long LL;
typedef vector<int> VI;

int main() {
  int n;
  cin >> n;
  vector<int> h(n);
  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }
  for (int i = n-1; i >= 1; i--) {
    if (h[i] < h[i-1]) {
      h[i-1]--;
      if (h[i-1] < 0) {
        cout << "No" << endl;
        return 0;
      }
    }
    if (h[i] < h[i-1]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 640
#include<stdio.h>

int main(void){
    int N;
    scanf("%d",&N);
    int H[N];
    for(int i=0;i<N;i++){
        scanf("%d",&H[i]);
    }
    if(N==1){
        printf("Yes");
        return 0;
    }

    if(H[0]-1>H[1]){
        printf("No");
        return 0;
    }
    if(H[0]-1==H[1]) H[0]--;

    for(int i=1;i<N;i++){
        if(H[i]>H[i-1]) H[i]--;
        if(H[i]<H[i-1]){
            printf("No");
            return 0;
        }
    }
    printf("Yes");
    return 0;
}

Measured memory_bytes: 512
a,b,c=map(int,input().split())
if a<b:
	e=a
	a=b
	b=e
if a<c:
	print(str(b)+" "+str(a)+" "+str(c))
else:
	if b<c:
		print(str(b)+" "+str(c)+" "+str(a))
	else:
		print(str(c)+" "+str(b)+" "+str(a))


Measured memory_bytes: 5592
import sys
input = sys.stdin.readline
N = int(input())
S = input()
Q = int(input())
K = list(map(int,input().split()))

ans = []
for k in K:
    d = m = dm = dmc = 0
    for i in range(N):
        if i >= k:
            if S[i-k] == 'D':
                d -= 1
                dm -= m
            elif S[i-k] == 'M':
                m -= 1
        if S[i] == 'D':
            d += 1
        elif S[i] == 'M':
            m += 1
            dm += d
        elif S[i] == 'C':
            dmc += dm
    ans.append(dmc)
print(*ans, sep='\n')

Measured memory_bytes: 74840
#include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin>>H>>W;
  while(H!=0&&W!=0){
    for(int i=1; i<=H; i++){
      for(int j=1; j<=W; j++){
        if((i+j)%2==1){
            cout<<".";
        }
        else{
            cout<<"#";
        }
      }
      cout<<endl;
    }
    cout<<endl;
    
    cin>>H>>W;
  } 
  
  return 0;
}


Measured memory_bytes: 3080
import java.util.Scanner;

public class Main {
    public static void main(String... args){
        Scanner scan = new Scanner(System.in);
        while(true) {
            int n = scan.nextInt();
            int x = scan.nextInt();
            if(n == 0 && x == 0)break;

            int p = 0;
            for(int i = 1;i <= n;i++){
                for(int j = i+1;j <= n;j++){
                    for(int k = j+1;k <= n;k++){
                        if(i+j+k == x)p++;
                    }
                }
            }
            System.out.println(p);

        }


        scan.close();
    }

}


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

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

  int n;
  cin >> n;
  
  vector<vector<int>> seat(n, vector<int> (n, 1)), val = seat;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      val[i][j] = min({i, j, n-i-1, n-j-1});
    }
  }
  
  int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
  function<void(int, int, int)> update = [&](int x, int y, int dist) {
    if (x < 0 || x >= n || y < 0 || y >= n || dist >= val[x][y]) return ;
    if (~dist) val[x][y] = dist;
    for (int i = 0; i < 4; ++i) {
      update(x+dx[i], y+dy[i], val[x][y]+seat[x][y]);
    }
  };

  long long ans = 0;
  for (int i = 0; i < n * n; ++i) {
    int pos;
    cin >> pos; --pos;
    int x = pos / n, y = pos % n;
    ans += val[x][y];
    seat[x][y] = 0;
    update(x, y, -1);
  }

  cout << ans << '\n';
}


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

using namespace std;

//Data types macros
typedef long long  ll;
typedef vector<int> vec;
typedef unsigned long long ull;
typedef unsigned int ui;

//loop macros
#define f(i,s,e) for(long long i=s;i<e;i++)
#define fe(i,s,e)  for(long long i=s;i<=e;i++)
#define fr(i,s,e) for(long long i=e;i>s;i--)
#define fre(i,s,e) for(long long i=e;i>=s;i--)

//Input macros
#define get1(n) cin>>n;
#define get2(n,m) cin>>n>>m;
#define get3(t,n,m) cin>>t>>n>>m;
#define wez(n) ll (n); cin>>(n);
#define wez2(n,m) ll (n),(m); cin>>(n)>>(m);
#define wez3(n,m,k) ll (n),(m),(k); cin>>(t)>>(n)>>(m);

//Action macro
#define allv(c) (c).begin(),(c).end()
#define setmax(a,b) (a)=max((a),(b))
#define setmin(a,b) (a)=min((a),(b))
#define pb push_back

//Specific values macros
#define min -
#define mod 100000000
#define max 1e9

//output macros
#define outa(a,s,e) f(i,s,e) cout << a[i] << (i==e-1?'\n':' ')
#define oute(n) cout<<n<<"\n"
#define outc(n) cout<<n<<" "
#define out2e(n,m) cout<<n<<" "<<m<<"\n"
#define out3e(n,m,o) cout<<n<<" "<<m<<" "<<o<<"\n"

//your work

//

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    for(int i=0;i<(int)(s.size());i++){
        if(s[i]==s[i+1]){
            cout<<"Bad\n";
            return 0;
        }
    }
    cout<<"Good\n";
    return 0;
}






Measured memory_bytes: 256
#include<iostream>

using namespace std;


int main(void) {
	int N; cin >> N;
	int i,j;
	if (N <= 3) { cout << "No" << endl; return 0; }
	for (i = 0; i <= N; i += 4) {
		for (j = 0; j <= N; j += 7) {
			if (N - (i + j) == 0) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}

	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Pl = pair<ll, ll>;
using Tl = tuple<ll, ll, ll>;

const ll INF = 1e15;
const ld eps = 1e-6;

int main(){
  ll N, K;
  cin >> N >> K;
  vector<ll> m(K);
  for(ll i=1;i<=N;i++)
    m[i%K]++;
  ll ans = 0;
  for(ll i=0;i<K;i++){
    if(i*2%K == 0)
      ans += m[i] * m[i] * m[i];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		judge(sc.nextInt(), sc.nextInt());

		sc.close();
	}

	static void judge(int n, int m) {
		int a = n == 1 ? 14 : n;
		int b = m == 1 ? 14 : m;

		System.out.println(a > b ? "Alice" : a == b ? "Draw" : "Bob");

	}
}

Measured memory_bytes: 22996
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn main() {
    let v: Vec<u64> = read_vec();
    let big_int = 1000_000_000 + 7;
    let (n, m) = (v[0], v[1]);
    if m == 1 {
        println!("1");
        return;
    }
    let n = n as usize;
    let msize = (m as f64).sqrt() as usize + 10000;

    let mut is_prime = vec![true; msize + 1];
    let mut primes = Vec::new();
    is_prime[0] = false;
    is_prime[1] = false;

    for i in 2..msize + 1 {
        if is_prime[i] {
            primes.push(i);
            let mut j = 2 * i;
            while j < msize {
                is_prime[j] = false;
                j += i;
            }
        }
    }

    let mut dict = std::collections::HashMap::new();
    let mut m = m as u64;
    for &p in primes.iter() {
        while m % p as u64 == 0 {
            *dict.entry(p).or_insert(0) += 1usize;
            m /= p as u64;
        }
        if m == 1 {
            break;
        }
    }
    if m != 1 {
        dict.insert(m as usize, 1);
    }

    let mut max_num = dict.values().max().unwrap();

    let mut dp = vec![vec![0u64; max_num + 1]; n + 1];
    dp[0][0] = 1;
    let mut sum = vec![1u64; max_num + 1];

    for i in 0..n {
        for j in 0..max_num + 1 {
            dp[i + 1][j] += sum[j];
            dp[i + 1][j] %= big_int;
            // for k in 0..j + 1 {
            // dp[i + 1][j] += dp[i][k];
            // dp[i + 1][j] %= big_int;
            // }
        }
        sum[0] = dp[i + 1][0];
        for j in 1..max_num + 1 {
            sum[j] = sum[j - 1] + dp[i + 1][j];
            sum[j] %= big_int;
        }
    }
    let mut ans = 1;
    for &val in dict.values() {
        ans *= dp[n][val];
        ans %= big_int;
    }
    println!("{}", ans);
}


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

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

  vector<int>a(n);
  rep(i, n) cin >> a[i];
  ll sum = 0;
  rep(i, n) sum += a[i];
  set<ll> candidates;
  for (int i = 1; i*i <= sum; i++) {
    if (sum%i == 0) {
      candidates.insert(i);
      candidates.insert(sum/i);
    }
  }
  ll ans = 1;
  for (ll x : candidates) {
    ll need;
    {
      vector<ll> r(n);
      rep(i, n) r[i] = a[i]%x;
      sort(r.begin(), r.end());
      ll B = 0;
      rep(i, n) B += x-r[i];
      ll A = 0;
      need = 1e18;
      rep(i, n) {
        A += r[i];
        B -= x-r[i];
        need = min(need, max(A, B));
      }
    }
    if (need <= k) ans = max(ans, x);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3692
import java.util.Scanner;

public class Main {
	 public static void main(String[] args) {
		 Scanner sc = new Scanner(System.in);
		 String moji=sc.nextLine();
		 for(int i=0;i<moji.length();i++) {
			 char c=moji.charAt(i);
			 if('a'<=c && c<='z') System.out.print((char)(c-32));
			 else if ('A'<=c && c<='Z')System.out.print((char)(c+32));
			 else System.out.print(c);
		 }
		 System.out.println();

		 sc.close();
	 }
}



Measured memory_bytes: 26660
#include <iostream>
#include <string>
using namespace std;
int main(){
    string s;
    cin >> s;
    for(int i = 0; i < 18; i++){
        if(s[i] == ','){
          s[i] = ' ';
         }
    }
    cout << s << endl;
    return 0;
    
}


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

#define ll long long int
#define rep(i,n) for(int (i)=0;(i) < (n);(i)++)
#define INF 1000000000000000000

using namespace std;

int main(void){
    ll a;double b;
    cin >> a >> b;
    ll ans = a * (ll)round(b*100);
    ans /= 100;

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3788
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int MAX_N = 200005;
int A[MAX_N];

int main()
{
	int N,K;
	cin >> N >> K;
	rep(i,N)
	{
		cin >> A[i];
	}
	rep(i,K)
	{
		vector<pair<int,int> > B;
		rep(j,N)
		{
			B.push_back(make_pair(j-A[j],1));
			B.push_back(make_pair(j+A[j]+1,-1));
		}
		sort(B.begin(), B.end());
		int cnt = 0;
		int idx = 0;
		bool allN = true;
		for (int j = 0; j < N; ++j)
		{
			while(idx < B.size() && B[idx].first <= j)
			{
				if (B[idx].second == 1)
				{
					cnt++;
					idx++;
				}
				else
				{
					cnt--;
					idx++;
				}
			}
			A[j] = cnt;
			if (cnt != N) allN = false;
		}
		if (allN)
		{
			rep(j,N)
			{
				if (j != 0) cout << " ";
				cout << N;
			}
			cout << endl;
			return 0;
		}
	}

	rep(i,N)
	{
		if (i != 0) cout << " ";
		cout << A[i];
	}
	return 0;
}

Measured memory_bytes: 11160
from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

s = input()
if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')

Measured memory_bytes: 4068
form = input().strip()
m_limit = ["{:0>2}".format(i) for i in range(1, 13)]

f2d, l2d = form[:2], form[2:]
if f2d in m_limit and l2d in m_limit:
    print("AMBIGUOUS")
elif f2d in m_limit:
    print("MMYY")
elif l2d in m_limit:
    print("YYMM")
else:
    print("NA")
    




Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		long X = sc.nextLong();
		long t = sc.nextLong();
		System.out.println((X-t)>0?(X-t):0);
	}

}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
#define eoi ios::sync_with_stdio(0),ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
int main()
{
    eoi;
    string s;
    cin>>s;
    if(s.length()==1)
    {
        cout<<"-1 -1";
        return 0;
    }
    else if(s.length()==2)
    {
        if(s[0]==s[1])
        {
            cout<<"1 2";
            return 0;
        }
        else
        {
            cout<<"-1 -1";
            return 0;
        }
    }
    for(int z=0; z<s.length()-2; z++)
    {
        if((s[z]==s[z+1])|| (s[z]==s[z+2]) || (s[z+1]==s[z+2]))
        {
            cout<<z+1<<" "<<z+3;
            return 0;
        }
    }
    cout<<"-1 -1";
}







Measured memory_bytes: 512
while True:

    dataset = input().split(" ")

    a = int(dataset[0])
    op = dataset[1]
    b = int(dataset[2])
    sum = 0
    
    if op == "?":
        break
    elif op == "+":
        sum = a + b
    elif op == "-":
        sum = a - b
    elif op == "*":
        sum = a * b
    elif op == "/":
        sum = int(a / b)

    print(sum)



Measured memory_bytes: 5596
#include <cstdio>
#include <cstdlib>
#include <string>
#include <iostream>
using namespace std;

struct Node {
	int key;
	Node *right, *left, *parent;
};

Node *root, *NIL;

void insert(int k) {
	Node *y = NIL;
	Node *x = root;
	Node *z;
	
	z = (Node *)malloc(sizeof(Node));
	z->key   = k;
	z->left  = NIL;
	z->right = NIL;
	
	while(x != NIL) {
		y = x;
		if(z->key < x->key) {
			x = x->left;
		} else {
			x = x->right;
		}
	}
	
	z->parent = y;
	if(y == NIL) {
		root = z;
	} else {
		if( z->key < y->key) {
			y->left = z;
		} else {
			y->right = z;
		}
	}
}

void inorder(Node *u) {
	if(u == NIL) return;
	inorder(u->left);
	printf(" %d",u->key);
	inorder(u->right);
}
void preorder(Node *u) {
	if(u == NIL) return;
	printf(" %d",u->key);
	preorder(u->left);
	preorder(u->right);
}
	
int main(void) {
	int n, i, x;
	string com;
	scanf("%d",&n);
	
	for(i=0;i<n;i++) {
		cin >> com;
		if(com == "insert") {
			scanf("%d",&x);
			insert(x);
		} else if(com == "print") {
			inorder(root);
			printf("\n");
			preorder(root);
			printf("\n");
		}
	}

	return 0;
}

/*
10
insert 30
insert 88
insert 12
insert 1
insert 20
find 12
insert 17
insert 25
find 16
print
*/


Measured memory_bytes: 26620
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <map>
#include <vector>
#include <set>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cctype>
#include <cmath>
#include <fstream>

using namespace std;

typedef long long ll;
#define REP(i,k) for(int (i)=0;(i)<(k);(i)++)
#define INF ~(1<<31)
#define CLR(a) memset((a),0,sizeof((a)))
#define EPS 1e-9
#define DBG 1
#define D(s,v) if(DBG) cout<<(s)<<": "<<(v)<<endl;
#define DVEC(s,v) if(DBG) {cout<<(s)<<": "; for(int i=0;i<(v).size();i++) cout<<(v)[i]<<" "; cout<<endl;}
#define DARR(s,v,n) if(DBG) {cout<<(s)<<": "; for(int i=0;i<n;i++) cout<<(v)[i]<<" "; cout<<endl;}

int X,Y;
int O = 8001;
string S;

bool can(bool myTurn, int mydir, int mypos,int dest){
    bool can[2][2][8001*2]; //spos, dir, pos
    CLR(can);
    
    for(int dir=0;dir<2;dir++)
        can[0][dir][dest] = 1;

    bool turn = myTurn;
    for(int i=0;i<S.size();i++){
        if(S[i]=='T') turn ^= 1;
    }

    for(int spos=S.size()-1;spos>=0;spos--){
        if(S[spos]=='T') turn^=1;
        for(int dir=0;dir<2;dir++)
            for(int pos=0;pos<8001*2;pos++){
            if(turn){
                if(S[spos]=='F'){
                    if(dir)
                        can[1][dir][pos] = can[0][dir][pos+1];
                    else
                        can[1][dir][pos] = can[0][dir][pos-1];
                }
                else{
                    can[1][dir][pos] = can[0][dir][pos];
                }
            }
            else{
                if(S[spos]=='F'){
                    can[1][dir][pos] = can[0][dir][pos];
                }
                else{
                    can[1][dir][pos] |= can[0][0][pos];
                    can[1][dir][pos] |= can[0][1][pos];
                }
            }
        }

        for(int dir=0;dir<2;dir++)
        for(int pos=0;pos<8001*2;pos++){
            can[0][dir][pos] = can[1][dir][pos];
            can[1][dir][pos] = 0;
        }
    }

    if(myTurn) return can[0][mydir][mypos];
    else return can[0][0][mypos] | can[0][1][mypos];
}

int main(){
    ios_base::sync_with_stdio(0);
    string s;
    while(getline(cin,s)){
        int x,y;
        cin >> x >> y;

        X = x; Y = y; S = s;

        bool canGo = can(1,1,O,O+x) && can(0,0,O,O+y);
        if(canGo){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }

        getline(cin,s);
    }
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 11;
struct ddd{
    int l, r, fl, mi;
    bool operator < (const ddd &x) const{
        return mi > x.mi;
    }
};
priority_queue<ddd> q;
int f[2][N][21], n, a[N], pos[N], lg[N];
int ans[N], tot;
int find(int fl, int l, int r){
    int len = lg[r - l + 1];
    return min(f[fl][l][len], f[fl][r - (1 << len) + 1][len]);
}
int main(){
    cin>>n;
    memset(f, 127, sizeof(f));
    for(int i = 1;i <= n; i++){
        scanf("%d", &a[i]);
        int fl = i & 1;
        f[fl][i][0] = a[i];
        pos[a[i]] = i;
    }
    for(int i = 2;i <= 2e5; i++){
        lg[i] = lg[i>>1] + 1;
    }
    for(int j = 0;j <= 19; j++){
        for(int i = 1;i <= n; i++){
            if(i + (1 << j) > n)break;
            f[0][i][j+1] = min(f[0][i][j], f[0][i + (1 << j)][j]);
            f[1][i][j+1] = min(f[1][i][j], f[1][i + (1 << j)][j]);
        }
    }
    ddd now = (ddd){1, n, 1, find(1, 1, n)};
    q.push(now);
    int x, y;
    while(q.size()){
        now = q.top();
        q.pop();
        x = now.mi;
        y = find(now.fl ^ 1, pos[x] + 1, now.r);
        ans[++tot] = x; ans[++tot] = y;
        if(pos[x] > now.l)q.push((ddd){now.l, pos[x] - 1, now.fl, find(now.fl, now.l, pos[x] - 1)});
        if(pos[x] + 1 < pos[y] - 1)q.push((ddd){pos[x] + 1, pos[y] - 1, now.fl ^ 1, find(now.fl ^ 1, pos[x] + 1, pos[y] - 1)});
        if(pos[y] + 1 < now.r)q.push((ddd){pos[y] + 1, now.r, now.fl, find(now.fl, pos[y] + 1, now.r)});
    }
    for(int i = 1;i <= n; i++){
        printf("%d ", ans[i]);
    }
    puts("");
    return 0;
}


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

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

  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v.at(i);
  bool ans = true;
  for (int i = 0; i < n; i++)
  {
    if(v.at(i) % 2 == 0 && (v.at(i) % 3 != 0 && v.at(i) % 5 != 0))
    {
      ans = false;
      break;
    }
  }
  if(ans) cout << "APPROVED" << endl;
  else cout << "DENIED" << endl;
  
  return 0;
}

Measured memory_bytes: 256