akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int main() {
  
  int n;
  double  A, B, C, D[100];

  cin>>n>>A>>B>>C;

  for(int i=0; i<n; i++) {
    cin>>D[i];
  }
  sort(D, D+n, greater<int>());
  
  double ret = 0;
  double dp[100]; // memo topping
  for(int i=0; i<n-1; i++) {
    D[i+1] = D[i]+D[i+1];
    dp[i+1] = (C+D[i+1])/(A+(i+2)*B);
    dp[i]   = (C+D[i])/(A+(i+1)*B);
    ret = max(dp[i+1], max( dp[i], max(ret, C/A)) );
  }

  if(ret == 0) cout << (int)(C/A) << endl;
  else cout << (int)ret << endl;

  return 0;
}

Measured memory_bytes: 1248
n=int(input())
s=input()
l=s[n-1]+s+s[0]
assign=['S','W']
for i in assign:
  for j in assign:
    t=i+j
    for k in range(2,n):
      if s[k-1]=='o':
        if t[-1]=='S':
          t+=t[-2]
        else:
          if t[-2]=='S':
            t+='W'
          else:
            t+='S'
      else:
        if t[-1]=='S':
          if t[-2]=='S':
            t+='W'
          else:
            t+='S'
        else:
          t+=t[-2]
    t=t[n-1]+t+t[0]
    ok=True
    for u in range(1,n+1):
      if l[u]=='o':
        if t[u]=='S':
          if t[u-1]!=t[u+1]:
            ok=False
        else:
          if t[u-1]==t[u+1]:
            ok=False
      else:
        if t[u]=='S':
          if t[u-1]==t[u+1]:
            ok=False
        else:
          if t[u-1]!=t[u+1]:
            ok=False
    if ok:
      print(t[1:n+1])
      exit()
print(-1)

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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
using ll = long long;

int n;

void dfs(string s, char mc){
    if(s.size() == n){
        cout << s << endl;
    }else{
        for(char c = 'a'; c <= mc; c++){
            char nc = c == mc ? (char)(mc + 1) : mc;
            dfs(s + c, nc);
        }
    }
}

int main() {
    cin >> n;
    dfs("", 'a');

    return 0;
}


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

int main() {
  int n;
  cin>>n;
  int count=0;
  for(int i=0;i<n;i++){
    int a;
    cin>>a;
    if(a%2==1) count++;
  }
  if(count%2==0) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
const int N=1505;
int S[N],n,u[N][N],l[2][N],r[2][N];
char A[N][N];
int main(){
	scanf("%d",&n);
	for (register int i=1;i<=n;i++)scanf("%s",A[i]+1);
	for (register int i=0;i<=n;i++)
		for (register int j=0;j<=n;j++)u[i][j]=A[i][j]>='0'&&A[i][j]<='9'?min(i,min(u[i-1][j],u[i][j-1])):1<<30;
	long long ans=0;
	for (register int x=1;x<=n;x++){
		for (register int i=x;i;i--){
			int t=i&1;
			for (register int j=1;j<=n;j++)S[j]=S[j-1]+(u[x][j]<=i?A[x][j]-'0':0);
			for (register int j=n+1;j;j--){
				if (A[i][j]>='0'&&A[i][j]<='9'){
					if (i<x){
						l[t][j]=min(l[t][j+1],l[t^1][j]);
						r[t][j]=max(r[t][j+1],r[t^1][j]);
					}
					else l[t][j]=j,r[t][j]=max(j,r[t][j+1]);
					if (l[t][j]<=r[t][j])ans+=(A[i][j]-'0')*(S[r[t][j]]-S[l[t][j]-1]-(i==x?A[i][j]-'0':0));
				}
				else l[t][j]=1e9,r[t][j]=-1;
			}
		}
	}
	printf("%lld\n",ans);
}


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

int main() {
    int n;
    cin >> n;
    vector<long long> a(n);
    for(auto &t : a) cin >> t;
    sort(a.begin(),a.end());
    long long tot = 0;
    for(int i = 0; i < n; i++) {
        if (i == n - 1) tot += a[i]/2LL;
        else tot += a[i];
    }
    cout << tot << endl;
    return 0;
}

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

ll n,c[51],d[51][21][2],v[51][21][2],a=1e18;
string s[51];

ll fnc(ll b,ll p,ll g){
	if(p==s[b].size())return 0;
	ll &e=v[b][p][g];
	ll &m=d[b][p][g];
	if(e)return m;
	e=1,m=1e18;
	ll l=1;
	if(!g){
		for(int j=p,k=s[b].size()-1;j<k;j++,k--) {
			if(s[b][j]!=s[b][k])l=0;
		}
	}
	else{
		for(int j=0,k=p;j<k;j++,k--){
			if(s[b][j]!=s[b][k])l=0;
		}
	}
	if(l)return m=0;
	rep(i,n){
		ll y=1;
		ll j,k;
		if(!g){
			for(j=p,k=s[i].size()-1;j<s[b].size() && k>=0 && y;j++,k--) {
				if(s[b][j]!=s[i][k])y=0;
			}
			if(y){
				if(k<0)m=min(m,c[i]+fnc(b,j,0));
				else m=min(m,c[i]+fnc(i,k,1));
			}
		}
		else{
			for(j=p,k=0;k<s[i].size() && j>=0 && y;j--,k++){
				if(s[b][j]!=s[i][k])y=0;
			}
			if(y){
				if(j<0)m=min(m,c[i]+fnc(i,k,0));
				else m=min(m,c[i]+fnc(b,j,1));
			}
		}
	}
	return m;
}

int main() {
	cin>>n;
	rep(i,n)cin>>s[i]>>c[i];
	rep(i,n)a=min(a,c[i]+fnc(i,0,0));
	cout<<(a==1e18 ? -1 : a)<<endl;
}


Measured memory_bytes: 3676
#include<algorithm>
#include<stack>
#include<ctime>
#include<cstring>
#include<cmath>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<queue>
using namespace std;
inline int read(){
	int num=0,f=1;char x=getchar();
	while(x<'0'||x>'9'){if(x=='-')f=-1;x=getchar();}
	while(x>='0'&&x<='9'){num=num*10+x-'0';x=getchar();}
	return num*f;
}
const int maxn=200005;
int n;
char s[maxn];
vector<int> R,W;
#define unt unsigned int 
int main(){
	n=read();
	scanf("%s",s+1);
	for(int i=1;i<=n;++i)
		if(s[i]=='W') W.push_back(i);
	for(int i=n;i>=1;--i)
		if(s[i]=='R') R.push_back(i);
	int ans=0;
	for(unt i=0,j=0;i<R.size()&&j<W.size();++i,++j){
		if(R[i]<W[j])break;
		++ans;
	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 4616
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int H = scan.nextInt();
		int W = scan.nextInt();
		int h = scan.nextInt();
		int w = scan.nextInt();
		
		System.out.println(H*W - (h*W + w*H - h*w));

	}
}

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

#define LL long long
#define COIN const int
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>

#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define REPD(i,n) for((i)=(n)-1;(i)>=0;(i)--)

#define ALL(c) (c).begin(), (c).end()
#define LEN(s) (s).size()
#define CLEAR(x) memset(x,0,sizeof x);

#define MP make_pair
#define PB push_back
#define X first
#define Y second

#define VI vector<int>
#define VS vector<string>
#define VII vector<PII>
#define VVI vector<VI>

#define PIII 3.1415926
#define PI 3.14
/*****************************************************************************/

using namespace std;

float i=0.0;
int a,b;

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	cin >>a >>b;
	while (1)
	{
		i+=1.0;
		if ((int)(i*0.08)==a && (int)(i*0.1)==b)
		{
			cout <<i<<endl;
			return 0;
		}
		if ((int) i*0.08>a && (int) i*0.1>b)
		{
			break;
		}
	}
	cout <<"-1"<<endl;
	return 0;
}
/******************************************************************************
******************************************************************************/


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

int N;
int A[SIZE];
int x[200],y[200],h[200];

int main()
{
	cin >> N;
	rep(i,0,N)cin >> x[i] >> y[i] >> h[i];

	int H;
	bool T = false; //決定したか
	bool ANS = true; //正解かどうか
	rep(i,0,101) rep(j,0,101) {
		T = false;
		ANS = true;
		rep(k,0,N) {
			int t = abs(i-x[k]) + abs(j-y[k]);
			if(!T){
				if(h[k] != 0){
					H = t + h[k];
					T = true;
				}
			}else{
				if(h[k] != max(0,H-t)) ANS = false;
			}
		}
		if(ANS){
			rep(k,0,N) {
				int t = abs(i-x[k]) + abs(j-y[k]);
				if(h[k] != max(0,H-t)) ANS = false;
			}
		}
		if(ANS){
			cout << i << " " << j << " " << H << endl;
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){

  int H,W,N;
  cin >>H>>W>>N;
  int max,min;
  if(H>W){ max=H;
           min=W;      }
  else{max=W;
       min=H;       }
  int i;
  for(i=1;i<=min;i++){
     if(i*max>=N){break;}
     
  } 
  cout<<i;
 return 0; 
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
using namespace std;
typedef long long ll;
int main(){
  ll n = 0;
  cin >> n;
  vector<ll> num(n);
  vector<ll> copy(n);
  for(int i = 0;i <= n - 1;i++){
    cin >> num[i];
    copy[i] = num[i];
  }
  sort(num.begin(),num.end());
  ll all = 0;
  ll renn = 0;
  vector<ll> count(n);
  for(int i = 0;i <= n - 1;i++){
    count[i] = 0;
  }
  renn = 1;
  count[num[0]]++;
  for(int i = 1;i <= n - 1;i++){
    if(num[i] == num[i - 1]){
      renn++;
    }
    else{
      //cout << i << " " << renn << endl;
      all += renn * (renn - 1) / 2;
      renn = 1;
    }
    count[num[i]]++;
  }
  //cout << renn << endl;
  all += renn * (renn - 1) / 2;
  //cout << all << endl;
  for(int i = 0;i <= n - 1;i++){
    cout << all - count[copy[i]] + 1 << endl;
    //cout << count[copy[i]] << "i"  << endl;
  }
  return 0;
}

Measured memory_bytes: 7296
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > > 
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string S,T;
    cin >> S >> T;
    S= S+S;
    
    rep(i, T.size()){
        string str = S.substr(i, T.size());
        if(T== str) {cout << "Yes" << endl ;return 0;}
    }
    cout << "No" << endl;
    
    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

n = int(input())
A = list(map(int,input().split()))
# B = []
# for i in range(n-1):
#     B.append(A[i]^A[i+1])

# print(B)

# ANS = [26]
# for i in range(n-1):
#     ANS.append(ANS[-1]^B[i])

# print(ANS)

an = 0
for i in range(n):
    an ^= A[i]

ANS = []
for i in range(n):
    ANS.append(an^A[i])
print(*ANS)

Measured memory_bytes: 108020
#[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, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (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")
    };
}

fn main() {
    input! {
        n: usize,
        d: [usize; n],
    }
    let mut d = d;
    d.sort();
    let m = d.len() / 2;
    println!("{}", d[m] - d[m - 1]);
}


Measured memory_bytes: 4352
A, B=map(int,input().split())

if(A%2 == 0):
  min_even = A
  min_val = 0
else:
  min_even = A + 1
  min_val = A

if(B%2 == 0):
  max_odd = B - 1
  max_val = B
else:
  max_odd = B
  max_val = 0

tmp = (max_odd - min_even + 1)/2

if(tmp%2 == 1):
  print(min_val^1^max_val)
else:
  print(min_val^0^max_val)
    


Measured memory_bytes: 3060
lucas_list = [-1 for i in range(87)]
lucas_list[0] = 2
lucas_list[1] = 1

def lucas(n):
    if lucas_list[n] >= 0:
        return lucas_list[n]
    lucas_list[n] = lucas(n-1)+lucas(n-2)
    return lucas_list[n]

def solve():
    N = int(input())
    print(lucas(N))

solve()


Measured memory_bytes: 3316
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>

int main(void){
	int i;
	
	int n,t,a;
	scanf("%d%d%d",&n,&t,&a);
	
	int h[n+1];
	for(i=1;i<=n;i++){
		scanf("%d",&h[i]);
	}
	
	int num=1;
	float abs=fabs(t-a-0.006*h[1]);
	for(i=1;i<=n;i++){
		if(abs>fabs(t-a-0.006*h[i])){
			abs=fabs(t-a-0.006*h[i]);
			num=i;
		}
	}
	
	printf("%d\n",num);
	
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
using namespace std;
int main(){
int N,flag= 0;
cin >> N;
for (int i= 0;(N-4*i)>=0;i++){
if ((N-4*i)%4 == 0 or (N-4*i)%7 == 0){
 flag ++;
}
}
if (flag != 0){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int a,b,tmp;
  scanf("%d %d",&a,&b);
  while(a||b){
    if(a>b){
      tmp = a;
      a = b;
      b = tmp;
    }
    printf("%d %d\n",a,b);
    scanf("%d %d",&a,&b);
  }
}

Measured memory_bytes: 1028
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <list>
#include <utility>
#include <ctime>
#define INF 1000000000
#define LINF 9000000000000000000
#define mod 1000000007
 
#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=(n);i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define vector_rsort(x) sort(all(x));reverse(all(x))
#define array_rsort(x,n) sort(x,x+n);reverse(x,x+n);
#define pb push_back
#define mp make_pair
#define MOD(x) (x%(mod))

#define Yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define NO cout<<"NO"<<endl
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;
 
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;
/*---------------------------------------------------*/

int n,u,k,v;
int g[105][105];

void init(){
  rep(i,105){
    rep(j,105){
      g[i][j]=INF;
    }
  }
}

void wf(){
  rep(k,105){
    rep(i,105){
      rep(j,105){
	g[i][j]=min(g[i][j],g[i][k]+g[k][j]);
      }
    }
  }
}

int main(){
  init();
  cin>>n;
  rep(i,n){
    cin>>u>>k;
    rep(i,k){
      cin>>v;
      g[u][v]=1;
    }
  }
  wf();
  cout<<1<<" "<<0<<endl;
  for(int i=2;i<=n;i++){
    if(g[1][i]==INF)cout<<i<<" "<<-1<<endl;
    else cout<<i<<" "<<g[1][i]<<endl;
  }
  return 0;
}

Measured memory_bytes: 3116
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vv;
#define pb push_back
#define MOD 1000000007
#define INF 1000000000
#define endl '\n'
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); }

int main(){
    
    fast();
   // #ifndef ONLINE_JUDGE
	//freopen("F:\\Codes\\input.txt", "r", stdin);
	//freopen("F:\\Codes\\output.txt", "w", stdout);
	//#endif
	
	ll i,n,w,j;
	cin>>n>>w;

	vv dp(n+1,vl(w+1));
	vl wgt(n+1),val(n+1);

	for(i=1;i<=n;i++){cin>>wgt[i]>>val[i];}

	for(i=1;i<=n;i++){
		for(j=1;j<=w;j++){
			if(j>=wgt[i]){
				dp[i][j]=max(dp[i-1][j-wgt[i]]+val[i],dp[i-1][j]);
			}
			else{dp[i][j]=dp[i-1][j];}
		}
	}

	// for(i=0;i<=n;i++){
	// 	for(j=0;j<=w;j++){cout<<dp[i][j]<<" ";}cout<<endl;
	// }

	cout<<dp[n][w]<<endl;

    
	return 0;
}

Measured memory_bytes: 82984
#include<bits/stdc++.h>
#define endl "\n"
#define pb push_back
#define ll long long
#define d1(x)  cerr << #x << "--> " << x << endl
#define d2(x, y)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<endl
#define d3(x, y,z)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z<< endl
#define vpll vector<pair<ll,ll>>
#define F first
#define S second
#define T ll tt; cin>>tt; while(tt--)
using namespace std;
ll mode=1e9+7;
const ll maxn=1e5+10;
ll __lcm(ll a, ll b){ return (a*b)/__gcd(a,b); }
ll random(ll mn, ll mx){
	return (rand() % (mx - mn + 1)) + mn; 
}


void solve(){
	
	
	ll x,y,n1,n2,n3;
	cin>>x>>y>>n1>>n2>>n3;
	vpll v(n1+n2+n3);
	for (int i=0;i<n1;i++){
		ll x;
		cin>>x;
		v.pb({x, 1});
	}
	for (int i=0;i<n2;i++){
		ll x;
		cin>>x;
		v.pb({x, 2});
	}
	for (int i=0;i<n3;i++){
		ll x;
		cin>>x;
		v.pb({x, 3});
	}
	
	sort(v.begin(), v.end());
	reverse(v.begin(), v.end());
	
	ll x1=0, y1=0, t1=0, ans=0;
	for (int i=0;i<v.size();i++){
		if (t1==x+y) break;
		if (v[i].S==3){
			t1++;
			ans+=v[i].F;
		}
		else if (v[i].S==2 && y1<y){
			t1++;
			y1++;
			ans+=v[i].F;
		}
		else if (v[i].S==1 && x1<x){
			t1++;
			x1++;
			ans+=v[i].F;
		}
	}
		
	cout<<ans<<endl;
	return ;
	
}

int main(){ 
    
    #ifndef ONLINE_JUDGE
  	//	freopen("input.txt", "r", stdin);
    #endif
    srand(time(0)); 
    
    ios::sync_with_stdio(0);
    cin.tie(0);

	//T{ solve(); }
	solve();
	
	
	
	return 0;
}

Measured memory_bytes: 11392
#include<iostream>
#include<cstdio>
using namespace std;
int A,B,na,nb;
char a[105][105];
int main()
{
	scanf("%d%d",&A,&B);
	for (int i=1;i<=50;i++)
	  for (int j=1;j<=100;j++)
	    a[i][j]='#';
    for (int i=51;i<=100;i++)
      for (int j=1;j<=100;j++)
        a[i][j]='.';
    na=1; nb=1;
    for (int i=1;i<=50;i+=2)
    {
		if (na==A) break;
		for (int j=1;j<=100;j+=2)
    	{
    		if (na==A) break;
			++na; a[i][j]='.';
		}
	}
	for (int i=100;i>=51;i-=2)
	{
		if (nb==B) break;
		for (int j=1;j<=100;j+=2)
		{
			if (nb==B) break;
			++nb; a[i][j]='#';
		}
	}
	printf("100 100\n");
	for (int i=1;i<=100;i++)
	{
		for (int j=1;j<=100;j++)
		  cout<<a[i][j];
		cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int x,y,ans=0;
	cin>>x>>y;
	if(x==1){
		ans+=300000;
	}
	if(x==2){
		ans+=200000;
	}
		if(x==3){
		ans+=100000;
	}
		if(y==1){
		ans+=300000;
	}
	
		if(y==2){
		ans+=200000;
	}
		if(y==3){
		ans+=100000;
	}
		if(x==1&&y==1){
		ans+=400000;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 892
x,y=map(int,input().split())
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=[2]
if (x in a and y in a) or (x in b and y in b) or (x in c and y in c):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 38256
#include <bits/stdc++.h>
#define pb push_back
#define sz(a) int(a.size())
#define re return
#define all(a) a.begin(),a.end()
using namespace std;
int main()
{
	int n;
	cin>>n;
	cout<<(n+1)/2;
	re 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
    int a,b,d,r;
    double f;
    scanf("%d %d", &a, &b);
    d=a/b;
    r=a%b;
    f=(double)a/(double)b;
    printf("%d %d %lf\n",d,r,f);
    return 0;
}


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

int main() {
	const int INF = 1e9;
	const int X_MAX = 100;
    int n;
    cin >> n;

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

    int minSumOfEnergy = INF;
    for(int p = 0 ; p < X_MAX ; p++){
    	int sumOfEnergy = 0;
    	for(int i = 0 ; i < n ; i++){
    		sumOfEnergy += pow((x[i] - p), 2);
    	}
    	minSumOfEnergy = min(minSumOfEnergy, sumOfEnergy);
    }

    cout << minSumOfEnergy << endl;
}

Measured memory_bytes: 256
#include <iostream>[

int main(){
int x, y;
int Put;

do{
std::cin >> x >> y;
if(!(x == 0 && y == 0)){
if(y < x){
Put = x;
x = y;
y = Put;
}
std::cout << x << ' ' << y << std::endl;
}
} while(!(x == 0 && y == 0));
}

Measured memory_bytes: 2988
//
//  main.c
//  ITP1_7_C
//
//  Created by k16031kk on 2018/05/26.
//  Copyright © 2018年 AIT. All rights reserved.
//

#include <stdio.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    int c,r;
    scanf("%d %d", &c, &r);
    int table[c+1][r+1];
    for(int i=0; i<=c; i++) {
        for(int j=0; j<=r; j++) {
            table[i][j]=0;
        }
    }
    for(int i=0; i<c; i++) {
        for(int j=0; j<r; j++) {
            scanf("%d", &table[i][j]);
            table[i][r]+=table[i][j];
            table[c][j]+=table[i][j];
            table[c][r]+=table[i][j];
        }
    }
    for(int i=0; i<=c; i++) {
        for(int j=0; j<=r; j++) {
            if(j!=0)printf(" ");
            printf("%d", table[i][j]);
        }
        printf("\n");
    }
    return 0;
}



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

int min(int a, int b)
{
    if (a > b){
        return (b);
    }
    return (a);
}

int ans;
int dfs(int m, int depth, int s)
{
    int i;
    if (depth == 2){
        int ret;
        ret = (int)floor(sqrt((double)m));
        ret = ret + s + (m - ret * ret);
        return (ret);
    }
    
    for (i = 0; pow(i, depth) <= m; i++){
        ans = min(ans, dfs(m - pow(i, depth), depth - 1, s + i));
    }
    
    return (ans);
}

int main(void)
{
    int m, n;
    int i, j, k;
    
    while (1){
        scanf("%d", &m);
        
        if (m == 0){
            break;
        }
        
        ans = m;
        printf("%d\n", dfs(m, 3, 0));
    }
    
    return (0);
}

Measured memory_bytes: 428
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import copy
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

N = getN()
if N == 1:
    print(0)
    exit()

# 1(1), 2(1 + 2), 3(1 + 2 + 3)...を超えられるか
def factime(ny):
    cnt = 1
    sum = 0
    while True:
        if sum + cnt > ny:
            return cnt - 1
            break
        sum += cnt
        cnt += 1

# 素因数分解
def prime_factorize(n):
    divisors = []
    # 27(2 * 2 * 7)の7を出すためにtemp使う
    temp = n
    for i in range(2, int(math.sqrt(n)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                # 素因数を見つけるたびにtempを割っていく
                temp //= i
            divisors.append([i, cnt])
    if temp != 1:
        divisors.append([temp, 1])
    if divisors == []:
        divisors.append([n, 1])

    return divisors

ans = 0
for i in prime_factorize(N):
    ans += factime(i[1])
print(ans)

Measured memory_bytes: 68316
X = int(input())

check = [True] * (pow(10, 5) + 1000)
check[0] = False
check[1] = False
N = len(check)

for i in range(2, N):
    if check[i]:
        cnt = 2
        st = i * cnt

        while st < N:
            check[st] = False

            cnt += 1
            st = i * cnt

for i in range(X, N):
    if check[i]:
        print(i)
        exit()


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

#define _GLIBCXX_DEBUG
#define all(v) (v).begin(),(v).end()

using ll=long long;
using ld=long double;
using pii=pair<int, int>;
using vi=vector<int>;
using vii=vector<vector<int>>;

const ll LINF=1LL<<60;
const int INF=1<<29;
const int MOD=1e9+7;

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



int main(){
    int N, K; cin >> N >> K;
    string s; cin >> s;
    for(int i=0; i<(int)s.size(); i++){
        if(i == K-1){
            s[i]=s[i]+('a'-'A');
            cout << s[i];
        }
        else cout << s[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
int main(){
    vector<int> A;
    A.resize(3);
    cin >> A[0] >> A[1] >> A[2];
    sort(A.begin(),A.end());
    cout << A[2] * 10 + A[1] + A[0] << "\n";
    return 0;
}


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

using namespace std;

#define int long long 
int n,a,x[1000],f[55][2505][55];
int F(int i,int sum,int sl)
{
	if(f[i][sum][sl]!=-1) return f[i][sum][sl];
	else if(i==n+1)
	{
		if(a*sl==sum) return 1;
		else return 0;
	}
	else
	{
		int res=F(i+1,sum+x[i],sl+1)+F(i+1,sum,sl);
		f[i][sum][sl]=res;
		return res;
	}
}

main()
{
	cin>>n>>a;
	memset(f,-1,sizeof(f));
	for(int i=1;i<=n;i++)
	{
		cin>>x[i];
	}
	cout<<F(1,0,0)-1;
}

Measured memory_bytes: 59520
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <string>
#include <cstdlib>
#include <iomanip>
using namespace std;

int main(){
    int A,B,C;
    cin >> A >> B >> C;
    if(A==B && A!=C){
        cout << "Yes";
        return 0;
    }
    else if(A==C && A!=B){
        cout << "Yes";
        return 0;  
    }
    else if(B==C && B!=A){
        cout << "Yes";
        return 0;
    }
    cout << "No";
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); 
        long [] a = new long [n+1];
        long [] b = new long [n];
        long ans = 0;
		for(int i=0;i<n+1;i++){a[i] = sc.nextLong();
                              } 
        for(int i=0;i<n;i++){b[i] = sc.nextLong();
                            }
        for(int i=0;i<n;i++){long c = Math.min(a[i],b[i]);ans+=c;a[i]-=c;b[i]-=c;
                            long d = Math.min(a[i+1],b[i]);ans+=d;a[i+1]-=d;b[i]-=d;
                            }
		System.out.println(ans);
	}
}


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

int main()
{
  int size=13;
  int spade[size], heart[size], club[size], diamond[size];

  memset( spade,   0, sizeof spade );
  memset( heart,   0, sizeof spade );
  memset( club,    0, sizeof spade );
  memset( diamond, 0, sizeof spade );

  int maxn;
  cin >> maxn;

  for( int i = 0; i < maxn; i++ ) {
    string suits = "";
    int num = 0;

    cin >> suits >> num;

    if( suits == "S" ) {   spade[ num - 1 ] = 1; }
    if( suits == "H" ) {   heart[ num - 1 ] = 1; }
    if( suits == "C" ) {    club[ num - 1 ] = 1; }
    if( suits == "D" ) { diamond[ num - 1 ] = 1; }
  }

  for( int j = 0; j < size; j++ ) {
    if( spade[ j ] == 0 ) {   cout << "S " << j + 1 << endl;  }
  }
  for( int j = 0; j < size; j++ ) {
    if( heart[ j ] == 0 ) {   cout << "H " << j + 1 << endl;  }
  }
  for( int j = 0; j < size; j++ ) {
    if( club[ j ] == 0 ) {    cout << "C " << j + 1 << endl;  }
  }
  for( int j = 0; j < size; j++ ) {
    if( diamond[ j ] == 0 ) { cout << "D " << j + 1 << endl;  }
  }

  return 0;
}

Measured memory_bytes: 3140
import math
a, b, x = map(int,input().split())
#水筒に入る水の体積V
V = (a**2) * b
#平面に落とし込むと
S = x / a
#Sが三角形になる場合と台形になる場合に分ける
#満杯の場合(0除算をふせぐため)
if S == (a * b):
    ans = 0.0
    print(ans)
#三角形になる場合
elif S < (a*b/2):
    #三角形の高さa_dashを求める
    a_dash = S * 2 / b
    f = a_dash / b
    ans = math.degrees(math.atan(f))
    print(90.0 - ans)
#台形になる場合
else:
    #台形の上辺buの長さを求める
    bu =  (S*2)/a - b
    b_dash = b - bu
    #台形から三角形を切り抜く
    S_dash = S - (a*bu)
    f = a / b_dash
    ans = math.degrees(math.atan(f))
    print(90.0-ans)


Measured memory_bytes: 3064
#include<stdio.h>
#include<string.h>

int main()
{
    long long int N,ans=0,i;


    scanf("%lld",&N);
    long long int A[N];
    scanf("%lld",&A[0]);

    for(i=1; i<N;i++)
        {
        scanf("%lld",&A[i]);
          if(A[i]<A[i-1])
            {
                ans=ans + A[i-1]-A[i];
                A[i]=A[i-1];
            }

          }


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


    return 0;
}


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

int main(){
    char s; cin>>s;
    if (isupper(s))
   {
       cout << "A" << endl;
   }
   else
   {
       cout << "a" << endl;
   }
}


Measured memory_bytes: 3616
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define REV(i,n) for(int i=n-1;i>0;i--)
#define req(i,n,m) for(int i=n;i<m;i++)
#define REQ(i,n,m,l) for(int i=n;i<m;i+=l) 
#define _GLIBCXX_DEBUG
int INF = 1e9 + 7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
    unsigned day;
    if (dow < dow1) dow += 7;
    day = dow - dow1;
    day += 7 * n - 6;
    return day;
}
signed gcd(int x, int y) {
    if (y == 0)return x;
    return gcd(y, x % y);
}
signed lcm(int x, int y) {
    return x / gcd(x, y) * y;
}
unsigned DayToWeekNumber(unsigned day)
{
    return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
    return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
pair<string, int>A[101];
signed main() {
  int N; cin>>N;
  string S; cin>>S;
  int count=0;
  rep(i,N){
    if(S.at(i)=='R')count++;
    else count--;
  }
  cout<<(count>0? "Yes":"No")<<endl;
}

Measured memory_bytes: 3640
#include <iostream>
using namespace std;
int main(void) {
    int A, B, C, D, E, F;
	cin >> A >> B >> C >> D >> E >> F;
	double max_s= -1.0,water,suger,water_ans,suger_ans,concentration;
	for (int a = 0; a <= 30; a++) {
		for (int b = 0; b <= 30; b++) {
		    water = 100 * A*a + 100 * B*b;
			if (water > F) continue;
			int P = (a*A + b*B)*E;
			for (int c = 0;; c++) {
				if (c*C > P) break;
				for (int d = 0;; d++) {
				    suger = c*C + d*D;
					if (suger > P || water + suger>F) break;
					concentration = 100.0*(suger) / (1.0*(water + suger));
					if (max_s <concentration) {
						max_s = concentration; 
						water_ans = suger + water; suger_ans = suger;
					}
				}
			}
		}
	}
	cout << water_ans<< " " << suger_ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

vector<pair<ll,ll>>a;
int main() {
	ll n,k;
	cin>>n>>k;
	for(int i=0;i<k;i++){
		ll x,y;
		cin>>x>>y;
		a.push_back(make_pair(y,x));
	}
	sort(a.begin(),a.end());
	ll cnt=0;
	ll now=a[0].first-1;
	cnt++;
	for(int i=1;i<k;i++){
		ll next=a[i].second;
		if(now>=next){
			continue;
		}
		cnt++;
		now=a[i].first-1;
	}
	cout <<cnt;
	return 0;
}

Measured memory_bytes: 3444
N = int(input())
stocks = list(map(int, input().split()))
curr = 1000
for i in range(N - 1):
  cnt = 0
  if stocks[i] < stocks[i + 1]:
    cnt = curr // stocks[i]
  curr += cnt * (stocks[i + 1] - stocks[i])
print(curr)


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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())

using namespace std;

using i64 = long long;
using f80 = long double;
using vi32 = vector<int>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << endl; exit(0); }
inline void no() { cout << "No" << endl; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); return a / gcd(a, b) * b; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { x = max(x, y); }
template <typename T> inline void amin(T &x, T y) { x = min(x, y); }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  using P = pair<string, string>;
  vector<map<P, int>> lst(n + 1);
  rep(i, bit32(n)) {
    int x = __builtin_popcount(i);
    string a, b;
    rep(j, n) {
      ((bit32(j) & i) ? a : b) += s[j];
    }
    lst[x][P(a, b)] += 1;
  }
  i64 ans = 0;
  rep(i, bit32(n)) {
    int x = __builtin_popcount(i);
    string a, b;
    rep(j, n) {
      ((bit32(j) & i) ? a : b) += s[n + j];
    }
    reverse(all(a));
    reverse(all(b));
    ans += lst[x][P(a, b)];
  }
  cout << ans << endl;
}

Measured memory_bytes: 87040
#include <bits/stdc++.h>
using namespace std;
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000003;

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

signed main(){
	int make = 0;
	string s;
	cin >> s;
	for(int i = 0;i < s.length();i++){
		if(s[i] == 'x') make++;
	}
	if(make >= 8) NO();
	else YES();
}


Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
total=sum(b)
for i in range(len(c)):
    if a[i+1]-a[i]==1:
        total +=c[a[i]-1]
print(total)

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

using namespace std;

const int N=300005;
const int p=1e9+7;

inline void add(int& a,const int& b){
	a+=b;
	if(a>=p)a-=p;
}

int to[8][2]={{5,1},{3,2},{2,2},{4,1},{3,3},{7,6},{5,1},{5,5}};

char s[N];

int f[N][8];

int main(){
	scanf("%s",s+1);
	int n=strlen(s+1);
	f[0][0]=1;
	for(int i=1;i<=n;++i){
		if(s[i]!='1')for(int j=0;j<8;++j)add(f[i][to[j][0]],f[i-1][j]);
		if(s[i]!='0')for(int j=0;j<8;++j)add(f[i][to[j][1]],f[i-1][j]);
	}
	printf("%d\n",(f[n][1]+f[n][2])%p);
	return 0;
}


Measured memory_bytes: 9856
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main() {

	const double PI = 3.14159265359;
	double r;

	scanf("%lf", &r);

	printf("%f %f\n", (double)r * (double)r * PI, (double)r * 2.f * PI);

	return 0;
}

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



int main(){
    int n;
    cin >> n;
    vector<int> hai(n);
    for(int i = 0; i < n; i++){
        cin >> hai[i];
    }
    int sum = 1;
    int mini = hai[0];

    for(int i = 1; i < n; i++){
        if(mini > hai[i]){
            sum++;
            mini = hai[i];
        }
    }
    cout << sum << endl;


}

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

#define maxn 100001

int ans[maxn];
int n, a;

int main() {
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a;
		ans[a] = i;
	}
	for (int i = 1; i <= n; i++) {
		cout << ans[i] << " ";
	}
	return 0;
}

Measured memory_bytes: 1280
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <iomanip>
using namespace std;
typedef long long LL;
typedef pair<int,int> P;

int in[100];
LL dp[100][21];
int N;
int main() {
	cin >> N;
	for(int i=0;i<N;i++){
		cin >> in[i];
	}
	dp[0][in[0]]=1;
	for(int i=1;i<N-1;i++){
		for(int j=0;j<=20;j++){
			if(j-in[i]>=0){
				dp[i][j]+=dp[i-1][j-in[i]];
			}
			if(j+in[i]<=20){
				dp[i][j]+=dp[i-1][j+in[i]];
			}
		}
	}
	cout << dp[N-2][in[N-1]] << endl;
}

Measured memory_bytes: 1172
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define fi first
#define se second
#define INF 1000000009
#define LLINF 1000000000000000009LL
using ll = long long;

map<string,int>mp;

int main(){
  int n;
  cin>>n;
  rep(i,n){
    string s;
    cin>>s;
    mp[s]++;
  }
  cout<<mp.size()<<endl;
  return(0);
}


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

typedef long long ll;
using namespace std;

void solve(){
    int n;
    ll k;
    cin >> n >> k;

    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        a[i]--;
    }

    ll t = 0;
    int i = 0;
    vector<int> m(n, -1);

    while (m[i] < 0) {
        m[i] = (int)t;
        if (t == k) {
            cout << i + 1 << endl;
            return;
        }
        i = a[i];
        t++;
    }

    if (t == k) {
        cout << i + 1<< endl;
        return;
    }
    ll l = t - m[i];

    ll rem = (k - t) % l;
    while (rem-- > 0) {
        t++;
        i = a[i];
    }
    cout << i + 1 << endl;
}

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

    solve();

    return 0;
}


Measured memory_bytes: 4792
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T> ostream& operator<<(ostream& s,const multiset<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1'000'000'007;
const ll inf=1'000'000'000'000'000'00;
const int INF=1'000'000'000;
const double EPS=1e-10;
const double PI=acos(-1);

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    ll x,k,d;
    cin>>x>>k>>d;
    x=abs(x);
    ll cnt=x/d;
    if(cnt>=k){
        cout<<abs(x-d*k)<<endl;
    }else{
        k-=cnt;
        x%=d;
        if(k%2==0) cout<<abs(x)<<endl;
        else cout<<abs(x-d)<<endl;
    }
}

Measured memory_bytes: 3648
def main():
    A, B, C = map(int, input().split())
    max_num = max(A, B, C)
    t = 3 * max_num - A - B - C
    ans = 0

    if t % 2 == 0:
        ans = int(t / 2)
    else:
        ans = int((t + 3) / 2)

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 9148
#include <iostream>
#include <vector>

using namespace std;

int H, W;

void solve()
{
    vector<string> map(H);
    vector<vector<int> > sum(H, vector<int>(W + 1, 0));
    int ans = 0;

    for (int i = 0; i < H; i++)
        cin >> map[i];

    for (int i = 0; i < H; i++) {
        for (int j = W - 1; j >= 0; j--) {
            if (map[i][j] == '*') 
                sum[i][j] = 0;
            else
                sum[i][j] = sum[i][j + 1] + 1;
        }
    }

    for (int i = 0; i < H; i++)
        for (int j = 0; j < W; j++) {
            if (map[i][j] == '.') {
                int w = sum[i][j], h = 1;
                int area = w * h;

                while (h + i < H && map[h + i][j] == '.') {
                    w = min(w, sum[h + i][j]);
                    h++;
                    area = max(area, h * w);
                }
                ans = max(ans, area);
            }
        }
    cout << ans << endl;
}

int main()
{
    while (cin >> H >> W, H || W) {
        solve();
    }

    return 0;
}

Measured memory_bytes: 2408
#include<iostream>
#include<vector>

const int PASTA_COUNT = 3;
const int JUICE_COUNT = 2;
const int DISCOUNT_PRICE = 50;

class Lunch {
private:
    std::vector<int> pastaPrice;
    std::vector<int> juicePrice;
public:
    Lunch(std::vector<int> pasta,std::vector<int> juice);
    int getLowPrice(std::vector<int> vec);
    int getLowCostSet();
};

Lunch::Lunch(std::vector<int> pasta,std::vector<int> juice){
    this->pastaPrice = pasta;
    this->juicePrice = juice;
}

int Lunch::getLowPrice(std::vector<int> vec){
    int resultPrice = vec[0];

    for(int price : vec){
        if(price < resultPrice){
            resultPrice = price;
        }
    }
    return resultPrice;
}

int Lunch::getLowCostSet(){
    int resultCost = 0;
    
    resultCost = getLowPrice(pastaPrice) + getLowPrice(juicePrice) - DISCOUNT_PRICE;
    return resultCost;
}

int main(){
    
    std::vector<int> pasta;
    std::vector<int> juice;

    //PASTA
    for(int i = 0;i < PASTA_COUNT;i++){
        int input = 0;
        std::cin >> input;
        pasta.push_back(input);
    }

    //JUICE
    for(int i = 0;i < JUICE_COUNT;i++){
        int input = 0;
        std::cin >> input;
        juice.push_back(input);
    }

    Lunch l = Lunch(pasta,juice);

    std::cout << l.getLowCostSet() << std::endl;

    return 0;
}

Measured memory_bytes: 3152
#define _USE_MATH_DEFINES
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iterator>
#include<sstream>
#include<iomanip>
#include<map>
#include<queue>
#include<deque>
#include<fstream>

#define rep(i, n) for (ll i = 0; i < n; i++) 
#define rrep(i, n) for(ll i = n-1; i>=0; i--)
#define range(i, n, m) for (ll i = n; i < m; i++) 
#define rrange(i, n, m) for (ll i = n - 1; i => m; i--) 
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vp vector<pair<ll, ll> >
#define vvp vector<vector<pair<ll, ll> > >
#define First first
#define Second second.first
#define Third second.second
//#define MOD 998244353
#define MAX 100000

typedef long long int ll;
typedef unsigned long long int ull;

using namespace std;

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


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

	ll N;
	cin >> N;
	vl A(N);
	rep(i, N) {
		cin >> A[i];
	}

	vl bit(N);
	rep(i, N) {
		ll dst = A[i];
		ll b = 0;
		while (dst != 0) {
			if (dst & 1) bit[b] ++;
			b++;
			dst = dst >> 1;
		}
	}

	rep(i, N) {
		if (bit[i] % 2 == 1) {
			cout << "No" << endl;
			return 0;
		}
	}

	cout << "Yes" << endl;

	return 0;
}



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

using namespace std;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
  	int N, K;
  	cin >> N >> K;
  	int mx = 0, g = 0;
  while (N--) {
  	int x;
    cin >> x;
    g = __gcd(g, x);
    mx = max(mx, x);
  }
  if (K % g == 0 && K <= mx) cout << "POSSIBLE\n";
  else cout << "IMPOSSIBLE\n";
}


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

using namespace std;

//map <vector<int>, int> m;

int main() {
	// your code goes here
	int a,b,t,l,i,j,minAns=100000000;
	cin >> a >> b >> t;

	int ans = (t/a)*b;


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


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

int main(){
    int k, a, b;
    cin >> k >> a >> b;
    int i=b/k;
    if (k*i>=a){
            cout << "OK" << endl;
    }
    else {
            cout << "NG" << endl;
    }
    return 0;
}

Measured memory_bytes: 3580