akhauriyash/Code-Regression huggingface dataset:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    A, B = map(int, readline().split())
    A, B = min(A, B), max(A, B)

    if (B - A) % 2 == 1:
        print("IMPOSSIBLE")
    else:
        print((A + B) // 2)


if __name__ == '__main__':
    main()


Measured memory_bytes: 61716
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <string>
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack>
#include <iomanip>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int,int> pii;
typedef long long ll;
typedef double ld;
typedef vector<int> vi;
#define fi first
#define se second
#define fe first
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define Edg int M=0,fst[SZ],vb[SZ],nxt[SZ];void ad_de(int a,int b){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;}void adde(int a,int b){ad_de(a,b);ad_de(b,a);}
#define Edgc int M=0,fst[SZ],vb[SZ],nxt[SZ],vc[SZ];void ad_de(int a,int b,int c){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;vc[M]=c;}void adde(int a,int b,int c){ad_de(a,b,c);ad_de(b,a,c);}
#define es(x,e) (int e=fst[x];e;e=nxt[e])
#define esb(x,e,b) (int e=fst[x],b=vb[e];e;e=nxt[e],b=vb[e])
#define VIZ {printf("digraph G{\n"); for(int i=1;i<=n;i++) for es(i,e) printf("%d->%d;\n",i,vb[e]); puts("}");}
#define VIZ2 {printf("graph G{\n"); for(int i=1;i<=n;i++) for es(i,e) if(vb[e]>=i)printf("%d--%d;\n",i,vb[e]); puts("}");}
#define SZ 666666
ll A,B;
int main()
{
	cin>>A>>B;
	if(A==B)
	{
		puts("1");
		return 0;
	}
	ll df;
	for(ll g=1LL<<60;;g>>=1)
		if((A&g)!=(B&g)) {df=g; break;}
	A&=(df<<1)-1; B&=(df<<1)-1;
	ll mx=1;
	while(mx+df<=B) mx<<=1;
	ll l1=A,r1=df-1;
	ll l2=df,r2=l2+mx-1;
	ll l3=df+A,r3=df+df-1;
	if(l3>r3) r3=l3-1;
	ll de=0;
	if(l3<=r2) de-=r2-l3+1;
	de+=r1-l1+1;
	de+=r2-l2+1;
	de+=r3-l3+1;
	cout<<de<<"\n";
}


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

int main(){
  while (true){
    int H, W;
    cin >> H >> W;
    if (H==0 && W==0) break;
    for (int i=1; i<=H; i++){
      for (int j=1; j<=W; j++){
	cout << '#';
      }
      cout << endl;
    }
    cout << endl;
  }
  return 0;
}

Measured memory_bytes: 3032
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()

const long long INFLL = 1LL << 60;
const int INFINT = 1 << 30;
const long long MOD = 1e9 + 7;

template <class T> void vecout(T V) {
    auto t = V.begin();
    while(t != V.end()) {
        cout << *t++;
        if(t != V.end()) cout << " ";
    }
    cout << endl;
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m, x;
    cin >> n;
    set<int> a, b, c;
    rep(i, n) {
        cin >> x;
        a.insert(x);
    }
    cin >> m;
    rep(i, m) {
        cin >> x;
        b.insert(x);
    }
    set_difference(all(a), all(b), inserter(c, end(c)));
    for(auto e : c) {
        cout << e << "\n";
    }
}


Measured memory_bytes: 31292
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan0
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














string S, T; int A, B; string U;
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> S >> T >> A >> B >> U;

	if (S == U) A--;
	else B--;

	printf("%d %d\n", A, B);
}







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

#define vi vector<int>
#define pb push_back

int main(){

    int n;
    vi a;
    cin >> n;
    rep(i,n){
        int tmp;
        cin >> tmp;
        a.pb(tmp);
    }
    int now = 1;
    rep(i,n){
        if(now == 2) {
            cout << i << endl;
            return 0;
        }
        now = a[now - 1];
    }
    cout << -1 << endl;
    return 0;
}


Measured memory_bytes: 892
#include<bits/stdc++.h>
#define FIO ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define rep(i, a, b) for(ll i = a; i < b; ++i)
using namespace std;
typedef long long ll;
typedef vector<ll> vll;

int main()
{
	FIO;
    ll n, k; cin >> n >> k;
    vll arr(n);
    for(ll& i : arr) cin >> i;
    sort(arr.begin(), arr.end());
    cout << accumulate(arr.begin(), arr.begin() + k, 0LL);
	return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
int main(){
  
  string s;
  cin >> s;
  int hug=0;
  int n = s.size();
  
  for(int i=0; i<n/2; i++){
  	if(s[i]!=s[n-1-i]) hug++;
  }
  cout << hug << endl;
}

Measured memory_bytes: 256
H, W = map(int, input().split())
ch, cw =  map(int, input().split())
gh, gw =  map(int, input().split())

f = [[s=="." for s in input()] for h in range(H)]
ans = [[-1 for w in range(W)]for h in range(H)]

nextQ = [(ch-1)*1000 + cw-1]
ans[ch-1][cw-1] = 0
while len(nextQ)>0:
  Q = list(nextQ)
  nextQ = set()
  i = 0
  while i<len(Q):
    nh = Q[i]
    i += 1
    nw = nh%1000
    nh = nh//1000
    for dh in range(0-min(nh,2), 3):
      if nh+dh>=H:
        break
      for dw in range(0-min(nw,2), 3):
        if nw + dw>=W:
          break
        if dh==0 and dw==0:
          continue
        if dh*dw==0 and (abs(dh)==1 or abs(dw)==1):
          if ans[nh+dh][nw+dw]==-1:
            if f[nh+dh][nw+dw]:
              Q.append((nh+dh)*1000 + nw+dw)
              ans[nh+dh][nw+dw]=ans[nh][nw]
            else:
              ans[nh+dh][nw+dw]=-2
          elif ans[nh+dh][nw+dw]>ans[nh][nw]:
            Q.append((nh+dh)*1000 + nw+dw)
            nextQ -= {(nh+dh)*1000 + nw+dw}
            ans[nh+dh][nw+dw]=ans[nh][nw]
        else:
          if ans[nh+dh][nw+dw]==-1:
            if f[nh+dh][nw+dw]:
              nextQ.add((nh+dh)*1000 + nw+dw)
              ans[nh+dh][nw+dw]=ans[nh][nw]+1
            else:
              ans[nh+dh][nw+dw]=-2

print(ans[gh-1][gw-1])
      


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

int main() {
    string a,b;
    cin >> a >> b ;
    if (a.length()>b.length()){
        for (int i=0;i<b.length();i++){
            cout << a[i] << b[i];
        }
        cout << a[a.length()-1] <<endl;
    }else{
        for (int i=0;i<b.length();i++){
            cout << a[i] << b[i];
        }
    }
    return 0;
}

Measured memory_bytes: 256
// abc058_b
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

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

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF ((1 << 29)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
#define print_line(vec, n) {for(int i=0;i<(n-1);i++) cout << (vec)[i] << " "; cout << (vec)[(n)-1] << endl;}
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    string s1, s2;
    cin >> s1 >> s2;

    string ans;
    REP(i, s2.size()){
        ans += s1[i];
        ans += s2[i];
    }
    
    if (s1.size() > s2.size()){
        ans += s1.back();
    }
    print(ans);


    return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef complex<ull> pt;
#define x real()
#define y imag()

#define endl "\n"

const int N = 2e5+10;
const int MOD = 1e9+7;

string s;

ll fpow(ll a, ll b) {
  a %= MOD;
  if(b == 0)
   return 1;
  ll ret = fpow(a*a, b/2);
  if (b&1)
   ret *= a;
  return ret % MOD;
}

ll n,m,k;

bool vis[4];
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	cin >> n>>m;
	vis[n]=true;
	vis[m]= true;
	for(int i = 1; i<=3; i++)
		if(!vis[i])
			cout << i<<endl;
	
	
	return 0;
}


Measured memory_bytes: 256
#ifdef __APPLE__
#include <iostream>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <random>
#else
#include <bits/stdc++.h>
#endif

using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define tc(t) for (int tc=1; tc<=t; tc++)
typedef vector<int> VI;
typedef vector<long long int> VLLI;
typedef vector<pair<int, int> > VPI;
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<ll, ll> PLL;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll modInverse (ll a) {ll p = mod - 2; return powmod(a, p);}
// head

unordered_map<string, char> mapp = {{"BR", 'G'}, {"GR", 'B'}, {"BG", 'R'}};

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    ll ans = 0;
    for (int i = 0; i < n-2; i++) {
        unordered_map<char, unordered_set<int>> data;
        data[s[i+1]].insert(i+1);
        for (int k = i+2; k < n; k++) {
            if (s[i] == s[k])
                continue;
            
            string temp = std::string(1, s[i]) + std::string(1, s[k]);
            sort(temp.begin(), temp.end());
            char c = mapp[temp];
            ans += data[c].size();

            if (((k + i)%2 == 0) and (data[c].find((k+i)/2) != data[c].end()))
                ans--;
            data[s[k]].insert(k);
        }
    }
    cout << ans << "\n";
}


Measured memory_bytes: 3744
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = 1'000'000'007;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

template<typename T>
vector<T> gen_v(size_t a) { return vector<T>(a); }
template<typename T, typename ...Ts>
auto gen_v(size_t a, Ts... ts) { return vector<decltype(gen_v<T>(ts...))>(a, gen_v<T>(ts...)); }
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v) { for (auto &e : t) fill_v(e, v); }

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int A, B; cin >> A >> B;
	if (A > B)swap(A, B);
	int k = abs(A - B) / 2;
	if (A == B) {
		cout << 0 << endl;
	}
	else if(abs(A - B) % 2 == 0) {
		cout << A + k << endl;
	}
	else {
		cout << "IMPOSSIBLE" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
h,w=map(int,input().split())
r=1e9
f=lambda x:max(x)-min(x)
for _ in 'aa':
    for i in range(1,h):r=min(min(r,f([j if j else -1e9for j in[i*w,((h-i)//2)*w,((h-i)-(h-i)//2)*w]])),f([j if j else -1e9for j in[i*w,(h-i)*(w//2),(h-i)*(w-w//2)]]))
    h,w=w,h
print(r)

Measured memory_bytes: 3064
import math
N, D = map(int, input().split())
X = []
for n in range(N):
    l = list(map(int, input().split()))
    X.append(l)

def distance(list1, list2):
    s = 0
    for k in range(len(list1)):
        s += (list1[k] - list2[k]) ** 2
    return math.sqrt(s)

ans = 0

for i in range(N-1):
    for j in range(i + 1, N):
        d = distance(X[i], X[j])
        if d.is_integer():
            ans += 1
        else:
            pass

print(ans)

Measured memory_bytes: 9076
#include<bits/stdc++.h>
using namespace std;
 
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string a, b, c;
cin >> a >> b >> c;
putchar(toupper(a[0]));
putchar(toupper(b[0]));
putchar(toupper(c[0]));
cout << "\n";
return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define Sort(x) sort((x).begin(), (x).end())
#define Reverse(x) reverse((x).begin(), (x).end())
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define INF INT_MAX
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15) //15桁まで表示
#define str string
typedef std::pair<int,int> pii;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<ui,ui> puu;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<str> vs;
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 floor(int a,int b){return (a+b-1)/b;};
int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
template<class T>inline bool chmax(T& a,T b){if(a < b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a > b){a=b;return true;}return false;};

int main() {
    int n;
    cin >> n;
    vi a(n),b(n);
    rep(i,n) cin >> a[i];
    if (n%2==0){
        for(int i=0; i<n/2; i++){
            b[i]=a[n-1-2*i];
        }
        for (int i = n/2; i < n; i++){
            b[i]=a[i*2-n];
        }
        
    }
    else{
        for (int i = 0; i <= n/2; i++) {
            b[i]=a[n-1-2*i];
        }
        for (int i = (n+1)/2; i < n; i++){
            b[i]=a[i*2-n];
        }
    }
    rep(i,n) cout << b[i] <<" ";
    cout  << endl;
    
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define mp make_pair
#define pb(x) push_back(x)
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define pcc pair<char, char>
#define pdd pair<double, double>
#define mll map<long long, long long>
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define flsh fflush(stdout)
#define gcd __gcd
#define clr(x) memset(x, 0, sizeof(x))
#define mod 1000000007LL
#define mod2 998244353LL
#define INF 1000000000007
 

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> o_tree;


void solve()
{
    ll n,r;
    cin>>n>>r;
    if(n>=10)
    {
        cout<<r<<"\n";
        return;
    }
    ll res = r+ 100*(10-n);
    cout<<res<<"\n";
}


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


if (fopen("input.txt","r" ))
  {
     freopen("input.txt", "r", stdin);
     freopen("output.txt", "w", stdout);
  }
cout<<setprecision(20);


ll t=1;


// cin>>t;


while(t--)
{
solve();
} 


return 0;
}

Measured memory_bytes: 3560
#include <stdio.h>


int main(void) {

	// 1_4-D Min,Max and Sum

	int n;
	int a[100];
	int i;
	
	scanf("%d\n",&n);

	for(i=0; i<n; i++){
		scanf("%d",&a[i]);
		
	}
	for(i=1; i<n; i++){
		printf("%d ",a[n-i]);
	}
	printf("%d\n",a[0]);

        return 0;
}

Measured memory_bytes: 596
#include<stdio.h>

int main(void)
{
	int a, b, c=0, i, j;
	
	while(c!=1)
	{
		scanf("%d %d", &a, &b);
		if(a == 0 && b == 0)
		{
			c = 1;
			break;
		}
		for(i=0;i<a;i++)
		{
			for(j=0;j<b;j++)
			{
				printf("#");
			}
			printf("\n");
		}
		printf("\n");
	}
	return 0;
}


Measured memory_bytes: 2048
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <functional>


const int MOD = 998244353;
const int kN = 4000 + 5;
int f[2][kN];
char s[kN];
int n;
int most_ball[2][kN];

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

void calc_most_ball(int* most_ball, const std::function<int(char)>& func) {
  for (int i = 0, sum = 0; i < n + n; ++ i) {
    if (i < n) {
      sum += func(s[i]);
    }
    most_ball[i + 1] = std::min(i + 1, sum);
  }
}

int main() {
  scanf("%s", s);
  n = strlen(s);
  calc_most_ball(most_ball[0], [](char x) { return x - '0'; });
  calc_most_ball(most_ball[1], [](char x) { return 2 - (x - '0'); });
  f[0][0] = 1;
  for (int i = 1; i <= n + n; ++ i) {
    int cur = i & 1;
    int pre = cur ^ 1;
    memset(f[cur], 0, sizeof(f[cur]));
    for (int j = 0; j <= most_ball[0][i - 1]; ++ j) if (f[pre][j]) {
      if (j + 1 <= most_ball[0][i])
        add(f[cur][j + 1], f[pre][j]);
      if (i - j <= most_ball[1][i])
        add(f[cur][j], f[pre][j]);
    }
  }
  int result = 0;
  for (int i = 0; i <= most_ball[0][n + n]; ++ i)
    add(result, f[0][i]);
  printf("%d\n", result);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long int
using namespace std;
int main()
{
	ll n,i;
	cin>>n;
	ll h[n];
	for(i=0;i<n;i++)
	cin>>h[i];
	ll dp[n];
	dp[0]=0;
	dp[1]=abs(h[1]-h[0]);
	for(int i=2;i<n;++i) 
	dp[i]=min(abs(h[i]-h[i-2])+dp[i-2],abs(h[i]-h[i-1])+dp[i-1]);
	cout<<dp[n-1];
	return 0;
}

Measured memory_bytes: 1792
///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
using namespace std;
#define     FAST        ios_base::sync_with_stdio(false);cin.tie(NULL)
#define     int 	    long long
#define 	pb 	        push_back
#define 	mp 	        make_pair
#define 	pi 	        2*acos(0.0)
#define     scan(i)     scanf("%lld",&i)
#define     scann(i,j)  scanf("%lld%lld",&i,&j)
#define     print(i)    printf("%lld\n",i)
#define     printt(i,j) printf("%lld %lld\n",i,j)
#define     loop(i,n) 	for(int i = 0 ; i <n ; i++)
#define     loopp(i,n) 	for(int i = 1 ; i <=n ; i++)
#define 	vect 	    vector<int>
#define 	vec_it 	    vector<int>::reverse_iterator vi
#define     sorta(v)    sort(v.begin(),v.end())
#define     sortd(v)    sort(v.begin(),v.end(),greater<>())
#define     sorted      is_sorted(v.begin(),v.end())
#define 	mapp 	    map<char,int>
#define 	pairr 	    pair<int,int>
#define 	sett	    set<int>
#define 	set_it 	    set<int>::reverse_iterator si
#define     map_it      map<char,int> :: reverse_iterator mi
#define 	yes 	    cout<<"Yes"<<endl
#define 	no 	        cout<<"No"<<endl
#define 	ff 	        first
#define 	ss 	        second
#define     mx          INT_MAX
#define     lmx         LLONG_MAX
#define     mn          INT_MIN
#define     lmn         LLONG_MIN
#define     GCD         __gcd(a,b)
#define     LCM         (a/GCD)*b
template <typename T> T gcd(T a,T b){return (b==0)?a:gcd(b,a%b);}
template <typename T> T lcm(T a,T b) {return a*(b/gcd(a,b));}
int modulo (int a, int b) { return a >= 0 ? a % b : ( b - abs ( a%b ) ) % b; }

void solve()
{
  //  freopen ("(input).txt" , "r",  stdin) ;
  //  string st,stt ;
  //  int low=0,high=0;
  //  int l=0,r;
    int n,k,t,x,y,z,d=0,temp=0,cnt=0,sum=0,f=0;
    cin>>n  ; vect v ,a ,b  ; sett s ; set_it ; mapp m,mm ;  map_it ; pairr p ;
    for(int i=1;i*i<=n;i++)
    {
        if(n%i==0&&i<10&&(n/i)<10)
            temp=1;
    }
    if(temp&1)
        yes;
    else
        no;

}

main()
{
    int t;
  //  cin>>t;
  //  while(t--)
        solve();
}



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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

using ll=long long;
using R=long double;
const R EPS=1e-9; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max<R>(x,0.0));}

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

// Problem Specific Parameter:

struct Segment_tree{
	using T=ll;

	int n;
	vector<T> data;
	const T out=(1LL<<31)-1;

	inline T vmerge(T l,T r){return min(l,r);}

	Segment_tree(int n):n(n){data.assign(2*n,out);}

	void update(int p,T x) {  // set value at position p
		for(data[p+=n]=x; p > 1; p >>= 1){
			data[p>>1]=vmerge(data[p],data[p^1]);
		}
	}

	T query(int l, int r) {  // sum on interval [l, r)
		T resl = out,resr = out;
			for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
				if (l&1) resl = vmerge(data[l++], resl);
				if (r&1) resr = vmerge(resr, data[--r]);
		}
		return vmerge(resl,resr);
	}
};

int main(void){
	int n,q;
	cin >> n >> q;

	Segment_tree rmq(n);

	rep(loop,q){
		int com,x,y;
		cin >> com >> x >> y;
		if(com)
			cout << rmq.query(x,y+1) << endl;
		else
			rmq.update(x,y);
	}
	return 0;
}

Measured memory_bytes: 4380
#ifdef HIRO
#include "../stdc++.h"
#define d(f_, ...) printf((f_), ##__VA_ARGS__)
#else
#include <bits/stdc++.h>
#define d(f_, ...)
#endif

using namespace std;
typedef long long ll;

int main() {
#ifdef HIRO
  string file_path(QUIZ);
  ifstream cin(file_path + "/input.txt");
  std::cin.rdbuf(cin.rdbuf());
#endif
  int n;
  int m;
  cin >> n;
  cin >> m;
  long ans = m * pow(m-1,n-1);
  


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



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

typedef long long ll;
typedef int64_t i6;

#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, n) for (ll i = 1; i <= n; ++i)
#define Sort(x) sort(x.begin(), x.end())
#define Sort_rev(x) sort(x.begin(), x.end(), greater<int>())
#define ALL(v) (v).begin(), (v).end()

// π M_PI
// deg = rad*180/M_PI

int main() {
    ll n, a, b;
    cin >> n >> a >> b;
    ll ans = 0;
    if ( n <= a ) {
        cout << n << endl;
    } else {
        ll c = n/(a+b);
        ans = a*c;
        ll cc = n%(a+b);
        if ( cc != 0 ) {
            ans += min(n-((a+b)*c), a);
        }
        /*
        while (1) {
            if ( count+a > n ) {
                ans += n-count;
                count = n;
            } else {
                ans += a;
                count += a+b;
            }
            if ( count >= n ) {
                break;
            }
            // cout << "ans = " << ans << endl;
        }
        */

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


Measured memory_bytes: 256
#include<math.h>
#include<cmath>
#include<bitset>
#include<stdio.h>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iostream>
#include<utility>
using namespace std;
int main(){
  int INF=(1<<29);
  int i,j,n,dp[20][100010];
  vector<int> a;
  scanf("%d\n",&n);
  a.push_back(0);
  a.push_back(1);
  for(i=6;i<=n;){
    a.push_back(i);
    i=i*6;
  }
  for(i=9;i<=n;){
    a.push_back(i);
    i=i*9;
  }
  for(i=0;i<=a.size();i++){
    for(j=0;j<=n;j++){
      dp[i][j]=INF;
    }
  }
  dp[0][0]=0;
  for(i=1;i<a.size();i++){
    for(j=0;j<=n;j++){
      if(j-a[i]>=0){
        dp[i][j]=min(dp[i][j-a[i]]+1,dp[i-1][j]);
      }
      else{
        dp[i][j]=dp[i-1][j];
      }
    }
  }
  printf("%d\n",dp[a.size()-1][n]);
  return 0;
}

Measured memory_bytes: 7296
//============================================================================
// Name        : abc132_e.cpp
// Author      : abb
// Version     :
// Copyright   : [My copyright notice]
// Description : Hello World in C++, Ansi-style
//============================================================================

/*
 E - Hopscotch Addict

 実行時間制限: 2 sec / メモリ制限: 1024 MB

 配点 : 500 点

 問題文
 ケンくんはけんけんぱが大好きです。今日は有向グラフ G の上でけんけんぱをすることにしました。
 G は 1 から N で番号付けされた N 頂点および M 辺からなり、
 i 番目の辺は頂点 u_i から頂点 v_i に接続しています。
 ケンくんははじめ頂点 S にいて、頂点 T までけんけんぱで移動したいです。
 1 回のけんけんぱでは、
 「自分の今いる頂点から出ている辺を 1 つ選んで、その辺が接続する頂点に移動する」
 という操作をちょうど 3 回連続で行います。
 ケンくんが頂点 T に移動することができるか、
 また移動できるなら最小何回のけんけんぱで頂点 T まで移動することができるかを答えてください。
 けんけんぱの操作の途中で頂点 T に訪れても、「頂点 T に移動できた」とは見なさないことに注意してください。

 制約

 ・2 <= N <= 10^5
 ・0 <= M <= \min(10^5, N (N-1))
 ・1 <= u_i, v_i <= N(1 <= i <= M)
 ・u_i ≠ v_i (1 <= i <= M)
 ・i ≠ j ならば (u_i, v_i) ≠ (u_j, v_j)
 ・1 <= S, T <= N
 ・S ≠ T

 */

#pragma GCC optimize ("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;

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

class Graph {
private:
	vector<vector<int>> edge;
	vector<int> dist;
public:
	Graph(int node_count, int edge_count) {
		edge.resize(node_count + 1, vector<int>());
		// 距離情報を -1 で初期化する (-1 は未発見を表す)
		dist.resize(node_count + 1, -1);
	}
	void add_edge(int src_node, int dist_node) {
		edge[src_node].push_back(dist_node);
	}
	int bfs(int start_node, int terminal_node) {
		dist[start_node] = 0;

		// 発見済みかつ未訪問のノードを一時的に格納するキュー
		queue<int> que;
		que.push(start_node);

		// キューが空になるまで探索する
		while (!que.empty()) {
			int current_node = que.front();
			que.pop();

			// current_node から辿れるノードを順に調べる
			for (int next_node : edge[current_node]) {
				// 発見済みノードは探索しない
				if (dist[next_node] != -1) {
					continue;
				}

				// 新たに発見したノードは距離情報を更新する
				dist[next_node] = dist[current_node] + 1;
				que.push(next_node);

				// 目的ノードへ到達した場合は探索を終了する
				if (next_node == terminal_node) {
					return dist[terminal_node];
				}
			}
		}
		return dist[terminal_node];
	}
};

/**
 * エントリポイント．
 * @return 0.
 */
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int n, m;
	cin >> n >> m;

	// ノード数 n, エッジ数 m それぞれ 3 倍する
	Graph graph(3 * n, 3 * m);
	int u, v;
	rep (i, 0, m)
	{
		cin >> u >> v;
		graph.add_edge(0 * n + u, 1 * n + v);
		graph.add_edge(1 * n + u, 2 * n + v);
		graph.add_edge(2 * n + u, 0 * n + v);
	}

	int s, t;
	cin >> s >> t;

	int cost = graph.bfs(0 * n + s, 0 * n + t);
	cout << (cost == -1 ? -1 : cost / 3) << endl;

	return 0;
}


Measured memory_bytes: 17792
object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val H, W, K = sc.nextInt()
    val mat = Array.fill(H)(sc.next)

    def chk(h: Int, w: Int): Boolean = {
      (for {
        i <- 0 until H
        j <- 0 until W
        if ((1 << i) & h) == 0 && ((1 << j) & w) == 0
      } yield if (mat(i).charAt(j) == '#') 1 else 0).sum == K
    }

    println((for{
      i <- 0 until (1 << H)
      j <- 0 until (1 << W)
    } yield chk(i, j)).count(_ == true))
  }
}


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

int main(void)
{
    int a[10];
    for (int i= 0; i < 10; ++i)
        cin >> a[i];

    sort(a, a+10);

    cout << a[9] << endl;
    cout << a[8] << endl;
    cout << a[7] << endl;

    return 0;
}







Measured memory_bytes: 3136
import numpy as np
from scipy.sparse import csr_matrix, csgraph
N, M = map(int, input().split())
print(csgraph.connected_components(csr_matrix(([1] * M, (np.array([tuple(map(lambda n: int(n) - 1, input().split()[:2])) for _ in range(M)], dtype=np.int32).T)), shape=(N, N), dtype=np.int32), return_labels=False))


Measured memory_bytes: 29128
#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long ll;

int main() {
    ll n, a, b, c, d, e, m;
    scanf("%lld%lld%lld%lld%lld%lld", &n, &a, &b, &c, &d, &e);
    m = min({a, b, c, d, e});
    printf("%lld\n", 4 + (n - 1) / m + 1);
    return 0;
}


Measured memory_bytes: 128
N = int(input())
B = list(map(int,input().split()))

def main():
    A = [10**8]*(N)
    A[0] = B[0]
    for i in range(N - 2, -1, -1):
        A[i+1] = min(A[i + 1],B[i])
        A[i] = B[i]
    print(sum(A))
    return
main()


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  int A, B, m;
  cin >> A >> B >> m;
  vi a(A), b(B), x(m), y(m), c(m);
  rep(i, A) cin >> a[i];
  rep(i, B) cin >> b[i];
  rep(i, m) cin >> x[i] >> y[i] >> c[i];
  int ans1 = *min_element(all(a)) + *min_element(all(b));
  int ans2 = 1e9;
  rep(i, m) ans2 = min(ans2, a[x[i] - 1] + b[y[i] - 1] - c[i]);
  cout << min(ans1, ans2) << endl;
}

Measured memory_bytes: 2176
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#define _CRT_SECURE_NO_WARNINGS
#include <vector>
#include <iostream>
#include <iomanip>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <time.h>
#include <bitset>
using namespace std;

typedef double LD;
typedef long long LL;
typedef pair<int, int> PII;
#define MP make_pair
#define PB push_back
//#define X first
//#define Y second

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, t) FOR(i, 0, t)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))

const LD PI = acos(-1.0);
const LD EPS = 1e-6;
const int INF = 1000000007;
const LL LINF = 1e18;
const int mod = 1000000007;
const LL MAX = 200047;

vector <LL> S;

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//freopen("In.txt", "r", stdin);
	LL n, p1 = 0, p2 = 0, s = 0, ans = 0;
	cin >> n;
	S.push_back(0);
	REP(i, n)
	{
		int a;
		cin >> a;
		s += a;
		S.push_back(s);
	}
	sort(ALL(S));
	while (p1 < SZ(S))
	{
		while (p2 < SZ(S) && S[p1] == S[p2])
			++p2;
		ans += (p2 - p1) * (p2 - p1 - 1) / 2;
		p1 = p2;
	}
	cout << ans;
	//system("pause");
	return 0;
}

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

using namespace std;

#define SZ(x) (int)(x.size())
#define REP(i, n) for(int i=0;i<(n);++i)
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(int)(n);i>=0;--i)
#define RFOR(i, a, b) for(int i=(int)(a);i>=(int)(b);--i)
#define ALL(a) (a).begin(),(a).end()
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;

const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;

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

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

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

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  REP(i, SZ(v)) {
    if(i) os << " ";
    os << v[i];
  }
  return os;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int n; cin >> n;
  vector<P> v;
  auto comp1 = [](P p1, P p2) {
    return p1.first < p2.first;
  };
  auto comp2 = [](P p1, P p2) {
    return p1.second - p1.first < p2.second - p2.first;
  };
  priority_queue<P, vector<P>, decltype(comp1)> pq1{comp1};
  priority_queue<P, vector<P>, decltype(comp2)> pq2{comp2};
  int cntl = 0, cntr = 0;
  REP(i, n) {
    string s; cin >> s;
    int now = 0;
    int mi = 0;
    REP(j, SZ(s)) {
      if(s[j] == '(') {
        cntl++;
        now++;
      } else {
        cntr++;
        now--;
        chmin(mi, now);
      }
    }
    if(now >= 0) pq1.push({mi, now});
    else pq2.push({mi, now});
  }
  if(cntl != cntr) {
    cout << "No" << endl;
    return 0;
  }

  int now = 0;
  bool ok = true;
  REP(i, n) {
    if(!pq1.empty() && now + pq1.top().first >= 0) {
      now += pq1.top().second;
      pq1.pop();
      continue;
    }
    if(!pq2.empty() && now + pq2.top().first >= 0) {
      now += pq2.top().second;
      pq2.pop();
      continue;
    }
    ok = false;
    break;
  }
  cout << (ok ? "Yes" : "No") << endl;

}
























Measured memory_bytes: 11212
#define ll long long
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define fo(i , n) for(ll i = 0 ; i < n ; i++)
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<utility>
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<queue>
#include<set>
#include<stack>
ll z = 1000000007 ;
ll inf = 100000000000000000 ;
ll gcd(ll a , ll b){ if(b > a) return gcd(b , a) ; if(b == 0) return a ; return gcd(b , a%b) ;}
ll power(ll a ,ll b){if(b == 0) return 1 ; ll c = power(a , b/2) ; if(b%2 == 0) return ((c*c)%z) ; else return ((((c*c)%z)*a)%z) ;}
ll inverse(ll a ,ll n){return power(a , n-2) ;}
ll max(ll a , ll b){if(a > b) return a ; return b ;}
//ios_base::sync_with_stdio(0);
//cin.tie(0); cout.tie(0);
using namespace std ;


void solve()
{
	ll a , b , c ;
	cin >> a >> b >> c ;
	ll ans = (4*a*b) ;
	ll d = (c - (a+b)) ;
	if(d < 0)
	{
		cout << "No" << endl ;
		return ;
	}
	d *= d ;
	ans -= d ;
	if(ans < 0)
	{
		cout << "Yes" << endl ;
	}
	else
	{
		cout << "No" << endl ;
	}
	return ;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	
	ll t ;
	//cin >> t ;
	t = 1 ;
	while(t--)
	{
		solve() ;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <vector>
#include <math.h>
using namespace std;

int HelloWorld(){
	cout << "Hello World" << endl;
	return 0;
}

int XCubic(){
	int x;
	cin >> x;
	if (1 <= x && x <= 100){
		x = x*x*x;
		cout << x << endl;
		return 0;
	}
	return 1;
}

int Rectangle(){
	int a, b, area, perimeter;

	cin >> a >>b;
	if (1 <= a && b <= 100){
		area = a*b;
		perimeter = (a + b) * 2;
		cout << area << " " << perimeter << endl;
		return 0;
	}
	return 1;
}

int Watch(){
	int S;
	cin >> S;
	
	
	int D = 60;
	int s = S%D;
	int m = (S / D) % D;
	int h = (S / D) / D;
	if (0 <= S && S <= 86400){
		printf("%u:%u:%u\n", h, m, s);
		return 0;
	}
	
	return 1;
}

int SmallLargeOrEqual(){
	int a, b;
	cin >> a >> b;
	if (!(a <= a && b <= 1000)) return 1;
	if (a < b)		cout << "a < b" << endl;
	else if (a > b) cout << "a > b" << endl;
	else			cout << "a == b" << endl;
	return 0;
}

int Range(){
	int a, b,c;
	bool flag = true;

	cin >> a >> b >> c;
	if (!(0 <= a && a <= 100)) return 1;
	if (!(0 <= b && b <= 100)) return 1;
	if (!(0 <= c && c <= 100)) return 1;

	if (!(a < b)) flag=false;
	if (!(b < c)) flag = false;

	if (flag) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

int SortingThreeNumbers(){
	int a, b, c,temp;
	cin >> a >> b >> c;

	if (!(1 <= a && a <= 10000)) return 1;
	if (!(1 <= b && b <= 10000)) return 1;
	if (!(1 <= c && c <= 10000)) return 1;

	if (a > b){
		temp = a;
		a = b;
		b = temp;
	}
	if (b > c){
		temp = b;
		b = c;
		c = temp;
	}
	if (a > b){
		temp = a;
		a = b;
		b = temp;
	}

	printf("%u %u %u\n", a, b, c);
	
	
	return 0;
}

int CircleInARectangle(){
	int W, H, x, y, r;
	bool flag = true;
	cin >> W >> H >> x >> y >> r;
	if (!(-100 <= x && x <= 100)) return 1;
	if (!(-100 <= y && y <= 100)) return 1;
	if (!(0 <= W && W <= 100)) return 1;
	if (!(0 <= H && H <= 100)) return 1;
	if (!(0 <= r && r <= 100)) return 1;


	if ((x - r) < 0) flag = false;
	if ((y - r) < 0) flag = false;
	if (W < (x + r)) flag = false;
	if (H < (y + r)) flag = false;

	if (flag) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

int PrintManyHelloWorld(){
	for (int i = 0; i < 1000; i++){
		HelloWorld();
	}
	return 0;
}

int PrintTestCases(){
	int x,i=1;
	
	while (1){
		cin >> x;
		if (x == 0) break;
		cout << "Case " << i++ << ": " << x << endl;
	}

	return 0;

}

int SwappingTwoNumbers(){
	int x, y, temp;
	
	for (int i = 0;; i++){
		cin >> x >> y;
		if (x == 0 && y == 0) break;
		if (x > y){
			temp = x;
			x = y;
			y = temp;
		}
		cout << x << " " << y << endl;
	}
	return 0;
}


int HowManyDivisors(){
	int a, b, c, count;
	cin >> a >> b >> c;
	count = 0;
	for (a; a <= b; a++){
		if (c%a == 0) count++;
	}
	cout << count << endl;
	return 0;
}

int ADivideBProbrem(){
	int a, b;
	double c;
	cin >> a >> b;
	c = ((double)a / (double)b);
	printf("%u %u %lf\n", a / b, a%b, c);
	return 0;
}

int main(){
	//HelloWorld();
	//XCubic();
	//Rectangle();
	//Watch();
	//SmallLargeOrEqual();
	//Range();
	//SortingThreeNumbers();
	//CircleInARectangle();
	//PrintManyHelloWorld();
	//PrintTestCases();
	//SwappingTwoNumbers();
	//HowManyDivisors();
	ADivideBProbrem();
	return 0;
}

Measured memory_bytes: 3232
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<stack>
using namespace std;

int R, C, N;
vector<pair<int, int> > edge[4];

bool is_on_edge(int x, int y){
    return x == 0 || x == R || y == 0 || y == C;
}


void append(int x, int y, int n){
    if(x == 0){
        edge[0].push_back(make_pair(-y, n));
    }else if(y == 0){
        edge[1].push_back(make_pair(x, n));
    }else if(x == R){
        edge[2].push_back(make_pair(y, n));
    }else if(y == C){
        edge[3].push_back(make_pair(-x, n));
    }
}

int main(){
    cin >> R >> C >> N;
    for(int i = 0; i < N; i++){
        int x[2], y[2];
        cin >> x[0] >> y[0] >> x[1] >> y[1];
        if(is_on_edge(x[0], y[0]) && is_on_edge(x[1], y[1])){
            append(x[0], y[0], i);
            append(x[1], y[1], i);
        }
    }
    stack<int> points;
    for(int i = 0; i < 4; i++){
        sort(edge[i].begin(), edge[i].end());
        for(int j = 0; j < edge[i].size(); j++){
            if(!points.empty() && points.top() == edge[i][j].second){
                points.pop();
            }else{
                points.push(edge[i][j].second);
            }
        }
    }
    if(points.empty()){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

    

}


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

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

  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  
  int ans=0;
  for(int i=0; i<N; i++) {
    if(!(i%2)) ans += a[i];
    else       ans -= a[i];
  }
  
  cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;


public class Main{
    public  static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
        	int H = sc.nextInt();
        	int W = sc.nextInt();
        	String str;
        	int a=0;
        	int[][] cicada=new int[H][W];
        	for(int i=0; i<H; i++) {
        		str=sc.next();
        		for(int j=0; j<W; j++) {
        			a=str.charAt(j)-'0';
        			cicada[i][j]=a;
        		}
        	}
        	for(int i=0; i<H; i++) {
        		for(int j=0; j<W; j++) {
        			if(i==0 && j==0) {
        				cicada[i][j]=0;
        			}
        			else if(i==0) {
        				cicada[i][j]+=cicada[i][j-1];
        			}
        			else if(j==0) {
        				cicada[i][j]+=cicada[i-1][j];
        			}
        			else {
        				cicada[i][j]+=Math.min(cicada[i-1][j], cicada[i][j-1]);
        			}
        		}
        	}
        	System.out.println(cicada[H-1][W-1]);
        }
    }
}


Measured memory_bytes: 26492
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i, s, n) for (int i = (s); i < (n); i++)
#ifdef LOCAL
#define INPUT_FILE                              \
  ifstream in("atcoder-problems/agc008_a.txt"); \
  cin.rdbuf(in.rdbuf());
#define print_vec(v)                        \
  rep(l, v.size()) { cout << v[l] << " "; } \
  cout << endl;
#else
#define INPUT_FILE
#define print_vec(v)
#endif
#define CIN_OPTIMIZE \
  cin.tie(0);        \
  ios::sync_with_stdio(false);
typedef pair<int, int> P;
typedef long long ll;
typedef pair<ll, ll> pl;
const int INF = 100100100;
const ll LINF = 1e18 + 100;
const int MOD = 1e9 + 7;

int main() {
  INPUT_FILE CIN_OPTIMIZE;

  ll x, y;
  cin >> x >> y;
  if (x == y) {
    cout << 0 << endl;
    return 0;
  }

  ll ans = abs(abs(x) - abs(y));
  if ((x < 0 && y > 0) || (x >= 0 && y <= 0)) {
    ans++;
  } else {
    if (x > y) {
      ans += 2;
    }
  }
  cout << ans << endl;
}

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

int main(){
    int n;
    scanf("%d",&n);
    if(n == 10 || n == 100 || n == 1000 || n == 10000 || n == 100000){
        printf("10\n");
        return 0;
    }else{
        int ans = 0;
        while(n){
            ans += (n%10);
            n /= 10;
        }
        printf("%d\n", ans);
    }
}


Measured memory_bytes: 768
import sys
import  math
import fractions
from collections import defaultdict
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))



X=int(input())

prime_l=[0]*(2*X)
for  i in range(2,X):
    if(prime_l[i]==0):
        for j in range(1,(2*X)//i):
            prime_l[i*j]+=1
        
while(1):
    if(prime_l[X]==0):
        print(X)
        sys.exit(0)
    X+=1

Measured memory_bytes: 6524
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n, x, result = 0;
        while (true) {
            n = sc.nextInt();
            x = sc.nextInt();
            if (n == 0 && x == 0) break;
            for (int i = 1; i <= n; i++) {
                for (int j = i + 1; j <= n; j++) {
                    for (int k = j + 1; k <= n; k++) {
                        if ((i + j + k) == x) result++;
                    }
                }
            }
            System.out.println(result);
            result = 0;
        }

    }
}



Measured memory_bytes: 26636
#include <cstdio>
#include <algorithm>

//#define scanf scanf_s

const int kMaxSquare = 64;
const int kMaxMoney = 5100;
const int kMaxGainMoney = 100;

int roulette[4];

typedef struct{
	int type;
	int value;
} BoardState;

BoardState board[kMaxSquare];

int bp(int X, int Y){
	float bp[kMaxSquare][kMaxMoney];
	float prob = 1.0f / static_cast<float>(X);

  for(int n = 0; n <= Y; n++)
    for(int m = 0; m <= Y*kMaxGainMoney; m++)
      bp[n][m] = 0.0f;
  bp[0][0] = 1.0f;
	for (int n = 0; n < Y; n++){
    for (int m = 0; m <= kMaxGainMoney * n; m++){
      if(bp[n][m] == 0.0f) continue;
			for (int k = 0; k < X; k++){
        int pos = std::min(n+roulette[k], Y);
				if (board[pos].type == 1)
          bp[std::min(pos + board[pos].value, Y)][m] += bp[n][m] * prob;
				else if (board[pos].type == 2)
					bp[pos][m + board[pos].value] += bp[n][m]* prob;
				else if (board[pos].type == 3)
          bp[pos][std::max(m - board[pos].value, 0)] += bp[n][m] * prob;
				else
					bp[pos][m] += bp[n][m] * prob;
			}
		}
	}

	float res = 0.0f;
  for (int m = 0; m <= Y * kMaxGainMoney; m++)
		res += static_cast<float>(m) * bp[Y][m];
	return static_cast<int>(res);
}

int main(){
	while (1){
		int X, Y, Z;
		scanf("%d %d %d", &X, &Y, &Z);
		if (X == 0) return 0;
		for (int i = 0; i < X; i++)
			scanf("%d", &roulette[i]);
		for (int i = 0; i < kMaxSquare; i++)
			board[i] = { 0, 0 };
		for (; Z > 0; Z--){
			int N, E, A;
			scanf("%d %d %d", &N, &E, &A);
			board[N] = { E, A };
		}
		printf("%d\n", bp(X, Y));
	}
}

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

#define ll long long

using namespace std;

int main(){
	ll i,n,y;
	char x;
	
	cin>>n;
	
	ll s[14]={0},h[14]={0},c[14]={0},d[14]={0};
	
	for(i=1;i<=n;i++){
		cin>>x>>y;
		if(x=='S') s[y]=1;
		  else if(x=='H') h[y]=1;
		    else if(x=='C') c[y]=1;
		      else d[y]=1;
	}
	
	for(i=1;i<=13;i++){
		if(s[i]==0) cout<<"S "<<i<<"\n";
	}
	for(i=1;i<=13;i++){
		if(h[i]==0) cout<<"H "<<i<<"\n";
	}
	for(i=1;i<=13;i++){
		if(c[i]==0) cout<<"C "<<i<<"\n";
	}
	for(i=1;i<=13;i++){
		if(d[i]==0) cout<<"D "<<i<<"\n";
	}
}


Measured memory_bytes: 3072
#include <stdio.h>

long long gcd(long long x,long long y){
  return (x%y)?gcd(y,x%y):y;
}

int main(void){
  long long K;
  long long sum=0;
  scanf("%lld",&K);
  for(long long a=1;a<=K;a++){
    for(long long b=1;b<=K;b++){
      for(long long c=1;c<=K;c++){
        sum += gcd(gcd(a,b),c);
      }    
    }
  }
  printf("%lld\n",sum);
  return 0;
}


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

using namespace std;

#define fo(i, n) for(int i = 1; i <= n; ++i)
#define mp make_pair
#define F first
#define S second
#define pb push_back

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

const int N = 200200;
const int mod = 1e9 + 7;

int n, m;
set<int> e[N];
vector<int> a[3];
vector<int> g[N];
int col[N];
int cnt[4];
inline void dfs(int v, int c)
{
    col[v] = c;
    cnt[c]++;
    for(int to : g[v])
        if(col[to])
        {
            if(col[to] != 3 - c)
            {
                cout << -1;
                exit(0);
            }
        }
        else
        {
            dfs(to, 3 - c);
        }
}

inline int get(int x) {
    return x * (x - 1) / 2;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0);
    cin >> n >> m;
    fo(i, m)
    {
        int u, v;
        cin >> u >> v;
        e[u].insert(v);
        e[v].insert(u);
    }
    fo(i, n)
        for(int j = i + 1; j <= n; ++j)
            if(e[i].find(j) == e[i].end())
            {
                g[i].pb(j);
                g[j].pb(i);
            }
    vector<pair<int, int> > res;
    for(int i = 1; i <= n; ++i)
        if(!col[i]) {
            cnt[1] = cnt[2] = 0;
            dfs(i, 1);
            res.pb(mp(cnt[1], cnt[2]));
        }
    bitset<707> dp;
    dp[0] = 1;
    for(int i = 0; i < res.size(); ++i) {
        dp = (dp << res[i].first) | (dp << (res[i].second));
    }
    int ans = 1e9;
    for(int i = 0; i <= n; ++i) {
        if(dp[i]) {
            int x = get(i) + get(n - i);
            ans = min(ans, x);
        }
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 37248