akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,n,s) for(int i = s; i < (n); ++i)
#define rsrep(i,n,s) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<x<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;

vint divisor(int n) {
    vint ans;
    for (int i = 1; i*i <= n; ++i) {
        if (n%i == 0) {
            ans.push_back(i);
            if (i*i != n) ans.push_back(n/i);
        }
    }
    sort(all(ans));
    return ans;
}

int main() {
    int n, k;
    cin >> n >> k;
    vint a(n);
    int total = 0;
    rep(i, n) {
        cin >> a[i];
        total += a[i];
    }
    vint ls = divisor(total);
    int ans = 0;
    rrep(i, ls.size()) {
        vint m(n);
        rep(j, n) m[j] = a[j] % ls[i];
        sort(all(m));
        vint sump(n), summ(n);
        sump[0] = m[0];
        summ[0] = m[0]-ls[i];
        srep(j, n, 1) {
            sump[j] = sump[j-1] + m[j];
            summ[j] = summ[j-1] + (m[j] - ls[i]);
        }
        rep(j, n) {
            if (sump[j] == -(summ[n-1] - summ[j])) {
                if (sump[j] <= k) ans = ls[i];
                else break;
            }
        } 
        if (ans != 0) break;
    }

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

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！
        Scanner sc = new Scanner(System.in);
        int line = sc.nextInt();
        
        int kane=0;
        
        for(int i=1; i <= line; i++){
       
        kane += 800;
        
        if(i % 15 == 0){
        	kane -= 200;
        }
        
      }
        System.out.print(kane);
        
    }
}


Measured memory_bytes: 22356
#define _CRT_SECURE_NO_WARNING

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
int in[100];
int main()
{
	int n,i,j,sum=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&in[i]);
	}
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			sum+=in[i]*in[j];
		}
	}
	printf("%d",sum);
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#define MAX 100001
using namespace std;

int map[MAX];
int c[MAX] = {};

void eratos() {
	for (int i=0;i<MAX;i++) {
	map[i] = 1;
	}
	int j;
	map[0]=map[1]=0;
	for (int i=2;i<MAX;i++) {
	if (map[i]) {
	j = i+i;
	while (j<=MAX) {
	map[j]=0;
	j = j+i;
	}
	}
	}
}
void like() {
	//2017に似た数が何個あるか
	for (int i=3;i<MAX;i+=2) {
	if (map[i]&&map[(i+1)/2]) c[i]++;
	}
	for (int i=3;i<MAX;i++) {
	c[i]+=c[i-1];
	}
}

int main(){
        int q;
        int l,r;
        cin >> q;
	eratos();
	like();
        for (int i=0;i<q;i++) {
        scanf("%d %d",&l,&r);
        printf("%d\n",c[r] - c[l-1]);
	}
        return 0;
}





Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;cin>>n;
bool b = 0;
int x[n];
for(int i=0;i<n;i++){
    cin>>x[i];
}
sort(x,x+n);
for(int i=0;i<n;i++)
    if(x[i]==x[i+1])
    {b=1;break;}
if(b==0)
    cout<<"YES"<<endl;
else
    cout<<"NO"<<endl;

return 0;}


Measured memory_bytes: 4360
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<set>
using namespace std;
typedef long long ll;
const int inf=1<<29;
const ll Maxn=1e9;

int main(){
	int n,x,y,A;
	int sum=0,SUM=0;
	char a[100000];
	scanf("%d %d %d",&n,&x,&y);
	for(int i=1;i<=n;i++){
		sprintf(a,"%d",i);
		sum=0;
		for(int j=0;j<strlen(a);j++){
			A=a[j]-'0';
			sum+=A;
		}
			if(sum>=x&&sum<=y) SUM+=i;
	}
	printf("%d\n",SUM);
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int a , b, c;
    cin >> a >> b >>c;
    if((a==b&&a!=c)||(a==c && a!=b) || (b==c&& b!=a) )
    {
        cout << "Yes";
    }
    else
        cout << "No";
    return 0;
}


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

int main() {
  int k, n;
  cin >> k >> n;
  
  vector<int> ie(n);
  for (int i = 0; i < n; i++) {
    cin >> ie.at(i);
  }
  
  int kyori = ie.at(0) + k - ie.at(n-1);
  
  for (int i = 0; i < n - 1; i++) {
    kyori = max(kyori, ie.at(i + 1) - ie.at(i));
  }
  cout << k - kyori << endl;
}


Measured memory_bytes: 1024
import java.util.*;

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

        int start = x-k+1;
        int end = x+k-1;

        for (int i=x-k+1; i<=x+k-1; i++){
            if (-1000000<=i && i<=1000000){
                System.out.print(i+" ");
            }
        }

    }
}

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

typedef long long int ll;
typedef long double ld;

#define Pb push_back
#define Mp make_pair

#define ff first
#define ss second

#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))

#define INF LONG_LONG_MAX
#define MINF LONG_LONG_MIN

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

#define db1(x) cout<<#x<<" : "<<x<<endl;
#define db2(x,y) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<endl;
#define db3(x,y,z) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\t"<<#z<<" : "<<z<<endl;


void solve()
{
  string s,t;
  cin >> s >> t;
  int n = s.length();
  int m = t.length();
  int L[n+1][m+1];
  int i,j;
  for(int i=0;i<=n;i++)
  {
    for(int j=0;j<=m;j++)
    {
      if(i==0 || j==0) L[i][j] = 0;
      else if(s[i-1] == t[j-1]) L[i][j] = L[i-1][j-1]+1;
      else  L[i][j] = max(L[i-1][j],L[i][j-1]);
    }
  }
  int idx = L[n][m];
  char lcs[idx+1];
  lcs[idx]='\0';
  i=n,j=m;
  while(i>0 && j>0)
  {
    if(s[i-1] == t[j-1])
    {
      lcs[idx-1]=s[i-1];
      idx--;
      i--;
      j--;
    }
    else if(L[i-1][j] > L[i][j-1]) i--;
    else j--;
  }
  cout << lcs;
}

signed main()
{
  IOS;
  //freopen("input.txt", "rt", stdin);
  //freopen("output.txt", "wt", stdout);
  int t=1;
  //cin >> t;
  while(t--)
  {
    solve();
  }
  return 0;
}
/*==============================================================================================================================================================*/


Measured memory_bytes: 35456
#include <bits/stdc++.h>
using namespace std;
#define sz(v) v.size()
#define ll long long
#define row     vector < ll >
#define matrix  vector < row >

ll mod = 1000000000 + 7;

matrix newZero(int n, int m)
{
    return matrix(n,row(m,0));
}

matrix newIdentity(int n)
{
    matrix v = newZero(n,n);
    for(int i = 0 ; i < n ; i++)v[i][i] = 1;
    return v;
}

matrix add(matrix a , matrix b)
{
    for(int i = 0 ; i < sz(a) ; i++)
        for(int j = 0 ; j < sz(a[0]) ; j++)
            a[i][j] += b[i][j];
    return a;
}
matrix reflect(matrix a)
{
    matrix v = newZero(sz(a),sz(a[0]));
    for(int i = 0 ; i < sz(a) ; i++)
        for(int j = 0 ; j < sz(a[0]) ; j++)
            v[i][sz(a[0])-1-j] = a[i][j];
    return v;
}
matrix rotateMatrix(matrix a)
{
    matrix v = newZero(sz(a[0]) , sz(a));
    for(int i = 0 ; i < sz(a) ; i++)
        for(int j = 0 ; j < sz(a[0]) ; j++)
            v[j][sz(a)-1-i] = a[i][j];
    return v;
}
matrix addIdentity(matrix a)
{
    for(int i = 0 ; i < sz(a) ; i++)a[i][i] ++;
    return a;
}
/// Matrix Multiplication
matrix multiply(matrix a , matrix b)
{
    matrix v = newZero(sz(a) , sz(b[0]));
    for(int i = 0 ; i < sz(a) ; i++)
        for(int j = 0 ; j < sz(b[0]) ; j++)
            for(int k = 0 ; k < sz(b) ; k++)
                //v[i][j] += a[i][k]*b[k][j];
                    v[i][j] = ((v[i][j]%mod) + ((a[i][k]%mod)*(b[k][j])%mod)%mod)%mod;
    return v;
}
/// Fast Matrix Power
matrix fp(matrix a , ll p)
{
    if(!p)return newIdentity(sz(a));
    if(p&1)return multiply(a,fp(a,p-1));
    return fp(multiply(a,a),p>>1);
}
/// Sum Power
matrix sumPower(matrix a, ll k)
{
    if(!k)return newZero(sz(a),sz(a));
    if(k&1)return multiply(a , addIdentity(sumPower(a,k-1)));
    return multiply( sumPower(a,k>>1) , addIdentity(fp(a,k>>1)));
}
void displayMatrix(matrix a)
{
    for(int i = 0 ; i < sz(a) ; i++)
    {
        for(int j = 0 ; j < sz(a[0]) ; j++)printf("%d ",a[i][j]);
        printf("\n");
    }
}
void solveMatrix(ll n, ll k)
{
    matrix B = newZero(1,n);
    for(int i = 0 ; i < n ; i++)B[0][i] = 1LL;
    matrix T = newZero(n,n);
    for(int i = 0 ; i < n ; i++)
        for(int j = 0 ;j < n ; j++)
            scanf("%lld",&T[i][j]);

    T = fp(T,k);
    B = multiply(B,T);

    ll sum = 0;
    for(int i = 0 ; i < n ; i++) sum = (sum + B[0][i])%mod;
    printf("%lld\n",sum);
}
int main()
{
    ll n;
    ll k;
    scanf("%lld%lld",&n,&k);
    solveMatrix(n,k);
    return 0;
}


Measured memory_bytes: 5376
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>  
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>
#include <fstream>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<vector<ll> > vv64;
typedef vector<vector<p64> > vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 1e9+7;
double eps = 1e-12;
#define forn(i,e) for(ll i = 0; i < e; i++)
#define forsn(i,s,e) for(ll i = s; i < e; i++)
#define rforn(i,s) for(ll i = s; i >= 0; i--)
#define rforsn(i,s,e) for(ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 2e18
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
 
ll mpow(ll a, ll b){
	if(a==0) return 0;
	if(b >= (MOD-1)) b %= (MOD-1);
	if(b==0) return 1;
	ll t1 = mpow(a,b/2);
	t1 *= t1;
	t1 %= MOD;
	if(b%2) t1 *= a;
	t1 %= MOD;
	return t1;
}
 
ll mpow(ll a, ll b, ll p){
	if(a==0) return 0;
	if(b==0) return 1;
	ll t1 = mpow(a,b/2,p);
	t1 *= t1;
	t1 %= p;
	if(b%2) t1 *= a;
	t1 %= p;
	return t1;
}
 
ll modinverse(ll a, ll m){
	ll m0 = m; 
    ll y = 0, x = 1; 
    if (m == 1) return 0; 
    while (a > 1){
        ll q = a / m; 
        ll t = m; 
        m = a % m, a = t; 
        t = y; 
        y = x - q * y; 
        x = t; 
    }
    if (x < 0) x += m0; 
    return x; 
}

mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
 
ll range(ll l, ll r){
	return l + mt()%(r-l+1);
}
 
ll rev(ll v){
	return mpow(v,MOD-2);
}

void solve(){
	string s;
	cin >> s;
	forn(i,sz(s)){
		if(s[i]=='P') cout << 'P';
		else cout << 'D';
	}
	cout << ln;
}
 
int main()
{
	fast_cin();
    ll t=1;
    // cin >> t;
    forn(i,t) {
    	// cout << "Case #" << i+1 << ": ";
    	solve();
    }
    return 0;
}

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

#define ll long long
#define ld long double
#define db double
#define str string
#define pb push_back
#define nl '\n'
#define X first
#define Y second
#define nimble ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define rall(v) rbegin(v),rend(v)
#define selp(a) for(auto i:a)cout<<i<<" ";cout<<nl;
#define mod(x,m) ((((x)%(m))+(m))%(m))
#define _sz(x) (int)x.size()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repv(v) for(int i=0;i<_sz(v);i++)
#define rep1(i,b,a) for(int i=b;i>=a;i--)
#define preci(x) fixed<<setprecision(x)
#define tc int tt=1;cin>>tt;while(tt--)
//ll MLG(ll n,ll b){ll a=0;while(n)a++,n/=b;return a-1;}

#define TRACE
#ifdef TRACE
#define see(...) __f(#__VA_ARGS__,__VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr<<name<<" : "<<arg1<<nl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma=strchr(names+1,',');cerr.write(names,comma-names)<<" : "<<arg1<<" | ";__f(comma+1, args...);
}
#else
#endif

int inf=0x3f3f3f3f;
ll infl=0x3f3f3f3f3f3f3f3fLL;
ld infd=1.0/0.0;
const ll MOD=1e9+7;// 998244353 // = (119<<23)+1
const db pi=2*acos(0.0);

int main(){
    nimble
    ll n,k;
    cin>>n>>k;
    ll x=n%k;
    x=min(x,abs(x-k));
    cout<<x<<nl;
    return 0;
}


Measured memory_bytes: 256
from collections import defaultdict
N,K=map(int,input().split())
alist=list(map(int,input().split()))

adic=defaultdict(int)
for a in alist:
  adic[a]+=1
#print(adic)

if len(adic)<=K:
  print(0)
else:
  freq_list=[]
  for k,v in adic.items():
    freq_list.append(v)
  freq_list.sort(reverse=True)
  #print(freq_list)
  print(sum(freq_list[K:]))

Measured memory_bytes: 32572
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 1<<30;

int main() {
  string S; cin >> S;
  int n = S.size();
  long long ans = 0;
  for(int i = 0; i < (1<<(n-1)); i++) {
    long long t = S[0] - '0';
    for(int j = 0; j < n-1; j++) {
      if(i & (1<<j)) {
        ans += t;
        t = S[j+1] - '0';
      } else {
        t *= 10;
        t += S[j+1] - '0';
      }
    }
    ans += t;
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String datas = br.readLine();
		double r = Double.parseDouble(datas);
		
		double s = r * r * Math.PI;
		double l = 2 * r * Math.PI;
		
		System.out.printf("%.6f %.6f",s,l);
	}
}

Measured memory_bytes: 24640
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x1 = sc.nextInt();
		int y1 = sc.nextInt();
		int x2 = sc.nextInt();
		int y2 = sc.nextInt();	
		sc.close();
		int x = x2-x1;
		int y = y1-y2;
		
		System.out.println((x2+y)+" "+(x+y2)+" "+(x1+y)+" "+(x+y1));
	}
}

Measured memory_bytes: 23124
#pragma GCC optimize("O3")

#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for(int i = 0; i < (a); ++i)
#define pb push_back
#define sz size
#define f first
#define s second

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n, l;
    cin >> n >> l;
    int res = 0;
    FOR(i,l,n+l)
        res+=i;
    if(l<=0 && l+n-1>=0)
        cout << res;
    else
    {
        if(l<0 && l+n-1<0)
            cout << res-(l+n-1);
        else
            cout << res-l;
    }

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int a[10000];
void print(ll a)
{
	if(a!=0)
	{
		if(a%26==0) print(a/26-1);
		else print(a/26);
		if(a%26==0) cout<<'z';
		else cout<<char(a%26+'a'-1);
	}
}
int main()
{
	ll n;cin>>n;
	print(n);

	return 0;
}



Measured memory_bytes: 3592
import java.io.*;
import java.util.*;
import java.util.stream.*;

class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int n = saori.saori_hayami();
		int m = saori.saori_hayami();
		int[] h = new int [n];
		for(int i = 0;i < n;i++){
			h[i] = saori.saori_hayami();
		}
		
		int c[] = new int[n];
		Arrays.fill(c, -1);
		for(int i = 0;i < m;i++){
			int a = saori.saori_hayami();
			int b = saori.saori_hayami();
			if(h[a-1] <= h[b-1]){
				c[a-1] = b;
			}
			if(h[a-1] >= h[b-1]){
				c[b-1] = a;
			}
		}
		int ans = 0;
		for(int i = 0;i < c.length;i++){
			if(c[i] == -1){
				ans++;
			}
		}
		System.out.println(ans);
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 37380
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+5;
const int INF = 1e9;
#define PII pair<int, int>
int rock[maxn];
int dp[maxn];
void do_dp(int n){
	priority_queue<PII, vector<PII>, greater<PII>> pq;
	pq.push(make_pair(0, 1));
	int rh, rn;
	while(!pq.empty()){
		tie(rh, rn) = pq.top(); pq.pop();
		if(dp[rn] != 1e9) continue;
		dp[rn] = rh;
		if(rn + 1 <= n) pq.push(make_pair(rh + abs(rock[rn+1] - rock[rn]), rn + 1));
		if(rn + 2 <= n) pq.push(make_pair(rh + abs(rock[rn+2] - rock[rn]), rn + 2));
	}
}
int main(int argc, char const *argv[])
{
	int n; scanf("%d", &n);
	for(int i = 1; i <= n; i++){
		scanf("%d", &rock[i]);
	}

	fill(dp, dp + n + 1, INF);

	do_dp(n);
	printf("%d\n", dp[n]);

	return 0;
}

Measured memory_bytes: 4624
# include <cstdio>
# include <iostream>
# include <string>
# include <algorithm>
using namespace std;
typedef long long LL;
int main()
{
	LL n;
	LL a[100];
	cin>>n;
	a[0] = 2;
	a[1] = 1;
	for(int i=2 ; i <= 86 ; i++)
	{
		a[i] = a[i-1] + a[i-2];
	}
	cout<<a[n];
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3



# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    H , W = map(int,input().split())

    A = []
    for i in range(H):
        A.append(list(input()))

    B = list(zip(*A))

    AA = []
    for a in A:
        AA.append(all(x == "." for x in a))

    BA = []
    for b in B:
        BA.append(all(x == "." for x in b))

    for a,aa in zip(A,AA):
        if not aa:
            for b,ba in zip(a,BA):
                if not ba:
                    print(b,end="")
            print("")




    # Failed to predict input format
    pass

if __name__ == '__main__':
    main()


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

const int mod = 1e9+7;

int main(){
	long long n,ans=1;
	cin >> n;
	for(int i=1;i<=n;i++){
		ans*=i;
		ans%=mod;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <cmath> 
#include <cctype>

typedef long long ll;
using namespace std;

int main() {
    int D, N;
    cin >> D >> N;
    if (N == 100) {
        if (D == 0) {
            cout << 101 << endl;
            return 0;
        } else if (D == 1) {
            cout << 10100 << endl;
            return 0;
        } else if (D == 2) {
            cout << 1010000 << endl;
            return 0;
        }
    }
    if (D == 0) {
        cout << N << endl;
        return 0;
    } else if (D == 1) {
        cout << 100 * N << endl;
        return 0;
    } else if (D == 2) {
        cout << 100 * 100 * N << endl;
        return 0;
    }
}

Measured memory_bytes: 256
import std.algorithm;
import std.bigint;
import std.concurrency;
import std.container;
import std.conv;
import std.functional;
import std.format;
import std.math;
import std.meta;
import std.numeric;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.traits;
import std.typecons;


auto solve(long A, long B) {
    alias bits = (long i, long x) =>
        x / (2 ^^ (i + 1)) * (2 ^^ i) + max(0, x % (2 ^^ (i + 1)) - 2 ^^ i);

    return iota(63L).map!(i => (bits(i, B + 1) - bits(i, A)) % 2 * (2 ^^ i)).sum;
}


void main() {
    auto input = stdin.byLine.map!split.joiner;

    long A;
    A = input.front.to!long;
    input.popFront;

    long B;
    B = input.front.to!long;
    input.popFront;

    static if (is(ReturnType!solve == void))
        solve(A, B);
    else
        solve(A, B).writeln;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>
#include <complex>

#define rep(i, a, b) for ( int i = (a); i < (b); i++ )
#define per(i, a, b) for ( int i = (b)-1; i >= (a); i--)
#define pb push_back
#define mp make_pair
#define bg begin()
#define en end()
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define sz(v) (int)(v).size()

using namespace std;

typedef long long ll;
typedef long double ld;

using P = pair<int, int>;

static const long long MOD = 1000000007;
static const long long LINF = (ll)(1e18+99);
static const int INF = 1e9+99;

ll ans;

template<typename T>
void dft(vector<complex<T>>& f, bool inv=false) {
  int n = (int)f.size();
  //printf("size:%d, n:%d\n", sz(f), n);
    if (n==1) return;

    vector<complex<T>> f0, f1;
    for (int i = 0; i < n/2; i++) {
        f0.push_back(f[i*2]);
        f1.push_back(f[i*2+1]);
    }
    dft<T>(f0, inv), dft<T>(f1, inv);

    complex<T> now = 1.0, zeta = polar(1.0, 2.0 * acos(-1) / n);
    if (inv) zeta = 1.0 / zeta;
    for (int i = 0; i < n; i++) {
        f[i] = f0[i % (n/2)] + f1[i % (n/2)] * now;
        now *= zeta;
    }
    return;
}

template<typename T>
vector<T> multiply(vector<T> f, vector<T> g) {
    int n = 1;
    while (n < (int) f.size() + (int)g.size() + 1) n *= 2;
    f.resize(n), g.resize(n);
    
    vector<complex<T>> ff(n, 0), gg(n, 0), fg;
    for (int i = 0; i < f.size(); i++) {
        ff[i] = f[i];
        gg[i] = g[i];
    }
    dft<T>(ff, false);
    dft<T>(gg, false);
    
    for (int i = 0; i < n; i++) fg.push_back(ff[i] * gg[i]);
    dft<T>(fg, true);
    
    vector<T> res;
    for (int i = 0; i < n; i++) res.push_back(fg[i].real()/n);
    
    
    return res;
}


int main(void) {
    int n;
    ll m;
    cin >> n >> m;
    vector<double> A1(100005, 0), A2(100005, 0);
    for(int i=1; i<=n; i++) {
        int a;
        cin >> a;
        A1[a]++;
        A2[a]++;
    }
    
    vector<double> B = multiply<double>(A1, A2);
    vector<ll> C;
    rep(i, 0, sz(B)) {
      C.pb((ll)(B[i]+0.5));
    }
    
    ll mm = 0;
    for(int i=sz(C)-1; i>=0; i--) {
      if (C[i]==0) continue;
      
      ans += i*C[i];
      mm += C[i];
      if (mm>=m) {
        ans -= (mm-m)*i;
        break;
      }
    }
  
    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 29952
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    int a[n];
    map<int,int> mp;
    int ans=0;
    for(int i=0;i<n;i++){
        cin >> a[i];
        mp[a[i]]++;
        mp[a[i]-1]++;
        mp[a[i]+1]++;
        ans=max(ans,max(mp[a[i]],max(mp[a[i]-1],mp[a[i]+1])));
    }
    cout << ans;
}

Measured memory_bytes: 8392
#include <iostream>

using std::cin;
using std::cout;
using std::endl;

int main ()
{
  int n, k, x, y;

  cin >> n;
  cin >> k;
  cin >> x;
  cin >> y;

  if (n - k > 0) {
    cout << k * x + (n - k) * y << endl;
  } else {
    cout << n * x << endl;
  }
}


Measured memory_bytes: 256
x, y = map(str, input().split())
s = ['A', 'B', 'C', 'D', 'E', 'F']
for i in range(6):
    if x == s[i]:
        xi = i
    if y == s[i]:
        yi = i
if xi > yi:
    print('>')
elif xi < yi:
    print('<')
else:
    print('=')

Measured memory_bytes: 38384
#include <stdio.h>
#include <stdlib.h>

long *tree[100001];
long *distance[100001];

int main(void) {

  long n;
  scanf("%ld", &n);
  long tree_s[n+1];
  for (long i = 1; i <= n; i++) {
    tree_s[i] = 0;
  }
  long a,b,c;
  for (long i = 0; i < n-1; i++) {
    scanf("%ld %ld %ld", &a, &b, &c);
    tree_s[a]++;
    tree[a] = realloc(tree[a],sizeof(long)*(tree_s[a]+1));
    distance[a] = realloc(distance[a],sizeof(long)*(tree_s[a]+1));
    tree[a][tree_s[a]] = b;
    distance[a][tree_s[a]] = c;
    tree_s[b]++;
    tree[b] = realloc(tree[b],sizeof(long)*(tree_s[b]+1));
    distance[b] = realloc(distance[b],sizeof(long)*(tree_s[b]+1));
    tree[b][tree_s[b]] = a;
    distance[b][tree_s[b]] = c;
  }
  long q,k;
  scanf("%ld %ld", &q, &k);
  long x[q],y[q];
  for (long i = 0; i < q; i++) {
    scanf("%ld %ld", &x[i], &y[i]);
  }

  long select[n+1];
  long root[n+1];
  long path[n+1];
  for (long i = 1; i <= n; i++) {
    select[i] = 0;
    root[i] = -1;
    path[i] = 0;
  }
  root[k] = 0;

  long cur = k;
  long next;
  while (1) {
    select[cur]++;
    if (select[cur] <= tree_s[cur]) {
      next = tree[cur][select[cur]];
      if (next == root[cur]) {
        continue;
      }
      root[next] = cur;
      path[next] = path[cur]+distance[cur][select[cur]];
      cur = next;
    } else {
      if (cur == k) {
        break;
      }
      cur = root[cur];
    }
  }

  for (long i = 0; i < q; i++) {
    printf("%ld\n", path[x[i]]+path[y[i]]);
  }

  return 0;
}

Measured memory_bytes: 15284
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  double n, m, d;
  cin>>n>>m>>d;
  if(d==0) cout<<setprecision(20)<<(n-d)*(m-1)/(n*n)<<endl;
  else cout<<setprecision(20)<<2*(n-d)*(m-1)/(n*n)<<endl;
}



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


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

	std::map<string, int> m;
	for (int i = 0; i < n; i++)
	{
		string s;
		cin >> s;
		m[s]++;
	}
	cout << m.size() << endl;
}

Measured memory_bytes: 19204
import java.util.*;
public class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int A = sc.nextInt();
      int B = sc.nextInt();
      int C = sc.nextInt();
      long K = sc.nextLong();
      if(K%2==0){
            System.out.println(A-B);
      }else{
            System.out.println(B-A);
      }
   }
}

Measured memory_bytes: 21716
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

h, w = MAP()
a = [list(STR()) for _ in range(h)]
i = 0
while i < len(a):
    if set(a[i]) == set(['.']):
        del a[i]
    else:
        i += 1
j = 0
while j < len(a[0]):
    arr = [a[i][j] for i in range(len(a))]
    if set(arr) == set(['.']):
        for i in range(len(a)):
            del a[i][j]
    else:
        j += 1
for i in range(len(a)):
    print(''.join(a[i]))


Measured memory_bytes: 5260
#include <stdio.h>
#include <vector>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>
 
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;


int binary_search_upper(vi& list, int val, int r=-1){
  int l=-1;
  if (r==-1) r = list.size();

  while (r-l>1){
    int m = (r + l) / 2;
    if (val < list[m]) r = m;
    else l = m;
  }
  return r;
}

int binary_search_lower(vi& list, int val, int r=-1){
  int l=-1;
  if (r==-1) r = list.size();

  while (r-l>1){
    int m = (r + l) / 2;
    if (val <= list[m]) r = m;
    else l = m;
  }
  return r;
}


int main() {
  int n;
  cin >> n;
  vi a(n), b(n), c(n);

  rep(i, n) cin >> a[i];
  rep(i, n) cin >> b[i];
  rep(i, n) cin >> c[i];

  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  sort(c.begin(), c.end());

  ll ans = 0;
  int preb_rb = -1;
  int preb_rc = -1;
  for(int i=n-1;i>=0;i--){
    int rb = binary_search_lower(a, b[i], preb_rb);
    int rc = binary_search_upper(c, b[i], preb_rc);

    ans += (ll) (rb) * (n - rc);
    // cout << i << " " <<  rb << " * " << n - rc << " ans " << ans <<  endl; 
    preb_rb = rb;
    preb_rc = rc;
  }
  cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1408
import sys
input = sys.stdin.readline
def print_ans(N):
    """Test Case
    >>> print_ans(11)
    9
    >>> print_ans(136)
    46
    >>> print_ans(100000)
    90909
    """
    counter = 0
    for i in range(1, N + 1):
        if len(str(i)) % 2 != 0:
            counter +=1
    print(counter)


if __name__ == '__main__':
    N = int(input().rstrip())
    print_ans(N)


Measured memory_bytes: 2940
// SeeAlso: 

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define MAX 100000
#define NIL -1
#define MOD 1000000007

typedef int _loop_int;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define debug(x) cout<<#x<<": "<<x<<endl
#define debig_vec(v) cout<<#v<<":";rep(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

// 最大公約数
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);}

#define print2D(h, w, arr) rep(i, h) { rep(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x){cout << setprecision(12) << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }

int main() {
    ll n;
    cin >> n;
    int a[5];
    a[1] = 0;
    a[2] = 0;
    a[4] = 0;
    rep(i, n) {
        ll t;
        cin >> t;
        if(t%2==1) {
            a[1]++;
        } else if (t%4==0) {
            a[4]++;
        } else {
            a[2]++;
        }
    }

    bool flag = (a[1]<= a[4]) || (a[2]==0 && a[4]==a[1]-1);

    print(flag?"Yes":"No"); 
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fr first
#define se second
#define ll long long
#define pb push_back
using namespace std;
const ll N = 3e5 + 7;
long long n , m , a , cnt;
vector< string >v;
string z ="O";
int main() {
    cin >> n >> m;
    for( int i = 0;i < m;i ++)
    cin >>a  , cnt +=a;
    if( cnt >= n )
        cout << "Yes";
    else
        cout << "No";
}


Measured memory_bytes: 256
s =int(input())
a = []
a.append(s)
memory = []
memory.append(s)
while True:
    n = a.pop()
    if n % 2 == 0:
        a.append(n//2)
        if n//2 in memory:
            memory.append(n//2)
            break
        else:
            memory.append((n//2))

    else:
        a.append(3*n+1)

        if 3*n+1 in memory:
            memory.append(3*n+1)
            break
        else:
            memory.append(3*n+1)

print(len(memory))

Measured memory_bytes: 38256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i ++)
#define irep(i,n) for (int i = (int)(n) - 1;i >= 0;--i)
using namespace std;
using ll = long long;
using PL = pair<ll,ll>;
using P = pair<int,int>;
constexpr int INF = 1000000000;
constexpr long long HINF = 1000000000000000;
constexpr long long MOD = 1000000007;// = 998244353;
constexpr double EPS = 1e-4;
constexpr double PI = 3.14159265358979;

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

    int H,W,M; cin >> H >> W >> M;
    vector<int> row(H,0),column(W,0);
    vector<map<int,int>> grid(H);

    rep(i,M) {
        int r,c; cin >> r >> c;
        --r; --c;
        row[r]++;
        column[c]++;
        grid[r][c]++;
    }

    vector<P> col(W);
    rep(i,W) {
        col[i] = make_pair(column[i],i);
    }
    sort(col.begin(),col.end(),greater<P>());


    int ans = 0;
    rep(i,H) {
        int x = 0,j = 0;
        while (1) {
            if (j >= W) break;
            if (!grid[i].count(col[j].second)) {
                x = max(x,col[j].first);
                break;
            }
            else {
                x = max(x,col[j].first - grid[i][col[j].second]);
                ++j;
            }
        }
        ans = max(ans,x + row[i]);
    }
    cout << ans << '\n';
    return 0;
}

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

int main() {
int A, B;
cin >> A >> B;

if(A % 3 == 0) { cout << "Possible" << endl; return 0; }
if(B % 3 == 0) { cout << "Possible" << endl; return 0; }
if((A + B) % 3 == 0) { cout << "Possible" << endl; return 0; }


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



Measured memory_bytes: 3584
var abc = require('fs').readFileSync('/dev/stdin', 'utf8').split(' ').map(Number);
var a = abc[0];
var b = abc[1];
var c = abc[2];

var i;
var result = 0;
for (i = a; i <= b; i++) {
  if (c % i === 0) {
    result++;
  }
}
console.log(result);

Measured memory_bytes: 15584
#define FOR(i,a,b) for (int i=(a); i<(b); i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>

using namespace std;

int main(){
    int a, b, c;
    int min_p;

    cin >> a >> b >> c;
    int s[3] = {a + b, a + c, b + c};
    
    min_p = s[0];
    for(int i = 0; i < 3; i++){
        min_p = MIN(min_p, s[i]);
    }
    cout << min_p << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<ctime>
#include<cstdio>
#include<string>
//#include<string>
//#include<sstream>
using namespace std;

int main()
{
	//char a[1000];
	string a;
	getline(cin,a);
	//gets(a);
	//printf("A%cC\n",a[8]+32);
	cout<<"A"<<a[8]<<"C"<<endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
// Custom Header {{{
#define ALL(x) x.begin(), x.end()
#define rep(i, s, n)      for(int i(s); i < int(n); ++i)
#define endl '\n'
#ifndef YDK
#define eprintf(...)
#endif
using namespace std;
using i64 = long long;
using pii = pair<i64, i64>;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr const int INF  = 0x3f3f3f3f;
constexpr const i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr const int MOD  = int(1e9) + 7;
// }}}

// Library {{{

// }}}


signed main()
{
    int N;
    int even = 0;
    int odd = 0;

    cin >> N;
    rep(i, 0, N) {
        int a; cin >> a;
        if (a & 1) {
            ++odd;
        } else {
            ++even;
        }
    }

    while(even >= 2 || odd >= 2) {
        if (even >= 2) {
            --even;
        } else if (odd >= 2) {
            odd -= 2;
            ++even;
        }
    }

    if ((even == 1 || odd == 1) && (even + odd == 1)) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
// ??¨????????????????????????O(NloglogN?)
const ll MAX = 10004;
bool isPrime[MAX];
vector<int> prime;
void makePrime(){
  for (ll i = 0; i < MAX; i++) isPrime[i] = true;
  for (ll i = 2; i * i < MAX + 1; i++){
    if(isPrime[i]){
      for (ll j = 2 * i; j < MAX; j += i) {
        isPrime[j] = false;
      }
    }
  }
  for(int i = 0; i < MAX; i++) if(isPrime[i]) prime.push_back(i);
  return;
}
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  makePrime();
  int a, b, m;
  int n = prime.size();
  sort(prime.begin(), prime.end());
  while(cin >> m >> a >> b, m||a||b) {
    int p = 0, q = 0, mx = p * q;
    FOR(i,0,n) {
      FOR(j,i,n) {
        if(prime[i] * prime[j] > m) break;
        if(a * prime[j] <= prime[i] * b && prime[i] * prime[j] <= m) {
          if(mx < prime[i] * prime[j]) {
            p = prime[i];
            q = prime[j];
            mx = prime[i] * prime[j];
          }
        }
      }
    }
    cout << p << " " << q << endl;
  }
  return 0;
}

Measured memory_bytes: 3148
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define ALL(i) i.begin(),i.end()
#define SZ(i) ll(i.size())
#define MEM(i,n) memset(i,(n),sizeof(i))
#define X first
#define Y second
#define eb emplace_back
#ifdef tmd
#define IOS()
#define debug(...) fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);_do(__VA_ARGS__);
template <typename T> void _do(T &&x){cerr<<x<<endl;}
#else
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#define debug(...)
#define endl '\n'
#endif

const ll INF = 0x3f3f3f3f3f3f3f3f;
double t,x;
int main () {
	IOS();
	cin >> t >> x;
	cout << fixed << setprecision(6) << t/x << endl;
	return 0;
}

Measured memory_bytes: 256
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')

def main():
    X,A,B=MI()
    C=A-B
    if A>=B:
        print("delicious")
    elif B-A<=X:
        print("safe")
    else:
        print("dangerous")
    
if __name__ == '__main__':
    main()

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

#define PI 3.14159265359

int main() {
    double R;
    cin >> R;

    cout << R * 2 * PI << endl;

    return 0;
}



Measured memory_bytes: 3808
#include<cstdio>
using namespace std;
typedef long long ll;
int main(){
    int n,cnt;
    ll k,a[100000],two[40],x=0,ans=0;
    scanf("%d %lld",&n,&k);
    for(int i=0;i<n;i++){
        scanf("%lld",&a[i]);
    }
    two[0]=1;
    for(int i=1;i<40;i++){
        two[i]=two[i-1]*2;
    }
    for(int i=39;i>=0;i--){
        if(x+two[i]<=k){
            cnt=0;
            for(int j=0;j<n;j++){
                if((two[i]&a[j])){
                    cnt++;
                }
            }
            if(2*cnt<n){
                x+=two[i];
            }
        }
    }
    for(int i=0;i<n;i++){
        ans+=(x^a[i]);
    }
    printf("%lld\n",ans);
}


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

int main(){
    int N; cin >> N;
    vector<int> A(N);

    for( int &k : A ) cin >> k;


    long long sum = 0;
    long long ans = 0;
    for( int i = 0; i < N; i++ ){
        if( i == 0 ){
            for( int j = 0; j < N; j++ ){
                ans += pow(-1,j) * A[j];
            }
        } else {
            ans -= 2*(sum - A[i-1]);
        }
        cout << ans;
        sum = ans;
        if( i != N-1 ) cout << " ";
    }

    cout << endl;
}

Measured memory_bytes: 1664
s = str(input())
j = list(set(list(s)))
c1 = j[0]
try:
    c2 = j[1]
except:
    print("No")
    exit()
if len(j) == 2 and s.count(c1) == 2 and s.count(c2) == 2:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int N; long long W;
    while(cin >> N >> W){
        vector<vector<long long>> v(2), w(2);
        for(int i=0;i<N;i++){
            long long a, b; cin >> a >> b;
            v[i%2].push_back(a);
            w[i%2].push_back(b);
        }
        vector<vector<pair<long long, long long>>> vp(2);
        for(int i=0;i<2;i++){
            for(int j=0;j<(1<<v[i].size());j++){
                long long sumV = 0, sumW = 0;
                for(int k=0;k<v[i].size();k++){
                    if(j&(1<<k)){
                        sumV += v[i][k];
                        sumW += w[i][k];
                    }
                }
                if(sumW > W) continue;
                vp[i].emplace_back(sumW, sumV);
            }
            sort(vp[i].begin(), vp[i].end());
            long long m = 0;
            for(auto& p : vp[i]){
                m = max(m, p.second);
                p.second = m;
            }
        }
        int idx = vp[1].size() - 1;
        long long res = 0;
        for(auto& p : vp[0]){
            while(p.first + vp[1][idx].first > W) --idx;
            res = max(res, p.second + vp[1][idx].second);
        }
        cout << res << endl;
    }
}


Measured memory_bytes: 43660
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {
        n:usize,
        b:[[usize;n];n],
    }
    let mut a = vec![vec![false; n + 1]; n + 1];
    let mut t = vec![0; n];
    for i in 0..n {
        for j in 0..n {
            t[i] |= if b[i][j] == 1 { 1 << j } else { 0 };
            a[i][j] = if b[i][j] == 1 { true } else { false };
        }
    }
    // dbg!(&a);
    let mut dp = vec![0i64; 1 << n + 2];
    dp[0] = 1i64;
    for s in 1..(1usize << n) {
        let i = s.count_ones() as usize;
        for j in 0..n {
            if (((s >> j) & 1) == 1) && a[i - 1][j] {
                dp[s] = (dp[s] + dp[s ^ (1usize << j)]) % MOD;
            }
        }
    }
    println!("{}", dp[(1 << n) - 1]);
}

const MOD: i64 = 1000000007;


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

int main(void){
int H;
int W;
int a;
int i;
int c;

scanf("%d %d",&H,&W);

for(a=1;a>0;a++){
  for(i=1;i<=H;i++){
    for(c=1;c<=W;c++){
      if(i==1){
      printf("#");}
      else{
        if(i==H){
        printf("#");}
        else{
          if(c==1){
          printf("#");}
            else{
            if(c==W){
            printf("#");}
              else{
              printf(".");}}}}}
    printf("\n");}
  scanf("%d %d",&H,&W);
  printf("\n");
  if(H==0 && W==0){
  break;}
}
return 0;
}


Measured memory_bytes: 2040
import java.util.*;

public class Main {
    static final int NUMBER = 998244353;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        List<ABC179DTuple> tuples = new ArrayList<>(k);
        for(int i=0; i<k; i++) {
            int l = in.nextInt();
            int r = in.nextInt();
            ABC179DTuple tuple = new ABC179DTuple();
            tuple.l = l;
            tuple.r = r;
            tuples.add(tuple);
        }
        long[] table = new long[n+1];
        long[] upDown = new long[n+1];
        long up = 0;
        table[1] = 1;
        for(int i=1; i<=n; i++) {
            up += upDown[i];
            table[i] += up;
            table[i] = table[i] % NUMBER;
            for(int j=0; j<k; j++) {
                ABC179DTuple tuple = tuples.get(j);
                if(i+tuple.l <= n) {
                    upDown[i+tuple.l] += table[i];
                }
                if(i+tuple.r+1 <= n) {
                    upDown[i+tuple.r+1] -= table[i];
                }
            }
        }
        System.out.println(table[n]);
    }
}
class ABC179DTuple {
    int l;
    int r;
}


Measured memory_bytes: 39372