akhauriyash/Code-Regression huggingface dataset:
s = input().split()
num = int(s[0])
total = int(s[1])
max_num = total//2 #全部２だった時のnumの最大値
tmp = max_num//2 #numを２で割った時の商、tmp回はmax_numから引ける
min_num = max_num - tmp
if total%2 ==1:
    print("No")
elif num <= max_num and min_num <= num:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 9084
#include <iostream>
#include <vector>
using namespace std;
int main(){
    long long N;
    cin >> N;
    vector<long long> a(5);
    for(int i = 0; i < 5; i++) cin >> a[i];
    long long b = 1e17;
    for(int i = 0; i < 5; i++) b = min(b, a[i]);
    long long t = (N + b - 1) / b;
    long long ans = 5 + t - 1;
    cout << ans << endl;
}

Measured memory_bytes: 3608
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
using namespace std;
typedef long long ll;

int A,P;

int main(){
    cin>>A>>P;

    cout<<(A*3+P)/2<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <utility>
#include <random>
#include <chrono>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>

using namespace std;

using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
using PIL = pair<int, LL>;
using PLL = pair<LL, LL>;
// const int mod = 1e9 + 7;
// const int mod = 998244353;

inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

inline void work() {
    int x;
    cin >> x;
    x /= 100;
    if (x >= 4 && x < 6) cout << 8 << endl;
    else if (x >= 6 && x < 8) cout << 7 << endl;
    else if (x >= 8 && x < 10) cout << 6 << endl;
    else if (x >= 10 && x < 12) cout << 5 << endl;
    else if (x >= 12 && x < 14) cout << 4 << endl;
    else if (x >= 14 && x < 16) cout << 3 << endl;
    else if (x >= 16 && x < 18) cout << 2 << endl;
    else cout << 1 << endl;
    return;  
}

int main() {
    // freopen(".txt", "r", stdin);
    quickread();
    work();
    return 0;
}

Measured memory_bytes: 3648
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
//#include <random>
//#include <unordered_set>
#include <complex>
using namespace std;
int main()
{
    long long n,y,i,j,k;
    cin>>n>>y;
    for(i=0;i<=n;i++) 
        for(j=0;j<=n-i;j++) 
        {
            k=n-i-j;
            if(((i*10000)+(j*5000)+(k*1000))==y)
            {
                cout<<i<<" "<<j<<" "<<k;
                system ("pause");
                return 0;
            }
        }
    cout<<"-1 -1 -1";
    system ("pause"); 
    return 0;
}


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

int main() {
  int s, s1, s2, s3;

  cin >> s;
  
  s1 = s / 100;
  s2 = (s - s1 * 100) / 10;
  s3 = s - s1 * 100 - s2 * 10;
  
  cout << s1 + s2 + s3 << endl;
}

Measured memory_bytes: 256
#include<cstdio>
using namespace std;
int n,m;
int main(){
	scanf("%d",&n);
	m=n;while(!(m&1)) m>>=1;
	if(m==1){puts("No");return 0;}
	puts("Yes");
	printf("1 2\n2 3\n3 %d\n%d %d\n%d %d\n",n+1,n+1,n+2,n+2,n+3);
	for (int i=4;i<n;i+=2)
	printf("1 %d\n%d %d\n1 %d\n%d %d\n",i,i,i+1,n+i+1,n+i+1,n+i);
	if(!(n&1)) printf("%d %d\n%d %d\n",n,n+n-1,n<<1,n^n-1^1);
	return 0;
}

Measured memory_bytes: 2304
#include<bits/stdc++.h>
using namespace std;
int a[100007];
int main(){
    int n;
    while(~scanf("%d",&n)){
        memset(a,0,sizeof(a));
        for(int i=1;i<=n;i++){
            int t;
            scanf("%d",&t);
           if(t!=0) a[t-1]++;
            a[t]++;
            a[t+1]++;
            //printf("%d  %d  %d\n",t-1,t,t+1);
        }
        sort(a+1,a+100001);
        printf("%d\n",a[100000]);
    }
    return 0;
}


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

#define SORT(c) sort((c).begin(), (c).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
#define ANS(ans) cout << (ans) << endl;
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
typedef vector<int> VI;
typedef pair<int, int> P;

// repetition
//------------------------------------------
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define REP(i, n) for (long long i = 0; i < (n); ++i)

int main() {
  int n, k, r, s, p;
  cin >> n >> k >> r >> s >> p;

  map<char, int> points;
  points['r'] = r;
  points['s'] = s;
  points['p'] = p;

  string T;
  cin >> T;

  string myHands;

  int ans = 0;

  REP(i,n){
    char ch = T[i];
    if(ch=='r'){
      myHands.push_back('p');
    } else if (ch == 's') {
      myHands.push_back('r');
    } else if (ch == 'p') {
      myHands.push_back('s');
    }
  }

  REP(i,n){
    char me = myHands[i];
    if(i-k<0){
      ans += points[me];
    }else{
      if(myHands[i-k]==me){
        myHands[i] = 'x';
      }else{
        ans += points[me];
      }
    }
  }

  ANS(ans);
  return 0;
}


Measured memory_bytes: 640
#include<stdio.h>
#include<string.h>
int x[10000000];
int y[10000000];
int z[10000000];
int main()
{
	int a=0,b,c,d=0,e,f,g=0,i,j;
	scanf("%d",&f);
	for(i=0;i<f;i++)
	{
		scanf("%d",&x[i]);
		y[i]=x[i];
	}
	
	for(i=0;i<f;i++)
	{
		a=x[i];
		b=y[a-1];
		z[b]=x[i];
	}
	for(i=1;i<=f;i++)
	{
		printf("%d\n",z[i]);
	}
	return 0;
}
	


Measured memory_bytes: 5248
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
#include <iomanip>
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
using namespace std;
ll mod = 1e9 + 7;

using namespace std;



int main()

{
	int N,M;

	cin >>N>>M;
	vector<vector<int>> student(N, vector<int>(N));
	vector<vector<int>> point(M, vector<int>(M));
	vector<int> a(N);
	vector<int> b(N);
	vector<int> c(M);
	vector<int> d(M);



	for (int i = 0; i < N; i++)
	{
		cin >> a[i] >> b[i];
	}
	for (int i = 0; i < M; i++)
	{
		cin >> c[i] >> d[i];
	}

	vector<int> manh(N);
	vector<int> ans(N);
	for (int i = 0; i < N; i++)
	{
		manh[i] = abs(a[i] - c[0]) + abs(b[i] - d[0]);
		ans[i] = 1;
	}
	
	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j < M; j++)
		{
			int moi = abs(a[i] - c[j]) + abs(b[i] - d[j]);
			if (manh[i] > moi)
			{
				manh[i] = moi;
				ans[i] = j + 1;
				
			}
		}
	}
	for (int i = 0; i < N; i++)
	{
		cout << ans[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int l,r,d;
int main()
{
	int ans=0;
	cin>>l>>r>>d;
	for(int i=l;i<=r;i++)
	{
		if(i%d==0)
		ans++;
	}
	cout<<ans;
	return 0;
}

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

const int maxl=3e5+10;
const ll inf=1e13;

int n,m,cas,k;
int a[maxl],b[maxl];
char s[maxl];
bool in[maxl]; 
ll ans;
ll mi[maxl],mx[maxl];

inline void prework()
{
	scanf("%d",&n);
	for(int i=0;i<=n;i++)
		scanf("%d",&a[i]);
} 

inline void mainwork()
{
	if(n==0)
	{
		if(a[0]==1)
			ans=1;
		else
			ans=-1;
		return;
	}
	mi[0]=1;mx[0]=1;
	for(int i=1;i<=n;i++)
	{
		mi[i]=mi[i-1]-a[i-1];
		mx[i]=(mx[i-1]-a[i-1])*2;
		if(mi[i]<a[i]) mi[i]=a[i];
		if(mx[i]>inf) mx[i]=inf;
		if(mi[i]>mx[i])
		{
			ans=-1;
			return;
		}
	}
	ll now=a[n];
	for(int i=n;i>=1;i--)
	{
		ans+=now;
		if(now+a[i-1]>mx[i-1])
			now=mx[i-1];
		else
			now=now+a[i-1];
	}
	ans+=1;
}

inline void print()
{
	printf("%lld",ans);
}

int main()
{
	int t=1;
	//scanf("%d",&t);
	for(cas=1;cas<=t;cas++)
	{
		prework();
		mainwork();
		print();
	}
	return 0;
}

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

int main(){
	
	string s;
	
	getline(cin,s);
	
	for(int i=0;i<s.size();i++){
		if('a'<=s[i] && s[i]<='z')s[i] = s[i] - 'a' + 'A';
		else if('A'<=s[i] && s[i]<='Z')s[i] = s[i] - 'A' + 'a';
		cout<<s[i];
	}
	cout<<endl;
	
	return 0;
}


Measured memory_bytes: 3152
x1, y1, x2, y2 = map(int, input().split())
y3 = x2 - x1 + y2
x3 = y1 - y2 + x2
y4 = x2 - x1 + y1
x4 = y1 - y2 + x1
print(x3, y3, x4, y4)

Measured memory_bytes: 2940
// #pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma vector temporal
// #pragma simd
// #pragma GCC diagnostic ignored "-W"

#include<cassert>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<sstream>
#include<deque>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<vector>
#include<utility>
#include<functional>
#include<complex>
#include<climits>

// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>

using namespace std;
// using namespace __gnu_pbds;

#define ll long long
#define ld long double
#define X first
#define Y second
#define pb push_back
#define eb emplace_back
#define pii pair<int,int>
#define vint vector<int>
#define SS stringstream
#define PQ priority_queue
#define MS(x,v) memset((x),(v),sizeof(x))
#define RZUNI(x) sort(x.begin(),x.end()), x.resize(unique(x.begin(),x.end())-x.begin())
#define FLH fflush(stdout)
#define CPPinput ios_base::sync_with_stdio(0); cin.tie(0)
#define FIN(fname) freopen(fname,"r",stdin)
#define FOUT(fname) freopen(fname,"w",stdout)

#define tm Ovuvuevuevue
#define y1 Enyetuenwuevue
#define left Ugbemugbem
#define ws Osas
#define dec tetteterette
#define exp expexpexpexp
#define expl explexplexpl

#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl

#ifdef WEAK
#include"/home/edison/Coding/cpp/template/debug.cpp"
#define DEB(...) printf(__VA_ARGS__),fflush(stdout)
#define WHR() printf("%s: Line %d",__PRETTY_FUNCTION__,__LINE__),fflush(stdout)
#define LOG(...) printf("%s: Line %d ",__PRETTY_FUNCTION__,__LINE__),printf(__VA_ARGS__),fflush(stdout)
#define DEBUG 1
#define exit(x) cout<<"exit code "<<x<<endl, exit(0)
#else
#define PDE(...) ;
#define DEB(...) ;
#define WHR() ;
#define LOG(...) ;
#define DEBUG 0
#endif

#define lowbit(x) ((x)&(-(x)))

#if __cplusplus >= 201103L
#include<unordered_map>
#include<unordered_set>
#include<tuple>
#endif

void JIZZ(string output=""){cout<<output; exit(0);}

const ld PI=3.14159265358979323846264338327950288;
const ld eps=1e-13;
const ll mod=998244353;

long long fac[300005],ifac[300005];

long long pw(long long b,long long n,long long m,long long a=1){
    while(n){
        if(n&1)a=a*b%m;
        b=b*b%m; n>>=1;
    } return a;
}
long long C(int n,int i){
    return ifac[i]*ifac[n-i]%mod*fac[n]%mod;
}

int main(){
    CPPinput;
    long long n,a,b,k; cin>>n>>a>>b>>k;
    fac[0]=1;
    for(int i=1;i<=n;++i)fac[i]=fac[i-1]*i%mod;
    ifac[n]=pw(fac[n],mod-2,mod);
    for(int i=n-1;i>=0;--i)ifac[i]=ifac[i+1]*(i+1)%mod;
    long long ans=0;
    for(int i=0;i<=n;++i){
        long long ua=i*a;
        if(ua>k || (k-ua)%b)continue;
        long long ub=k-ua;
        int j=ub/b;
        if(j>n)continue;
        ans+=C(n,i)*C(n,j)%mod;
    }
    cout<<ans%mod<<endl;
}


Measured memory_bytes: 4992
a = input()

if a == ("Q"):
  print ("A")
if a == ("W"):
  print ("A")
if a == ("E"):
  print ("A")  
if a == ("R"):
  print ("A")
if a == ("T"):
  print ("A")
if a == ("Y"):
  print ("A")
if a == ("U"):
  print ("A")
if a == ("I"):
  print ("A")
if a == ("O"):
  print ("A")
if a == ("P"):
  print ("A")
if a == ("A"):
  print ("A")
if a == ("S"):
  print ("A")
if a == ("D"):
  print ("A")
if a == ("F"):
  print ("A")
if a == ("G"):
  print ("A")
if a == ("H"):
  print ("A")
if a == ("J"):
  print ("A")
if a == ("K"):
  print ("A")
if a == ("L"):
  print ("A")
if a == ("Z"):
  print ("A")
if a == ("X"):
  print ("A")
if a == ("C"):
  print ("A")
if a == ("V"):
  print ("A")
if a == ("B"):
  print ("A")
if a == ("N"):
  print ("A")
if a == ("M"):
  print ("A")

if a == ("q"):
  print ("a")
if a == ("w"):
  print ("a")
if a == ("e"):
  print ("a")
if a == ("r"):
  print ("a")
if a == ("t"):
  print ("a")
if a == ("y"):
  print ("a")
if a == ("u"):
  print ("a")
if a == ("i"):
  print ("a")
if a == ("o"):
  print ("a")
if a == ("p"):
  print ("a")
if a == ("a"):
  print ("a")
if a == ("s"):
  print ("a")
if a == ("d"):
  print ("a")
if a == ("f"):
  print ("a")
if a == ("g"):
  print ("a")
if a == ("h"):
  print ("a")
if a == ("j"):
  print ("a")
if a == ("k"):
  print ("a")
if a == ("l"):
  print ("a")
if a == ("z"):
  print ("a")
if a == ("x"):
  print ("a")
if a == ("c"):
  print ("a")
if a == ("v"):
  print ("a")
if a == ("b"):
  print ("a")
if a == ("n"):
  print ("a")
if a == ("m"):
  print ("a")

Measured memory_bytes: 9120
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;

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

    vector<int> a(n);
    ll sum = 0;
    rep(i, n) {
        cin >> a[i];
        sum += a[i];
    }

    set<ll> candidates;
    for(int i = 1; i*i <= sum; i++) {
        if(sum%i == 0) {
            candidates.insert(i);
            candidates.insert(sum/i);
        }
    }

    ll ans = 1LL;
    for(ll x : candidates) {
        ll need;
        {
            vector<ll> r(n);
            rep(i, n) {
                r[i] = a[i]%x;
            }
            sort(r.begin(), r.end());

            ll tot = 0;
            rep(i, n) {
                tot += r[i];
            }

            int l = n-tot/x;
            need = 0;
            rep(i, l) {
                need += r[i];
            }
        }
        if(need <= k) {
            ans = max(ans, x);
        }
    }

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

Measured memory_bytes: 256
import sys


from inspect import currentframe

def pri(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    # print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))


def solve(n, m, t, p, d, c, x, y):

    a = [[1 for _ in range(m)] for _ in range(n)]
    pri(a)
    for i in range(t):
        if d[i] == 1:
            m = max(m - c[i], c[i])
            a_new = [[0 for _ in range(m)] for _ in range(n)]
            pri(a_new)
            for n_i in range(len(a)):
                for m_i in range(len(a[0])):

                    if m_i >= c[i]:
                        a_new[n_i][m_i - c[i]] += a[n_i][m_i]
                    else:
                        a_new[n_i][c[i] - m_i - 1] += a[n_i][m_i]

            pri(a_new)
            a = a_new
        else:
            n = max(n - c[i], c[i])
            a_new = [[0 for _ in range(m)] for _ in range(n)]
            pri(a_new)
            for n_i in range(len(a)):
                for m_i in range(len(a[0])):

                    if n_i >= c[i]:
                        a_new[n_i - c[i]][m_i] += a[n_i][m_i]
                    else:
                        a_new[c[i] - n_i - 1][m_i] += a[n_i][m_i]

            pri(a_new)
            a = a_new

    for j in range(p):
        print(a[y[j]][x[j]])


    return


if __name__ == '__main__':
    while True:
        n_imput, m_imput, t_imput, p_imput = map(int, input().split())
        if p_imput == m_imput == n_imput == t_imput == 0:
            break
        d_imput = [0 for _ in range(t_imput)]
        c_imput = [0 for _ in range(t_imput)]
        x_imput = [0 for _ in range(p_imput)]
        y_imput = [0 for _ in range(p_imput)]

        for i in range(t_imput):
            d_imput[i], c_imput[i] = map(int, input().split())
        for i in range(p_imput):
            x_imput[i], y_imput[i] = map(int, input().split())


        solve(m_imput, n_imput, t_imput, p_imput, d_imput, c_imput, x_imput, y_imput)




Measured memory_bytes: 7440
// finish date: 2018/01/27
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>

using namespace std;

#define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++)
#define rep(i, n)  FOR(i,0,n)
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define bigmod 1000000007
#define INF 1050000000

//pattern=1は正負正負,-1は負正負正
ll calc(vl a, int pattern) {
    ll count = 0;
    ll sa;
    ll bi = 0;
    rep(i, a.size()) {
        if ((pattern == 1 && a[i] + bi > 0) || (pattern == -1 && a[i] + bi < 0)) {
            pattern *= -1;
            continue;
        }
        sa = a[i] + bi - pattern;
        bi -= sa;
        count += llabs(sa);
        pattern *= -1;
    }
    return count;
}

int main() {
    int n;
    cin >> n;
    vl a(n);
    rep(i, n) cin >> a[i];
    FOR(i, 1, n) a[i] += a[i - 1];
    ll mi = min(calc(a, 1), calc(a, -1));
    cout << mi << endl;
    return 0;
}



Measured memory_bytes: 2688
from collections import defaultdict
import sys
sys.setrecursionlimit(2000)
dic = defaultdict(list)
X = int(input())
def check(n):
  if n==100 or n==101 or n==102 or n==103 or n==104 or n==105:
    return 1
  elif n<100:
    return 0
  elif dic[n]!=[]:
    return dic[n]
  else:
    for i in range(100,106):
      if check(n-i):
        dic[n-i]=1
        return 1
      else:
        dic[n-i]=0
    return 0
if check(X)==1:
  print(1)
else:
  print(0)

Measured memory_bytes: 4340
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#define int long long
using namespace std;

typedef pair<int, int> Pii;

void readline(int N, vector<int> &a){
    string s;
    for(int i = 0; i < N - 1; i++){
        getline(cin, s, ' ');
        a[i] = atoi(s.c_str());
    }
    getline(cin, s, '\n');
    a[N - 1] = atoi(s.c_str());
}
void readline(int N, vector<double> &a){
    string s;
    for(int i = 0; i < N - 1; i++){
        getline(cin, s, ' ');
        a[i] = atof(s.c_str());
    }
    getline(cin, s, '\n');
    a[N - 1] = atof(s.c_str());
}

signed main(){

    int N;
    cin >> N;

    string ans = "ABC";

    ans[2] += (int)((N - 1) / 999);

    cout << ans;

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;


public class Main {
    public static void main(String[] args) {
        int w, h;
       
        Scanner sc = new Scanner(System.in);
        while(true){
            h = sc.nextInt();
            w = sc.nextInt();
            
        if(w==0 && h==0){
        break;
        }
        else{
            for(int j = 0; j<h; j++){
        for (int i = 0; i<w; i++){
            if(j%2 == 0){
                if(i!=w-1 && i%2!=1){
        System.out.print("#.");
        i++;}
       else{
        System.out.print("#");}
        
        }
            else{
                if(i!=w-1 && i%2!=1){
            System.out.print(".#");
            i++;}
            else{
            System.out.print(".");
            }
            }
       
        
        }
              System.out.println();
            }
            System.out.println();
        }
        }
}}



Measured memory_bytes: 33760
n = int(input())

arr = []
for i in range(n):
	temp = int(input())
	arr.append(temp)

temp = sorted(arr)
max_element = temp[-1]
second_max = temp[-2]

for i in arr:
	if i != max_element:
		print(max_element)
	else:
		print(second_max)

Measured memory_bytes: 14112
#include <iostream>

using namespace std;

int main()
{
    int a,b,sum=0,sub=0,mul=0;
    cin>>a>>b;
    sum=a+b;
    sub=a-b;
    mul=a*b;
    if(sum>sub&&sum>mul)
    {
        cout<<sum;
    }
    else if(sub>mul)
    {
        cout<<sub;
    }
    else
        cout<<mul;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
 
     String[] nyu=sc.nextLine().split(" ");

//     String nyu=sc.nextLine();
int A=Integer.parseInt(nyu[0]);
int B=Integer.parseInt(nyu[1]);
//int C=Integer.parseInt(nyu[2]);
//int D=Integer.parseInt(nyu);

//StringBuffer sb = new StringBuffer(nyu);
//		String dst = sb.reverse().toString();

//     String nyu2=sc.nextLine();
//int E=Integer.parseInt(nyu2);



//double A=Double.parseDouble(nyu[0]);
//double B=Double.parseDouble(nyu[1]);
/*
switch(C){
case 7:
case 5:
case 3:
System.out.println("YES") ;
break;
default:
System.out.println("NO") ;

break;
}
*/

//int res=Math.min((A*B),C);

//for(String tem:nyu){
//if(tem.equals("1"))res++;
//}
//int res=0;
//for(int i=0;i<300;i++){
//if(num[i]==1)res=i;
//}

//char[] c = nyu.toCharArray();


//System.out.println(nyu+"-"+line_r_2+"-"+nyu2+"-"+line_r_1);


if(A%3==0 || B%3==0 || (A+B)%3==0){
//double res=Math.ceil((AB)/2);

System.out.println("Possible");
//}else if((int)c[0]>(int)c[2]){
//System.out.println(">");

}else{
System.out.println("Impossible");

}




	}
}

Measured memory_bytes: 23764
/*
 * test.cpp
 *
 *
 *      Author: Fireworks
 */

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<cmath>
#include<bitset>
#include<set>
#include<iomanip>
#include<fstream>
#include<bitset>
#include<cstring>
#include<cstdlib>
#include<complex>
#include<list>
#include<sstream>

using namespace std;

typedef pair<int,int> ii;
typedef pair<int,long long> il;
typedef pair<long long,long long> ll;
typedef pair<ll,int> lli;
typedef pair<long long,int> li;
typedef pair<double,double> dd;
typedef pair<ii,int> iii;
typedef pair<double,int> di;
long long mod = 1000000007LL;
long long base = 10000007;
long long large = 1000000000000000000LL;





int main(){
	int n;
	cin>>n;
	vector<vector<int> > g(n,vector<int>(n,0));
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++) cin>>g[i][j];
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			for(int k=0;k<n;k++){
				if(g[i][j]+g[j][k]<g[i][k]){
					cout<<-1<<endl;
					return 0;
				}
			}
		}
	}

	long long ans = 0;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			bool flag = true;
			for(int k=0;k<n;k++){
				if(k==i||k==j) continue;
				if(g[i][j]==g[i][k]+g[k][j]) flag = false;
			}
			if(flag) ans+=1LL*g[i][j];
		}
	}
	cout<<ans/2<<endl;

	return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using vll = vector<ll> ;
#define all(v) v.begin(),v.end()
vll table(1e6+10,0);
  
void add_div(int a){
  for (int i = 1; i * i <= a; i++) {
    if (a % i == 0) {
      table[i]++;
      if (i * i != a) table[a/i]++;
    }
  }
}

vector<long long> divisor(long long n) {
  vector<long long> ret;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(ret.begin(), ret.end());
  return ret;
}

int main(){
  ll N;cin>>N;
  vll A(N);rep(i,N)cin>>A[i];
  vector<bool> vf(N);
  ll allgcd=A[N-1];
  rep(i,N) allgcd=__gcd(A[i],allgcd);
  bool flag = true;
  bool flag2 = (allgcd == 1);
  for(int i=0;i<N;++i){
    vll v = divisor(A[i]);
    rep(i,v.size()){
      if(v[i]==1)continue;
      if(table[v[i]]!=0){
        flag=false;
        break;
      }
    }
    if(!flag) break;
    add_div(A[i]);
  }
  if(flag && flag2) cout<<"pairwise coprime"<<endl;
  else if(!flag && flag2) cout<<"setwise coprime"<<endl;
  else cout <<"not coprime"<< endl;
}

Measured memory_bytes: 19044
#include <stdlib.h>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
using ll=long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
const long long INF=1LL << 60;
long long a,b;
long long dp[100200][110];
long long w[110],v[110];



int main() {
    vector<int> vec(3);
    rep(i,3){
        cin>>vec.at(i);
    }
    int k;
    cin>>k;
    sort(vec.begin(),vec.end());
    rep(i,k){
        vec.at(2)*=2;
    }
    int sum=0;
    rep(i,3){
        sum+=vec.at(i);
    }
    cout<<sum<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9 + 7);

int main(void) {
	int n;
	cin >> n;
	
	vector<int> d(n);
	for(int i = 0; i < n; ++i) {
		cin >> d[i];
	}
	
	sort(d.begin(), d.end());
	
	int ans = 0;
	for(int i = 1; i <= d.back(); ++i) {
		int x = lower_bound(d.begin(), d.end(), i) - d.begin();
		
		if( x == n / 2 ) ans++;
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 3680
#include <algorithm>
#include <iostream> //入出力
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#include <math.h> //算術演算子
#include <vector>
#include <cstdlib>
#include <queue>
#include <stack>
#include <list>
#include <iomanip> //小数点以下を表示させる(setprecision())
// #include <bits/stdc++.h>
using namespace std;
typedef long long ll; //64bit型

#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n'
#define PRINT(V)                                   \
        {                                          \
                for (int i = 0; i < V.size(); i++) \
                {                                  \
                        cout << V[i] << " ";       \
                }                                  \
                cout << endl;                      \
        }

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

int main() //input->compute->output
{
        int N;
        cin >> N;
        vector<string> S(N);
        rep(i, N)
        {
                cin >> S[i];
                sort(S[i].begin(), S[i].end());
        }
        sort(S.begin(), S.end());
        ll ans = 0;
        ll cnt = 1;
        for (int i = 0; i < N - 1; i++)
        {
                if (S[i] == S[i + 1])
                {
                        cnt++;
                }
                else
                {
                        ans += (cnt * (cnt - 1) / 2);
                        cnt = 1;
                }
        }
        ans += (cnt * (cnt - 1) / 2);
        cout << ans << endl;

        return 0;
}

Measured memory_bytes: 9356
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cmath>
#include <climits>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int) n; i++)
#define rep1(i, n) for(int i = 1; i <= (int) n; i++)
#define all(v) v.begin(),v.end()

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

Measured memory_bytes: 3592
#include<cstdio>
#include<algorithm>
#include<vector>
#include<deque>
#include<stack>
#include<queue>
#include<string>
#include<iostream>
#include<tuple>
#include<utility>
#include<set>
#include<queue>
#include<iomanip>
#include<iterator>
#include<map>
#include<bitset>
#include<array>
#include<cmath>
#include<functional>
#include<list>
using namespace std;
typedef long long int llint;
typedef long double lldo;
const llint big=2e18+100000;
const int mod=1e9+7;
const lldo eps=1e-7;
const long double pai=3.141592653589793238462643383279502884197;
#define mt make_tuple
#define mp make_pair
#define fir first
#define sec second
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define res resize
#define ins insert
#define era erase
#define dme(in) cout<<in<<endl;return 0
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
int main(void){
	//DEGwerさんの解説を見た
	int i,j,n;cin>>n;
	static int dp[4002][4002]={0};
	static int ddp[4002][4002]={0};
	static int aa[200001]={0};
	static int bb[200001]={0};
	for(i=0;i<n;i++){
		int a,b;cin>>a>>b;
		aa[i]=a;
		bb[i]=b;
		dp[2000-a][2000-b]++;
	}
	ddp[0][0]=1;
	for(i=0;i<=4000;i++){
		for(j=0;j<=4000;j++){
			dp[i][j]%=mod;
			dp[i+1][j]+=dp[i][j];
			dp[i][j+1]+=dp[i][j];
			ddp[i][j]%=mod;
			ddp[i+1][j]+=ddp[i][j];
			ddp[i][j+1]+=ddp[i][j];
		}
	}
	llint ans=(llint)mod*n;//掛け算しなければ大丈夫
	for(i=0;i<n;i++){
		int a=aa[i],b=bb[i];
		ans+=dp[2000+a][2000+b];
		ans-=ddp[a+a][b+b];
	}
	//同じ串を引く
	//ひくぞー
	if(ans%2==1){ans=(ans+mod)/2;}else{ans/=2;}
	cout<<ans%mod<<endl;
}

Measured memory_bytes: 126976
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	int n = in.nextInt();
	int a = in.nextInt();
	int x = (((n % a == 0) ? 0 : 1) + (n / a)) * in.nextInt();
	int c = in.nextInt();
	int y = (((n % c == 0) ? 0 : 1) + (n / c)) * in.nextInt();
	System.out.println(Math.min(x, y));
    }
}



Measured memory_bytes: 26236
#include<stdio.h>
int main(){
  int N;
  float sum = 0;
  scanf("%d",&N);
  float x[N];
  char u[N][5];
  for(int i = 0;i < N;i++){
    scanf("%f %s",&x[i],&u[i]);
    if(u[i][0] == 'J'){
      sum += x[i];
    }else if(u[i][0] == 'B'){
      sum += x[i] * 380000;
    }
  }
  printf("%f",sum);
  return 0;
}

Measured memory_bytes: 128
#include<stdio.h>

int main(){

	int W,A,B;
	int dis = 0;
	scanf("%d %d %d",&W,&A,&B);

	if(A<B){
		dis = B-(A+W);
	}else{
		dis = A-(B+W);
	}

	if(dis<0){
		printf("0");
	}else{
		printf("%d",dis);
	}

	return 0;


}

Measured memory_bytes: 128
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

// c++11
#include <array>
#include <tuple>
#include <unordered_map>
#include <unordered_set>

#define mp make_pair
#define mt make_tuple
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

const int INF = 1 << 29;
const double EPS = 1e-9;
const ll MOD = 1000000007;

const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
int N,M;
const int MAX_N = 200100;
set<pii> graphs;
int main() {
    cin >> N >> M;
    for (int i = 0; i < M; i++){
        int a,b;
        cin >> a >> b;
        a--;
        b--;
        if (a > b){
            swap(a, b);
        }
        graphs.emplace(mp(a, b));
    }
    for (int i = 1; i < N - 1; i++){
        if (graphs.count(mp(0, i)) and graphs.count(mp(i, N - 1))){
            cout << "POSSIBLE" << endl;
            return 0;
        }
    }
    cout << "IMPOSSIBLE" << endl;

   return 0;
 }


Measured memory_bytes: 9600
#include <cstdio>

int n;
int A[20];
int q;

int solve(int i, int m) {
    if (m == 0) return 1;
    if (i >= n) return 0;
    return solve(i+1, m) || solve(i+1, m-A[i]);
}

int
main(int argc, const char *argv[])
{
    scanf("%d", &n);
    for (int i = 0; i != n; ++i) scanf("%d", &A[i]);
    scanf("%d", &q);
    for (int i = 0; i != q; ++i) {
        int M;
        scanf("%d", &M);
        if (solve(0, M)) printf("yes");
        else printf("no");
        putchar('\n');
    }
    return 0;
}

Measured memory_bytes: 2668
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
ans = "War"
for Z in range(X + 1, Y + 1):
	if max(x) < Z <= min(y):
		ans = "No War"
		break
print(ans)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b;return 1;}return 0;}

int N;
int happy[101010][3];//0:海 1:山 2:家
int dp[101010][3];

int main(){
	cin>>N;
	rp(day, 1, N+1)rp(to, 0, 3)cin>>happy[day][to];
	rp(day, 1, N+1){//day 今日
		rp(from, 0, 3)rp(to, 0, 3) //0:海 1:山 2:家
				if(from != to)
					dp[day][to] = max(dp[day][to], dp[day-1][from] + happy[day][to]);
	}
	int ans = 0;
	rp(to, 0, 3) chmax(ans, dp[N][to]);
	cout<< ans <<endl;
}


Measured memory_bytes: 2560
import java.util.*;
import java.util.Map.Entry;
 
class Main {
	 static int mod =  (int) (Math.pow(10,9)+7);
//	 static int mod = 998244353;
	 public static void main(String[] args) {
	        Scanner sc = new Scanner(System.in);
	        String S = sc.next();
	        char[] c = S.toCharArray();
	        int N=c.length;
	        String subS1=S.substring(0,(N-1)/2);
	        String subS2=S.substring((N+1)/2);
	        char[] c1 = subS1.toCharArray();
	        char[] c2 = subS2.toCharArray();
	        int n1=c1.length;
	        int n2=c2.length;
	        boolean flg=false;
	        for(int i=0;i<(N-1)/2;i++) {
	        	if(c[i]!=c[N-i-1])flg=true;
	        }
	        for(int i=0;i<n1/2;i++) {
	        	if(c1[i]!=c1[n1-1-i])flg=true;
	        }
	        for(int i=0;i<n2/2;i++) {
	        	if(c2[i]!=c2[n2-1-i])flg=true;
	        }
	        if(flg) {
		        System.out.println("No");	        	
	        } else {
	        	System.out.println("Yes");	
	        }
	 }
	 

}

Measured memory_bytes: 23636
n = int(input())
p = [[0 for _ in range(10)] for _2 in range(10)]
ans = 0
for i in range(1, n+1):
  l = int(str(i)[0])
  r = int(str(i)[-1])
  ans += 2 * p[r][l]
  p[l][r] += 1
  if l == r:
    ans += 1
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define F first
#define S second
#define pb push_back
#define forn(b) for(int i = 0; i < b; i++)
#define rforn(b) for(int i = b - 1 ;i >= 0; i--)
#define It(m) for(auto it = m.begin(); it != m.end(); it++)
#define N 500500
#define PI 3.14159265358979323846264338327950L
#define speed ios_base :: sync_with_stdio(0);cin.tie(0);cout.tie(0);
    
const ll mod = (ll)1e9 + 7;
    
int main(){
    speed;
    int n; cin >> n;
    vi v(n);
    forn(n) {
        cin >> v[i];
    }   
    int id = 0;
    bool yes = true;
    for(int i = n - 2; i >= 0; i--) {
        if(v[i] > v[i + 1]) {
            v[i]--;
        }
    }
    for(int i = 0; i < n - 1; i++) {
        if(v[i] > v[i + 1]) {
            yes = false;
            break;
        }
    }
    if(yes) {
        cout << "Yes";
    }
    else {
        cout << "No";
    }
    
    
    return 0;
}

Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<deque>
#include<queue>
using namespace std;

using ll = long long;
const int INF = 1001001001;
const ll LLINF = 1001001001001001001;
const int MOD = 1000000007;

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

int main()
{
  int x;
  cin >> x;
  if (x >= 30) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 3632
import java.util.*;
public class Main {
	static Scanner sc = new Scanner(System.in);
	static int W, H, res;
	static char [][]field;
	static int[]dx = {-1, 0, 1, 0}, dy = {0, 1, 0, -1};
	public static void main(String[] args) {
		while(read()){
			search_Start();
			System.out.println(res);
		}
	}
	static boolean read(){
		W = sc.nextInt(); H = sc.nextInt();
		if(W == 0 && H == 0)
			return false;
		
		field = new char[H][W];
		res = 0;
		
		String line;
		for(int i = 0; i < H; i++){
			line = sc.next();
			for(int j = 0; j < W; j++)
				field[i][j] = line.charAt(j);
		}
		return true;
	}
	static void search_Start(){
		/**
		 * ツづ慊つクツづ債スツタツーツトツ地ツ点ツづーツ探ツつキツ。
		 */
		for(int i = 0; i < H; i++){
			for(int j = 0; j < W; j++){
				/**
				 * ツ個ゥツづつつッツつスツづァツ探ツ催オツ開ツ始
				 */
				if(field[i][j] == '@')
					dfs(j, i);
			}
		}
	}
	static void dfs(int x, int y){
		field[y][x] = '#';
		res++;
		int mx = 0, my = 0;
		for(int i = 0; i < 4; i++){
			mx = x + dx[i]; my = y + dy[i];
			if( 0 <= mx && mx < W && 0 <= my && my < H && field[my][mx] == '.')
				dfs(mx, my);
		}
	}

}

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

using namespace std;

typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
// #define int long long
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000 //2e9
#define LLINF 2000000000000000000ll // 2e18 (llmax:9e18)
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define dmp(x) cerr << #x << ": " << x << endl;

template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}

template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T,vector<T>,greater<T>>;
template<class T> vector<T> vect(int len,T elem){ return vector<T>(len,elem); }

template<class T,class U>
ostream& operator << (ostream& os,const pair<T,U>& p){
  os << p.fi << ',' << p.sec; return os;
}
template<class T,class U>
istream& operator >> (istream& is,pair<T,U>& p){
  is >> p.fi >> p.sec; return is;
}
template<class T>
ostream& operator << (ostream &os,const vector<T> &vec){
  for(int i=0;i<vec.size();i++){
    os << vec[i];
    if(i+1<vec.size())os << ' ';
  }
  return os;
}
template<class T>
istream& operator >> (istream &is,vector<T>& vec){
  for(int i=0;i<vec.size();i++)is >> vec[i];
  return is;
}
void fastio(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout<<fixed<<setprecision(20);
}
namespace Util{
  template<class T>
  vector<pair<T,int>> runLength(vector<T> v){
    vector<pair<T,int>> res;
    for(int i=0;i<v.size();i++){
      if(res.empty()||res.back().first!=v[i])res.push_back(make_pair(v[i],1));
      else res.back().second++;
    }
    return res;
  }
  template<class T>
  void compress(vector<T> &v){
    sort(v.begin(),v.end());
    v.erase(unique(v.begin(),v.end()),v.end());
  }
}

void solve(){
  int N;
  cin >> N;
  vector<int> X(N);
  cin >> X;
  int l = -200, r = 200;
  while(r-l>2){
    // cout << l << ' ' << r << endl;
    int m1 = (l*2+r)/3;
    int m2 = (l+r*2)/3;
    int c1 = 0, c2 = 0;
    for(int i=0;i<N;i++){
      c1 += (X[i]-m1)*(X[i]-m1);
      c2 += (X[i]-m2)*(X[i]-m2);
    }
    if(c1<c2) r = m2;
    else l = m1;
  }
  int ans = INF;
  auto f = [&](int c){
    int res = 0;
    for(int i=0;i<N;i++){
      res += (X[i]-c)*(X[i]-c);
    }
    return res;
  };
  for(int i=l;i<=r;i++){
    chmin(ans,f(i));
  }
  cout << ans << endl;
  return ;
}
 
signed main(){
  fastio();
  solve();
  // int t; cin >> t; while(t--)solve();
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int unsigned long long
#define ld long double
#define inf 0x7f7f7f7f7f7f7f7f 
#define maxn 1000010
#define ri register int
#define il inline
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define mod 998244353
#define db(x) cout << x << endl; 
#define eps 0.0001
using namespace std;
int a[maxn],b[maxn];
char s[maxn];
signed main()
{
	ios::sync_with_stdio(0);
	int x;
	cin >> x;
//	cout << x;
	int p =0;
	int s=(int)100;
	while(1)
	{
		s=(int)(s*1.01);
		p++;
	//	cout <<s <<endl;
		if(s>=x)
		{
			cout << p;
			return 0;
		}
	}
	return 0;
}

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

int main() {
  int n;
  cin>>n;
  vector<int> a(n),b(n);
  for(int i=0;i<n;i++){
    cin>>a.at(i);
  }
  for(int i=0;i<n;i++){
    b.at(a.at(i)-1)=i+1;
  }
  for(int x:b){
    cout<<x<<endl;
  }
}

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

typedef long long lint;
typedef long double louble;

#define lf '\n'

template<typename T1,typename T2> inline T1 max(T1 a,T2 b){return a<b?b:a;}
template<typename T1,typename T2> inline T1 min(T1 a,T2 b){return a<b?a:b;}

namespace ae86
{
	const int bufl = 1<<15;
	
	char buf[bufl],*s=buf,*t=buf;
	
	inline int fetch()
	{
		if(s==t){t=(s=buf)+fread(buf,1,bufl,stdin);if(s==t)return EOF;}
		return *s++;
	}
	
	inline int ty()
	{
		int a=0,b=1,c=fetch();
		while(!isdigit(c))b^=c=='-',c=fetch();
		while(isdigit(c))a=a*10+c-48,c=fetch();
		return b?a:-a;
	}
}
using ae86::ty;

const int _ = 103;

int n;lint val[_],hav;

int main()
{
	std::ios::sync_with_stdio(0);
	cout.tie(nullptr);
	
	n=ty(),hav=ty();
	for(int i=1;i<=n;i++)val[i]=ty();
	sort(val+1,val+n+1);

	int ans=0;
	while(ans<n-1 && val[ans+1]<=hav)ans++,hav-=val[ans];
	if(ans==n-1 && val[n]==hav)ans++;
	cout<<ans<<lf;

	return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;

class Main{
    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        char[] c = fs.next().toCharArray();
        System.out.println((char)(c[0]+1));
    }

    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;

        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }

        private int readByte() {
            if (hasNextByte()) return buffer[ptr++];
            else return -1;
        }

        private boolean isPrintableChar(int c) {
            return 33 <= c && c <= 126;
        }

        public boolean hasNext() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
            return hasNextByte();
        }

        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while (true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if (b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }

        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
            return (int) nl;
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

Measured memory_bytes: 20692
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#define rep(i, n) for (int i = 0; i < (n); i++)
const long long MOD = 1000000007;
using namespace std;
typedef long long ll;
map<ll, int> mp;
void call(int n) {
	int i = 1;
CHECK_NUM:
	int x = i;
	if (x % 3 == 0) {
		cout << " " << i;
		goto END_CHECK_NUM;
	}
INCLUDE3:
	if (x % 10 == 3) {
		cout << " " << i;
		goto END_CHECK_NUM;
	}
	x /= 10;
	if (x) goto INCLUDE3;
END_CHECK_NUM:
	if (++i <= n) goto CHECK_NUM;

	cout << endl;
}
signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	call(n);

	return 0;
}


Measured memory_bytes: 3208
//QWsin
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rep(i,x,y) for(int i=x;i<=y;++i)
#define out(i,u) for(int i=first[u];i!=-1;i=next[i])
#define repvc(i,vc) for(int i=0,_sz=vc.size();i<_sz;++i)
using namespace std;

const int INF=1<<30;
typedef long long ll;

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

const int maxn=100+10;
const int maxm=10000+10;

int dp[maxm],v[maxn];

int main()
{
	int n;cin>>n;
	int sum=0;
	rep(i,1,n) scanf("%d",v+i),sum+=v[i];
	rep(i,1,n) v[i]+=v[i-1];
	int ans=1e9;
	rep(i,1,n) ans=min(ans,abs(v[n]-2*v[i]));
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <string>

int main()
{
  int N;
  std::cin >> N;
  std::string s;
  std::cin >> s;
  for (size_t i = 0, _i = s.size(); i < _i; ++i)
  {
    char c = s[i];
    c += N;
    if ('Z' < c)
      c -= ('Z' + 1 - 'A');
    s[i] = c;
  }
  std::cout << s << std::endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;
using namespace std;

ll dp[51][4005];

int main(int argc, char* argv[])
{
    int n,A;
    scanf("%d%d", &n, &A);
    vector<int> a(n);
    int i,j;
    for(i=0; i<n; i++) {
        scanf("%d", &a[i]); a[i]-=A;
    }

    dp[0][2000]=1;
    for(i=0; i<n; i++) {
        for(j=0; j<=4000; j++) {
            dp[i+1][j]+=dp[i][j];
            if(j+a[i]>=0 && j+a[i]<=4000) 
            dp[i+1][j+a[i]]+=dp[i][j];
        }
    }

    printf("%lld\n", dp[n][2000]-1);

    return 0;
}

Measured memory_bytes: 1792
#include<iostream> 
#include<vector> 
#include<algorithm> 
#include<iomanip> 
#include<stack> 
#include<unordered_map>
#include<climits>
#include<set> 
#include<string> 
//#include<bits/stdc++.h> 
using namespace std; 
#define lld long long int 
#define eb emplace_back
//to insert pair use eb
#define mp make_pair
#define fi first
#define se second
#define pb push_back

#define X 1000000007
#define Y 998244353
#define E4 1000
#define E5 10000 
#define E6 1000000
#define inf 1001001001
#define longinf 2001001001001001001
#define pi 3.1415926535

# define rec2(i,a,b) for(lld i=a;i<b;i++) 
#define rec(i,n) for(lld i=0;i<n;i++)
#define rev(i,a,b) for(lld i=b-1;i>=a;i--)
#define all(v) (v).begin(), (v).end()
#define large(v)  *max_element(all(v))
#define small(v)  *min_element(all(v)) 
#define v vector
const double EPS = 1e-6;
/*  //prime sieve if needed 
//prime factors of number
int prime[E6+1]; 
void sieve(lld n) 
{ rec(i,n+1) 
    prime[i]=1; 
   for(lld i=2;i*i<=n;i++) 
     { if(prime[i]!=1) 
          continue; 
         for(lld j=i*i;j<=n;j=j+i) 
          if(prime[i]==1)
           prime[j]=i; 
      }
}
*/
lld gcd(lld a,lld b)
{
    if(a==0)
     return b; 
    return gcd(b%a,a); 
}
//fermat a^(m-2)%mod
lld binarymul(lld a,lld n,lld m)
{  lld res=1; 
 while(n) 
  { if(n%2) 
      { res=(res*a)%m; 
         n--; 
      } 
     a=(a*a)%m; 
     n/=2; 
  }
  return res; 
}
int main()
{
   ios_base::sync_with_stdio(false); 
   cin.tie(0);
     #ifdef PUNEET_GOEL
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    #endif
   //sieve(E6); 

    lld a,b; 
    cin>>a>>b; 
    cout<<a*b<<endl; 
       

	return 0;
}

Measured memory_bytes: 3652