akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

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

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int x,y,i;

        for(i = 0;i < 3;i++){
            if(a > b){
                x = a;
                a = b;
                b = x;
            }
            if(a > c){
                x = a;
                a = c;
                c = x;
            }
            if(b > c){
                y = b;
                b = c;
                c = y;
            }
        }

        System.out.printf("%d %d %d\n",a,b,c);

    }
}


Measured memory_bytes: 26412
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    string s;
    ll k;
    cin>>s>>k;
    ll n=s.length();
    for(int i=0;i<n;i++){
        if(i==n-1){
            s[i]=('a'+((s[i]-'a')+k)%26);
        }
        else if(s[i]!='a'){
            if((s[i]-'a')+k>=26){
                k-=(26-(s[i]-'a'));
                s[i]='a';
            }
        }
    }
    cout << s<<endl;
    return 0;
}



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

#define ll long long int
#define endl "\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int MOD = 1e9 + 7;
typedef unsigned long long u64;

int main()
{
    IOS;
    int t = 1;
    //cin >> t;
    while (t--)
    {
        int n, k;
        cin >> n >> k;
        int a[n + 1];
        a[0] = -1;
        for (int i = 1; i <= n; i++) a[i] = 0;
        int ct = 0;
        for (int i = 0; i < k; i++)
        {
            int d;
            cin >> d;
            for (int j = 0; j < d; j++)
            {
                int x;
                cin >> x;
                a[x] += 1;
            }
        }
        //for(int i=0;i<=n;i++)cout<<a[i]<<" ";
        for (int i = 1; i <= n; i++)
        {
            if (a[i] == 0) ct += 1;
        }
        cout << ct << endl;
    }
    return 0;
}


Measured memory_bytes: 3692
#include <cassert>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <iostream>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)

typedef long long ll;

ll vs[100000+10][4];
ll dp[100000+10][4];

int main(void) {
  int n;
  scanf("%d", &n);
  REP(i, n) {
    REP(j, 3) {
      scanf("%lld", &vs[i][j]);
    }
  }
  REP(i, n) {
    REP(j1, 3) {
      REP(j2, 3) {
        if(j1 != j2) {
          dp[i+1][j2] = max(dp[i+1][j2], dp[i][j1] + vs[i][j2]);
        }
      }
    }
  }
  ll maxi = 0;
  REP(j, 3) {
    maxi = max(maxi, dp[n][j]);
  }
  cout << maxi << endl;
  return 0;
}


Measured memory_bytes: 6528
using System;
using System.Linq;
using static System.Console;

namespace ConsoleAppAtCoderABC172
{
    class Program
    {
        static void Main(string[] args)
        {
            var LRD = ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            var (L, R, d) = (LRD[0], LRD[1], LRD[2]);

            var ans = 0;
            for (int i = L; i <= R; i++)
            {
                if (i % d == 0)
                    ans++;
            }

            WriteLine(ans);
        }
    }
}


Measured memory_bytes: 28000
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
struct Point{
    double x,y;
    Point(){}
    Point(double x,double y):x(x),y(y){}
};
typedef Point Vector;
Vector operator + (Vector A,Vector B){
    return Vector(A.x+B.x,A.y+B.y);
}
Vector operator - (Vector A,Vector B){
    return Vector(A.x-B.x,A.y-B.y);
}
Vector operator * (Vector A,double p){
    return Vector(A.x*p,A.y*p);
}
Vector operator / (Vector A,double p){
    return Vector(A.x/p,A.y/p);
}
bool operator < (const Point& a,const Point& b){
    return a.x<b.x||(a.x==b.x&&a.y<b.y);
}
const double eps = 1e-10;
int dcmp(double x){
    if(fabs(x)<eps) return 0; else return (x<0?-1:1);
}
bool operator == (const Point& a,const Point& b){
    return dcmp(a.x-b.x)==0 && dcmp(a.y-b.y)==0;
}
//点积
double Dot(Vector A,Vector B){
    return A.x*B.x+A.y*B.y;
}
double Length(Vector A){
    return sqrt(Dot(A,A));
}
double Angle(Vector A,Vector B){
    return acos(Dot(A,B)/Length(A)/Length(B));
}

//叉积
double Cross(Vector A,Vector B){
    return (A.x*B.y-A.y*B.x);
}
//三角形面积的二倍的叉乘公式
double Area2(Point A,Point B,Point C){
    return Cross(B-A,C-A);
}
//向量旋转,rad是弧度
Vector Rotate(Vector A,double rad){
    return Vector(A.x*cos(rad)-A.y*sin(rad),A.x*sin(rad)+A.y*cos(rad));
}
//计算向量的单位法线,先逆时针旋转90度，然后把长度归一化
Vector Normal(Vector A){
    double Len=Length(A);
    return Vector(-A.y/Len,A.x/Len);
}
//求两直线交点
//调用前请确保P+tv和Q+tw有唯一交点，当且仅当Cross(v,w)非0
Point GetLineIntersection(Point P,Vector v,Point Q,Vector w){
    Vector u=P-Q;
    double t=Cross(w,u)/Cross(v,w);
    return P+v*t;
}
//点到直线的距离
double DistanceToLine(Point P,Point A,Point B){
    Vector v1=B-A,v2=P-A;
    return fabs(Cross(v1,v2))/Length(v1);
}
//点到线段的距离
double DistanceToSegment(Point P,Point A,Point B){
    if(A==B) return Length(P-A);
    Vector v1=B-A,v2=P-A,v3=P-B;
    if(dcmp(Dot(v1,v2))<0) return Length(v2);
    else if(dcmp(Dot(v1,v3))>0) return Length(v3);
    else return fabs(Cross(v1,v2))/Length(v1);
}
//点在直线上的投影
Point GetLineProjection(Point P,Point A,Point B){
    Vector v=B-A;
    return A+v*(Dot(v,P-A)/Dot(v,v));
}

//判断两线段严格相交
bool SegmentProperIntersection(Point a1,Point a2,Point b1,Point b2){
    double c1=Cross(a2-a1,b1-a1), c2=Cross(a2-a1,b2-a1),
            c3=Cross(b2-b1,a1-b1), c4=Cross(b2-b1,a2-b1);
    return dcmp(c1)*dcmp(c2)<0 && dcmp(c3)*dcmp(c4)<0;
}
//判断点是否在线段上
bool OnSegment(Point P,Point a1,Point a2){
    return dcmp(Cross(a1-P,a2-P))==0 && dcmp(Dot(a1-P,a2-P))<=0;
}
//多边形的面积
double PolygonArea(Point* p,int n){
    double area=0;
    for(int i=1;i<n-1;i++){
        area+=Cross(p[i]-p[0],p[i+1]-p[0]);
    }
    return area/2;
}
int main(){
    int n;
    cin>>n;
    while(n--){
        Point A,B,C,D;
        cin>>A.x>>A.y>>B.x>>B.y>>C.x>>C.y>>D.x>>D.y;
        bool check1=SegmentProperIntersection(A,B,C,D);
        bool check2=OnSegment(A,C,D)||OnSegment(B,C,D)||OnSegment(C,A,B)||OnSegment(D,A,B);
        if(check1||check2){
            cout<<fixed<<setprecision(10)<<GetLineIntersection(A,B-A,C,D-C).x<<" "<<GetLineIntersection(A,B-A,C,D-C).y<<"\n";
        }
    }

}


Measured memory_bytes: 3292
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=5e18;

int main() {
  ll w,h;
  cin >> w >> h;
  vector<pll> a;
  for(ll i=0;i<w+h;i++) {
    ll tmp;
    cin >> tmp;
    a.push_back(pll(tmp,i<w));
  }
  sort(a.begin(),a.end());
  ll ans=0;
  w++,h++;
  for(auto t:a) {
    if(t.second) {
      ans+=t.first*h;
      w--;
    }
    else {
      ans+=t.first*w;
      h--;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 6256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
#include <iomanip>
//cout << fixed << setprecision(20) << *** << endl;
#define rep(i,N) for(int i=0;i<(int)N;++i)
typedef long long ll;
using namespace std;
int main()
{
	ll A,B;
	cin>>A>>B;
	if(A<=0&&B>=0){
		cout<<"Zero"<<endl;
		return 0;
	}
	if(A>0&&B>0){
		cout<<"Positive"<<endl;
	}
	else{
		if((abs(B)-abs(A)+1)%2==0){
			cout<<"Positive"<<endl;
		}
		else{
			cout<<"Negative"<<endl;
		}
	}

}

Measured memory_bytes: 380
#include<bits/stdc++.h>
#define ll          long long int
#define lld          long double
#define pb          push_back
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define vec         vector<ll>
#define all(a)     (a).begin(),(a).end()
#define F           first
#define S           second
#define mod         1000000007
#define rep(i,a,b)	for(ll  i=a;i<b;i++)
#define repi(i,a,b)	for(ll  i=a;i<=b;i++)
#define per(i,a,b)  for(ll i=a;i>=b;i--)
#define mp          make_pair
#define mit         map<ll,ll>::iterator
#define sit         set<ll>::iterator
#define pit         pair<ll,ll>::iterator
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;
ll xo(ll x, ll y) 
{ 
   return (x | y) & (~x | ~y); 
}  
ll bin_Expo(ll x,ll n)
{
		if(x==0)
		return 0;
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return bin_Expo(x*x,n/2);
    else                             //n is odd
        return x*bin_Expo(x*x,(n-1)/2);
}
ll mod_Expo(ll x,ll n,ll M)
{
		if(x==0)
		return 0;
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return mod_Expo((x*x)%M,n/2,M);
    else                             //n is odd
        return (x*mod_Expo((x*x)%M,(n-1)/2,M))%M;
 
}
bool prime_check(ll x)
{
    bool prime = (x >= 2);
    for (ll i = 2; i * i <= x; i++) 
    {
        if (x % i == 0) 
        {
            prime = false;
            break;
        }
    }
    return prime;
}
ll logg(ll base,ll x) 
{
    return (ll)(log(x) / log(base));
}
ll n,p; string s;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int TESTS=1;
//	cin>>TESTS;
    while(TESTS--)
    {
    	ll m,k,l,g,i,ans;
    	cin>>n>>p>>s;
    	ans=0; k=0;
    	map<ll,ll> mm;
    	rep(i,0,n)
    	{
    		if(p==2){
    			if((s[i]-'0')%p==0)
				ans+=i+1;
				k=1;	
			}
			else if(p==5){
				if((s[i]-'0')%p==0)
				ans+=i+1;	
				k=1;
			}
		}
		if(k==1)
		{
			cout<<ans;
			return 0;
		}
		l=1; g=0; mm[0]++;
		per(i,n-1,0)
		{
			g=(g+(((s[i]-'0')*l)%p))%p;
			ans+=mm[g]++;
			l=(l*10)%p;
		}
		cout<<ans;
	}
	return 0;
}

Measured memory_bytes: 1044
#include<bits/stdc++.h>
#define endl '\n'
#define mod 1000000007
typedef long long int ll;
using namespace std;
#define MAX 100005
ll power(ll a, ll b)
{
    ll res=1LL;
    while(b>0)
    {
        if(b&1LL) res=(res*a)%mod;
        b>>=1;
        a=(a*a)%mod;
    }
    return res%mod;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n; cin>>n;
    ll ans=power(10,n)-power(9,n)-power(9,n)+power(8,n);
    ans%=mod; ans+=mod; ans%=mod;
    cout<<ans<<endl;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
using ll = long long;
using ull = unsigned long long;
using vll = vector<long long>;
using pll = pair<ll, ll>;
#define FOR(i, begin, end) \
    for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) \
    for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define VREP(s, ite) for (auto ite = s.begin(); ite != s.end(); ++ite)
#define FI first
#define SE second
#define ALL(v) v.begin(), v.end()
#define endl "\n"
#define ciosup  \
    cin.tie(0); \
    ios::sync_with_stdio(false);
#define eb emplace_back
#define vint vector<int>
constexpr ll INF = 1e15 + 7LL;
constexpr ll MOD = 1e9 + 7LL;
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
    for (int i = 0; i < v.size(); ++i) {
        is >> v[i];
    }
    return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    if (v.size() == 0) return os;
    for (int i = 0; i < v.size() - 1; ++i) {
        os << v[i] << " ";
    }
    os << v[v.size() - 1];
    return os;
}

void solve() {
    int d, t, s;
    cin >> d >> t >> s;
    if (s*t >= d) {
        cout << "Yes" << endl;
    }else {
        cout << "No" << endl;
    }
}

int main() {
    solve();
    char tmp;
    while (cin >> tmp) {
        cin.putback(tmp);
        solve();
    }
}



Measured memory_bytes: 3548
#include <bits/stdc++.h>
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; }

typedef long long ll;
const ll MOD = 998244353;
const ll inf = 1LL<<60;
const double eps = 1e-9;

ll mod_pow(ll n, ll exponent, ll mod) {
    ll pow = 1;
    while(exponent > 0) {
        if((exponent & 1) == 1) {
            pow *= n;
            pow %= mod;
        }
        n *= n;
        n %= mod;
        
        // 桁をずらす
        exponent >>= 1;
    }
    return pow;
}

ll modpow(ll a, ll b)
{
  if(b == 0) return 1; 
  return modpow(a*a%MOD, b/2)*(b%2?a:1)%MOD;
}

int main()
{
    int n, tmp, mx = -1;
    cin >> n;
    vector<ll> d(100000, 0);
    for (int i = 0 ; i < n; i++) {
        cin >> tmp;
        if (i == 0 and tmp != 0) {
            cout << 0 << endl;
            return 0;
        }
        d[tmp]++;
        chmax(mx, tmp);
    }
    ll ans = 1;

    if (d[0] != 1) {
        cout << 0 << endl;
        return 0;
    }
    ll bef = 1;
    for (int i = 1; i <= mx; i++) {
        if (d[i] == 0) {
            cout << 0 << endl;
            return 0;
        }
        ll now = d[i];
        (ans *= modpow(bef, now))%=MOD;
        bef = d[i];
    }
    
    cout << ans << endl;
    return 0;
}


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

int main() {
  string S;
  cin >> S;
  
  if(S == "AAA") cout << "No" << endl;
  else if(S == "BBB") cout << "No" << endl;
  else cout << "Yes" << endl;
  
  return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include<iostream>
#include<algorithm>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<deque>
#include<queue>
#include<map>
#include<set>
#define ll long long
#define str string
#define ld long double
#define vec vector
#define vll vec<ll>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,b,a) for(ll i=b;i>=a;i--)
#define ALL(a) a.begin(),a.end()
#define rALL(a) a.rbegin(),a.rend()
#define kai "\n"
#define yuque priority_queue
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mie min_element
#define mae max_element
#define tos to_string
#define sep setprecision
#define lob lower_bound
#define upb upper_bound
#define nep next_permutation
#define MOD 1000000007ll
#define MIN (1e-10)
#define equal(a,b) (abs((a)-(b))<MIN)
#define v2 ten
#define chokusen senbun
#define kakkei vec<ten>
using namespace std;
void solve();
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed;
	solve();
}
struct pea{
	ll f,s;
	bool operator<(const pea &p)const{
		return f!=p.f?f<p.f:s<p.s;
	};
};
struct tri{
	ll f,s,t;
	bool operator<(const tri &p)const{return f<p.f;};
};
class ten{
public:
	ld x,y;
	ten operator+(ten p){return{x+p.x,y+p.y};}
	ten operator-(ten p){return{x-p.x,y-p.y};}
	ten operator*(ld k){return{k*x,k*y};}
	ten operator/(ld k){return{x/k,y/k};}
	ld abs(){return sqrt(abs2());}
	ld abs2(){return x*x+y*y;};
	bool operator<(const ten &p)const{return x!=p.x?x<p.x:y<p.y;};
	bool operator==(const ten &p)const{return (-MIN<x-p.x)&&(x-p.x<MIN)&&(-MIN<y-p.y)&&(y-p.y<MIN);};
	ld naiseki(v2 b){return x*b.x+y*b.y;}
	ld gaiseki(v2 b){return x*b.y-y*b.x;}
};
struct senbun{ten p1,p2;};
struct en{ten o;ld r;};
ten shaei(ten p,chokusen l){
	v2 a=l.p2-l.p1;
	return l.p1+a*a.naiseki(p-l.p1)/a.abs2();
}
ten hansha(ten p,chokusen l){return shaei(p,l)*2-p;}
ld tenchoku(ten p,chokusen l){
	v2 a=l.p2-l.p1;
	return abs(a.gaiseki(p-l.p1))/a.abs();
}
ld tensen(ten p,senbun s){
	if((p-s.p1).naiseki(s.p2-s.p1)<0)return (p-s.p1).abs();
	if((p-s.p2).naiseki(s.p1-s.p2)<0)return (p-s.p2).abs();
	return tenchoku(p,s);
}
ll ccw(ten p0,ten p1,ten p2){
	v2 a=p1-p0,b=p2-p0;
	if(a.gaiseki(b)>MIN)return -1;//012反時計回り
	if(a.gaiseki(b)<-MIN)return 1;//012時計回り
	if(a.naiseki(b)<-MIN)return -2;//102
	if(a.abs2()<b.abs2())return 2;//012
	return 0;//021
}
bool majiwaru(senbun s,senbun t){return ccw(s.p1,s.p2,t.p1)*ccw(s.p1,s.p2,t.p2)<=0&&ccw(t.p1,t.p2,s.p1)*ccw(t.p1,t.p2,s.p2)<=0;}
ld sensen(senbun s,senbun t){
	if(majiwaru(s,t))return 0;
	return min({tensen(s.p1,t),tensen(s.p2,t),tensen(t.p1,s),tensen(t.p2,s)});
}
ten koten(senbun s,senbun t){
	v2 a=t.p2-t.p1;
	ld d1=abs(a.gaiseki(s.p1-t.p1));
	ld d2=abs(a.gaiseki(s.p2-t.p1));
	return s.p1+(s.p2-s.p1)*d1/(d1+d2);
}
void solve(){
	ll n;cin>>n;
	cout<<sep(10);
	rep(i,0,n){
		ld a,b,c,d,e,f,g,h;
		cin>>a>>b>>c>>d>>e>>f>>g>>h;
		senbun l={{a,b},{c,d}};
		senbun m={{e,f},{g,h}};
		ten k=koten(l,m);
		cout<<k.x<<" "<<k.y<<kai;
	}
}


Measured memory_bytes: 3316
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include<stack>
#include <unordered_map>

using namespace std;

#define MAX(A,B) (A)>(B)?(A):(B)
#define MIN(A,B) (A)<(B)?(A):(B)

int gcd(int a, int b) {
	return b == 0 ? a : gcd(b, a % b);
}

int main() {
	int N, i;
	cin >> N >> i;
	cout << N - i + 1;
	return 0;
}


Measured memory_bytes: 256
/**
 * Created on 2016/08/31.
 */

import java.util.*;

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

        int N = sc.nextInt();
        int A = sc.nextInt();

        int[] nums = new int[N];
        long X = -1;
        for(int i=0; i<N; i++){
            nums[i] = sc.nextInt();
            X = Math.max(nums[i], X);
        }

        long ans = solve(N, A, nums, (int)X);

        System.out.println(ans);
    }

    private static long solve(int N, int A, int[] nums, int X) {

        long[][][] dp = new long[N+1][N+1][N*X + 1];

        dp[0][0][0] = 1L;

        for(int i=1; i<N+1; i++){
            for(int j=0; j<N+1; j++){
                for(int k=0; k<N*X+1; k++){

                    int prevJ = j-1;
                    int prevK = k-nums[i-1];


                    if(prevJ < 0 || prevK < 0){
                        dp[i][j][k] = dp[i-1][j][k];
                    }else{
                        dp[i][j][k] = dp[i-1][prevJ][prevK] + dp[i-1][j][k];
                    }
                }
            }
        }

        long ret = 0;
        for(int t=1; t<=N; t++){
            if(t*A <= t*X) {
                ret += dp[N][t][t * A];
            }
        }

        return ret;
    }


    // Algorithms
    private static ArrayList<Integer> getPrimeNumbers(int upperLimit) {
        ArrayList<Integer> ret = new ArrayList<Integer>();

        ret.add(2);
        ret.add(3);

        for (int i = 5; i <= upperLimit; i += 2) {
            boolean isPrime = true;
            // 素数で平方根まで試し割りしてみる
            for (int j = 2; j * j <= i; j++) {
                if (i % j == 0) {
                    isPrime = false;
                    break;
                }
            }

            if (isPrime) {
                ret.add(i);
            }
        }
        return ret;
    }

    // View Method
    //* List
    public static <T> void viewList(List<T> list) {
        for (T item : list) {
            System.out.print(item + "\t");
        }
        System.out.println("");
    }

    //* Map
    public static <K, V> void viewMap(Map<K, V> map) {
        Set<K> keys = map.keySet();
        for (K key : keys) {
            System.out.print("(" + key + ", " + map.get(key) + ")\t");
        }
        System.out.println("");
    }

    //* Matrix
    public static void viewIntMatrix(int[][] matrix) {
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix[i].length; j++) {
                System.out.print(matrix[i][j] + "\t");
            }
            System.out.println("");
        }
    }
}


Measured memory_bytes: 77520
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = (sc.nextInt() + 13) % 15;
		int b = (sc.nextInt() + 13) % 15;
		
		System.out.println(a > b ? "Alice" : a < b ? "Bob" : "Draw");
		
		sc.close();
	}
}



Measured memory_bytes: 27072
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<cstdlib>
#include<cmath>
#include<numeric>
using namespace std;
using ll =long long;

int main() {
	string S,T;
	int A, B;
	string U;
	cin >> S >> T >> A >> B >> U;
	
	S == U ? cout << A - 1 << " " << B : cout << A << " " << B-1;


}

Measured memory_bytes: 256
// organize and work - Abhinav IIITA
#include <bits/stdc++.h>
using namespace std;
#define int long long 
void q1(){
	int a,b;
	cin>>a>>b;
	if(a<10 && b<10)
	cout<<a*b;
	else
	cout<<"-1";
}
void q2(){
	int n;cin>>n;
	int fg=0;
	for(int i=1;i<=9;++i)
	if(n%i==0){
		int ano=n/i;
		if(ano<=9 && ano>=1)
		fg=1;
	}
	fg==1 ? cout<<"Yes\n" : cout<<"No\n";
}
void q3(){
	int n;
	cin>>n;
	int xp=sqrt(n);
	int f;
	while(n%xp!=0)
	xp--;
	f=n/xp;
	int s=f+xp-2;
	cout<<s;
}
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	t=1;
	while(t--)
	q3();
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
constexpr ll INF = LLONG_MAX;
constexpr double DINF = DBL_MAX;
constexpr ll mod = 1e9+7;
constexpr double PI = M_PI;

template<typename T>
vector<T> make_v(size_t a){
  return vector<T>(a);
}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))> (a,make_v<T>(ts...));
}

int main(){
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
 
  long long d;
  string s;
  cin >> s >> d;
  long long n = (ll)s.size();
  auto dp = make_v<ll>(n+1, d, 2);
  // dp[i+1][j][k] := 先頭からi文字目まで見たときに
  //                桁和をdで割った余りがjになるs以下の数の個数
  //                k = ( 先頭i文字目までsと一致しているか ? 1 : 0)
  dp[0][0][1] = 1;
  for(int i = 0; i < n; i++){
    for(int j = 0; j < d; j++){
      for(int k = 0; k < 10; k++){
        for(int l = 0; l < 2; l++){
          if(l == 1 and s[i]-'0' < k) continue;
          dp[i+1][(j+k) % d][s[i]-'0' == k and l] += dp[i][j][l];
          dp[i+1][(j+k) % d][s[i]-'0' == k and l] %= mod;
        }
      }
    }
  }
  cout << (dp[n][0][0] + dp[n][0][1] - 1 + mod)%mod << endl;
  return 0;
}

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

int main() {
	int A[100],n;

	cin >> n;
	for (int i = 0; i < n; i++) cin >> A[i];

	for (int i=0; i < n; i++) {
		int v = A[i];
		int j = i - 1;
		while ((j >= 0) && (A[j] > v)) {
			A[j + 1] = A[j];
			j--;
		}
		A[j + 1] = v;
		cout << A[0];
		for (int k = 1; k < n; k++) {
			cout << ' ';
			cout << A[k];
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 3088
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<iomanip>
#include<map>
#include<utility>
#include<string>
#include<unordered_map>
#include<queue>

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

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
int gcd(int a, int b){return b ? gcd(b, a%b) : a;}
int lcm(int a, int b){return a*b / gcd(a, b);}

int main(){
    string num; cin >> num;
    int n = num.size();
    bool nine = true;
    for(int i = 1; i < n; i++){
        if((num[i]-'0') != 9){
            nine = false;
            break;
        }
    }
    if(nine == true) cout << (num[0]-'0')+9*(n-1) << endl;
    else cout << (num[0]-'0')+9*(n-1)-1 << endl;
    return 0;
}


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

using namespace std;

#define N 2005

int n,ans;
bitset<N> a[N],f[N],g[N];
char s[N][N];

int main(){
	scanf("%d",&n);
	for (int i=2;i<=n;++i){
		scanf("%s",s[i]+1);
		for (int j=1;j<i;++j){
			a[i][j]=s[i][j]-'0';
			a[j][i]=a[i][j]^1;
		}
	}
	for (int i=1;i<=n;++i){
		f[i][i]=g[i][i]=1;
		for (int j=1;j<i;++j)
			if (g[i-1][j]&&a[i][j]) f[i]|=f[j];
		for (int j=1;j<i;++j)
			if (f[i][j+1]&&a[j][i]) g[i]|=g[j];
	}
	for (int i=1;i<=n;++i) ans+=f[i][1]&&g[n][i];
	printf("%d\n",ans);
	
	return 0;
}
			

Measured memory_bytes: 5632
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstdlib>
using namespace std;

int main(){
  string s;
  cin >> s;
  s.erase(7, 1);
  s.erase(4, 1);
  int n = stoi(s);
  if (n > 20190430) {
    cout << "TBD" << endl;
  } else {
    cout << "Heisei" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h> //Ithea Myse Valgulious
namespace chtholly{
typedef long long ll;
#define re0 register int
#define rec register char
#define rel register ll
#define gc getchar
#define pc putchar
#define p32 pc(' ')
#define pl puts("")
/*By Citrus*/
inline int read(){
  int x=0,f=1;char c=gc();
  for (;!isdigit(c);c=gc()) f^=c=='-';
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return f?x:-x;
  }
inline void read(rel &x){
  x=0;int f=1;char c=gc();
  for (;!isdigit(c);c=gc()) f^=c=='-';
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  x=f?x:-x;
  }
template <typename mitsuha>
inline int write(mitsuha x){
  if (!x) return pc(48);
  if (x<0) x=-x,pc('-');
  re0 bit[20],i,p=0;
  for (;x;x/=10) bit[++p]=x%10;
  for (i=p;i;--i) pc(bit[i]+48);
  }
inline char fuhao(){
  rec c=gc();
  for (;isspace(c);c=gc());
  return c;
  }
}using namespace chtholly;
using namespace std;
int main(){
int n=read();
write(n*800-n/15*200);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	if((a==1 && b==2) || (a==2 && b==1))
	{
		printf("3");
	}
	if((a==1 && b==3) || (a==3 && b==1))
	{
		printf("2");
	}
	if((a==3 && b==2) || (a==2 && b==3))
	{
		printf("1");
	}
	return 0;
} 

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std ;
typedef  long long int ll ;
#define inf 9e18
#define mod 1000000007
#define mod1 998244353
long long int power(long long int a,long long int n,long long int m) ;
 long long int power(long long int a,long long int n,long long int m)
{  if(n==0)
   return 1 ;
   long long int x=power(a,n/2,m) ;
   if(n%2!=0)
    return (((a*x)%m)*(x)%m)%m ;
    else return (x*x)%m ;
}


int main()
{ ll n,i,j,x,y,m,k,t,sum,count,cnt,b,c,d,j1,z,a,o;
  ios_base::sync_with_stdio(false);
   cin.tie(NULL);
  cin>>n ;
  ll arr[n+1] ;
  for(i=1;i<=n;i++)
    cin>>arr[i] ;
  map<ll,ll> p;
  cnt=0 ;
  for(i=1;i<=n;i++)
  {  //cout<<i+arr[i]<<" " ;
       if(p.find(i-arr[i])!=p.end())
     cnt+=p[i-arr[i]] ;
     p[i+arr[i]]++ ;
    // cout<<p[i+arr[i]]<<" " ;

  } cout<<cnt<<"\n" ;
  return 0; }


Measured memory_bytes: 17528
#include<bits/stdc++.h>
#define LL long long
#define MEM(x,y) memset(x,y,sizeof(x))
#define MOD(x) ((x)%mod)
#define mod 1000000007
#define pb push_back
#define STREAM_FAST ios::sync_with_stdio(false)

using namespace std;
const int maxn = 2e5+7;
int n;
LL a[maxn],sum[maxn],c[maxn*2];
vector<LL>v;
int lowbit(int x) {return x&(-x);}


void add(int now,LL val)
{
    while (now<=n+1) c[now]+=val,now+=lowbit(now);
}

LL getsum(int now)
{
    LL sum=0;
    while (now>0)
    {
        sum+=c[now];
        now-=lowbit(now);
    }
    return sum;
}

LL get(int l,int r)
{
    return getsum(r)-getsum(l-1);
}

int getid(LL x)
{
    return lower_bound(v.begin(),v.end(),x)-v.begin()+1;
}

int main()
{
    LL k;scanf("%d%lld",&n,&k);
    for (int i=1;i<=n;i++) scanf("%lld",&a[i]),a[i]-=k;
    sum[0]=0;for (int i=1;i<=n;i++) sum[i]=sum[i-1]+a[i],v.pb(sum[i]);
    v.pb(0);
    sort(v.begin(),v.end());
    v.erase(unique(v.begin(),v.end()),v.end());


    LL ans=0;
    for (int i=n;i>=0;i--)
    {
        int id=getid(sum[i]);
        ans+=get(id,n+1);
        add(id,1);
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 7664
// Best practice

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <functional> // for less 

#define int         long long
#define pb          emplace_back
#define pf          emplace_front
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
#define x           first
#define y           second
#define endl        '\n'
#define tezz        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define MOD         1000000007
using namespace std;
using namespace __gnu_pbds; 
 
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> pbds; 

#define fbo find_by_order
#define ook order_of_key

int power(int x, int y, int p) 
{ 
    int res = 1;      // Initialize result 
  
    x = x % p;  // Update x if it is more than or 
                // equal to p 
  
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x) % p; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % p; 
    } 
    return res; 
} 
  
// Returns n^(-1) mod p 
int modInverse(int n, int p) 
{ 
    return power(n, p-2, p); 
} 
int ncr(int n, int r, int p) 
{ 
   // Base case 
   if (r==0) 
      return 1; 
  
    // Fill factorial array so that we 
    // can find all factorial of r, n 
    // and n-r 
    int fac[n+1]; 
    fac[0] = 1; 
    for (int i=1 ; i<=n; i++) 
        fac[i] = fac[i-1]*i%p; 
  
    return (fac[n]* modInverse(fac[r], p) % p * 
            modInverse(fac[n-r], p) % p) % p; 
} 

double dis(pair<int,int> a, pair<int,int> b){
    double x;
    x=sqrt( (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y) );
    return x;
}

signed main() {
   tezz
   
   int n;
   cin >> n;
   vector<pair<int,int>> a(n);
   for(int i=0; i<n; i++){
       cin >> a[i].x >> a[i].y;
   }
   double c=0;
   for(int i=0; i<n;i++){
       for(int j=0; j<n; j++){
           c+=dis(a[i],a[j]);
       }
   }
   cout << setprecision(15) << c/n;
  
   return 0;
}



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

ball = [0]*n

for i in reversed(range(1, n+1)):

    a[i-1] ^= sum(ball[i-1:n:i]) % 2
    
    if a[i-1] == 1:
        ball[i-1] =1


if sum(ball) > 0:
    print(sum(ball))
    print(*[i+1 for i in range(n) if ball[i] > 0]) 

else:
    print(0)

Measured memory_bytes: 13116
//Ruthless Coding 
#include <bits/stdc++.h>

#define uni(x)      (x).resize(unique(ALL(x)) - (x).begin())
#define fprint(v)   for(auto x : v) cout << x << ' '
#define ALL(x)      (x).begin(), (x).end()
#define MP(x, y)    make_pair(x, y)
#define SZ(x)       int((x).size())
#define PB(x)       push_back(x)
#define ll          long long
#define S           second 
#define F           first
#define nl          '\n'

using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
mt19937_64 rnd;

const int N = 2e5 + 5;

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n, m, xx;
    cin >> n >> m >> xx;
    vector<pair<int, vector<int> > > v;
    for(int i = 0; i < n; i++){
        int p;
        cin >> p;
        vector<int> t(m);
        for(auto &x : t){
            cin >> x;
        }
        v.PB(MP(p, t));
    }
    // sort(ALL(v));
    function<int(vector<int>)> get = [&](vector<int> id){
        int cost = 0;
        vector<int> un(m, 0);
        for(auto &i : id){
            cost += v[i].F;
            for(int j = 0; j < m; j++){
                un[j] += v[i].S[j];
            }
        }
        bool ok = true;
        for(auto &i : un){
            ok &= (i >= xx);
        }
        if(ok){
            return cost;
        }
        return INT_MAX;
    };
    int ans = INT_MAX;
    for(int i = 0; i < (1 << n); i++){
        vector<int> id;
        for(int j = 0; j < n; j++){
            if(i & (1 << j)){
                id.PB(j);
            }
        }
        ans = min(ans, get(id));
    }
    if(ans == INT_MAX){
        cout << -1;
    }else{
        cout << ans;
    }
    return 0;
}
/*
    *** Most Impo.. -> check base case always
    1. Overflow Check (*, +)
    2. Index check (0 - based or 1 - based)
    3. Check for n = 1, 2, 3, 4....
    4. Corner Cases
*/

Measured memory_bytes: 3580
#include<iostream>
using namespace std;
#define MAX 200005
unsigned long long int mark[MAX];
unsigned long long int tmp;
unsigned long long int l[MAX];
unsigned long long int r[MAX];
unsigned long long int merge(unsigned long long int left, unsigned long long int right) 
{
	unsigned long long int lf = 0;
	unsigned long long int rt = 0;	
	unsigned long long int ans = 0;

	unsigned long long int mid = (left + right) / 2;
	//if (mid == 2 && left == 0 && right == 5)
	//	tmp = 1;


	//cout << "数组l：  ";
	for (unsigned long long int i = 0; i < mid - left; ++i) 
	{
		l[i] = mark[left + i];
	//	cout << l[i] << ' ';
	}
	//cout << endl << endl;
	//cout << "数组r：   ";
	for (unsigned long long int i = 0; i < right - mid; ++i) 
	{
		r[i] = mark[mid + i];
	//	cout << r[i] << ' ';
	}
	//cout << endl << endl;
	for (unsigned long long int i = 0; i < right - left; ++i) 
	{
		if (lf < mid - left && rt < right - mid) 
		{
			if (r[rt] < l[lf]) 
			{
				//cout << r[rt] << endl;
				mark[left + i] = r[rt];
				++rt;
				ans += mid - left - lf;
			}
			else 
			{
				//cout << l[lf] << endl;
				mark[left + i] = l[lf];
				++lf;
			}
		}
		else if (lf < mid - left) 
		{
			while (lf < mid - left)
			{
				//cout << l[lf] << ' ';
				mark[left+i] = l[lf];
				++lf;
				++i;
			}
			break;
		}
		else 
		{
			while (rt < right-mid)
			{
				//cout << r[rt] << ' ';
				mark[left+i] = r[rt];
				++rt;
				++i;
			}
			break;
		}
	}

	return ans;
}

unsigned long long int mergesort(unsigned long long int left, unsigned long long int right) 
{
	if (left + 1 < right)
		return mergesort(left, (left + right) / 2) + mergesort((left + right) / 2, right) + merge(left, right);
	return 0;
}

int main()
	{
	//cout << unsigned long long int32_MAX << endl;
	unsigned long long int n;
	cin >> n;
	//unsigned long long int Min = mark[0];
	for (unsigned long long int i = 0; i < n; ++i)
		cin>>mark[i];
	cout << mergesort(0, n)<<endl;
	return 0;
}




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

int main(void){
  string a,b,c;

  cin>>a>>b>>c;

  if(a[a.length()-1]==b[0]&&b[b.length()-1]==c[0])
    printf("YES\n");
  else
    printf("NO\n");

  return 0;
}


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

int calc(int a, int b){
	int res = 0, c = 0;
	while(a || b){
		res += (a%10)*(b%10)+c;
		c = (a%10)+(b%10)+c>=10;
		a /= 10;
		b /= 10;
	}
	return res+c;
}

int n;
main(){
	cin >> n;
	vector<int> d(n), s(n+1);
	for(int i=0;i<n;i++){
		cin >> d[i];
		s[i+1] = (s[i] + d[i]);
	}
	vector<vector<int> > dp(n+1, vector<int>(n+1, 1000000000));
	for(int i=0;i<n;i++) dp[i][i+1] = 0;
	for(int j=2;j<=n;j++)for(int i=0;i+j<=n;i++){
		for(int k=1;k<j;k++){
			dp[i][i+j] = min(dp[i][i+j], dp[i][i+k] + dp[i+k][i+j] + calc(s[i+k]-s[i], s[i+j]-s[i+k]));
		}
	}
	cout << dp[0][n] << endl;
}

Measured memory_bytes: 1536
N = int(input())
A = [int(x) for x in input().split()]
ret = 0
for state in range(1 << N):
    flag = False
    ans = 1
    for i in range(N):
        if (state >> i & 1):
            if A[i] % 2 == 1:
                flag = True
            ans *= 2
        else:
            if A[i] % 2 == 0:
                flag = True
    if flag:
        ret += ans
print(ret)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define sz(x) int(x.size())
#define pb push_back
#define eb emplace_back
using ll=long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
const ll MOD=1000000007,MOD2=998244353;



int main() {
    rep(i,5){
        int x;
        cin>>x;
        if(x==0){
            cout<<i+1<<endl;
            return 0;
        }
    }
}

Measured memory_bytes: 3504
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
 
using namespace std;
 
#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
 
template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }
 
typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
 
int main(){
  int N;
  int a[100][100];
  cin >> N;
  REP(i, N) REP(j, N) cin >> a[i][j];
  int sum[101][101] = {};
  REP(i, N) REP(j, N) sum[i + 1][j + 1] = sum[i + 1][j] + sum[i][j + 1] - sum[i][j] + a[i][j];
  int ans = -10000;
  REP(i, N) FOR(j, i, N) REP(k, N) FOR(l, k, N){
    ans = max(ans, sum[j + 1][l + 1] - sum[i][l + 1] - sum[j + 1][k] + sum[i][k]);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3148
#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 <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype>// isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <iomanip>
using namespace std;
int main(){
   int n;
   cin >> n;
   cout << fixed << setprecision(7);
   double s=0.000000,b=1.000000;
   vector<vector<double>> a(n,vector<double>(2));
   for(int i=0; i<n;i++){
       cin >>a.at(i).at(0)>>a.at(i).at(1);
   }
   for(int i=0; i<n;i++){
       for(int j =i+1; j< n;j++){
           double x,y;
           x=(a.at(i).at(0)-a.at(j).at(0))*(a.at(i).at(0)-a.at(j).at(0))*1.000000000000;
           y=(a.at(i).at(1)-a.at(j).at(1))*(a.at(i).at(1)-a.at(j).at(1))*1.000000000000;
           s+=(sqrt(x+y))*2.000000;
       }
   }
   cout << s/n<< endl;
}

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

#define rep(i, a, n)  for(ll i=a; i<n; i++)
#define per(i, a, n)  for(ll i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define LONGMAX 1e18
#define INTMAX 1000000000
using namespace std;
typedef long long ll;
typedef pair<ll,ll> p;

int r, D, x;

int main(){
  cin >> r >> D >> x;
  int ans = 0;
  for(int i=0;i<10;i++){
    ans = r * x - D;
    cout << ans << endl;
    x = ans;
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(m);(i)<(n);++(i))
#define rrep(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr ll INF = (ll)1e9;
constexpr ll mod = (ll)1e9 + 7;
constexpr double PI = 3.1415926535897932;
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;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}


int main() {
	init();

	string s; cin >> s;
	int K; cin >> K;
	rep(i, 0, s.size()) {
		if (s[i] == 'a')continue;
		int cnt = 'z' - s[i] + 1;
		if (cnt <= K) {
			s[i] = 'a';
			K -= cnt;
		}
	}
	K %= 26;
	s[s.size() - 1] += K;
	cout << s << "\n";

	return 0;
}

Measured memory_bytes: 3748
a = gets.to_i
b = gets.to_i
c = gets.to_i
x = gets.to_i
res = 0
[*0..a].reverse.each do |i|
    next if 500 * i > x
    [*0..b].reverse.each do |j|
        next if (500 * i + 100 * j) > x
        [*0..c].reverse.each do |k|
            res += 1 if (500 * i + 100 * j + 50 * k) == x

        end
    end
end
puts res

Measured memory_bytes: 2940
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

class Program
{

    static void Main()
    {
        var sc = new Scanner();
        string c = Console.ReadLine();
        if (c=="a"||c=="i"||c=="u"||c=="e"||c=="o")
        {
            Console.WriteLine("vowel");
        }
        else
        {
            Console.WriteLine("consonant");
        }
    }
}
static class Extentions
{
    public static IEnumerable<T> Outpuut<T>(this IEnumerable<T> source)
    {
        foreach (var item in source)
        {
            Console.WriteLine(item);
        }
        return source;
    }
    public static T Print<T>(this T obj)
    {
        Console.WriteLine(obj);
        return obj;
    }
}
public class Scanner
{
    public Scanner()
    {
        byte[] inputBuffer = new byte[1024];
        System.IO.Stream inputStream = Console.OpenStandardInput(inputBuffer.Length);
        Console.SetIn(new System.IO.StreamReader(inputStream, Console.InputEncoding, false, inputBuffer.Length));
    }
    string[] buffer = new string[0];
    int index = 0;
    public char[] SplitChars { get; set; }
    public string String()
    {
        if (index < buffer.Length) return buffer[index++];
        string line = "";
        while (line == "") line = Console.ReadLine();
        if (line == null) return null;
        buffer = line.Split(SplitChars, StringSplitOptions.RemoveEmptyEntries);
        index = 0;
        return buffer[index++];
    }
    public string[] StringArray(int count) { return NextArray(count, x => x); }
    public void Skip(int count) { for (int i = 0; i < count; i++) String(); }
    public T Next<T>(Func<string, T> parser) { return parser(String()); }
    public T[] NextArray<T>(int count, Func<string, T> parser)
    {
        var arr = new T[count];
        for (int i = 0; i < count; i++) arr[i] = Next(parser);
        return arr;
    }
    public int Int() { return Next(int.Parse); }
    public int[] IntArray(int count) { return NextArray(count, int.Parse); }
    public double Double() { return Next(double.Parse); }
    public double[] DoubleArray(int count) { return NextArray(count, double.Parse); }
}


Measured memory_bytes: 2648
#include <bits/stdc++.h>
using namespace std;
int main (){
  long long int i,n,t=0;
  cin>>n;
  for(i=1;i<=n;i++){
    if(i%3!=0&&i%5!=0){
      t+=i;
    }
  }
  cout<<t<<endl;
  return 0;
}


Measured memory_bytes: 3608
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
#define all(v) (v).begin(), (v).end()
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1ll << 60;

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

int N;
ll a[401];

ll b[404];

void init() {
    rep(i, 1, N) a[i] += a[i - 1];
}

ll get(int l, int r) {
    ll rsl = a[r];
    if(l) rsl -= a[l - 1];
    return rsl;
}

ll memo[404][404];
int vis[404][404];

ll dp(int l, int r) {
    if(l == r) return 0;
    if(vis[l][r]) return memo[l][r];
    vis[l][r] = 1;

    ll rsl = INF;
    rep(i, l, r) chmin(rsl, dp(l, i) + dp(i + 1, r) + get(l, r));
    return memo[l][r] = rsl;
}

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

    cin >> N;
    rep(i, 0, N) cin >> a[i];
    init();
    cout << dp(0, N - 1) << endl;

}


Measured memory_bytes: 2176
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def solve():
    S, W = Scanner.map_int()
    if W >= S:
        print('unsafe')
    else:
        print('safe')


def main():
    # sys.stdin = open("sample.txt")
    solve()


if __name__ == "__main__":
    main()


Measured memory_bytes: 72816