akhauriyash/Code-Regression huggingface dataset:
def main():
    # N=int(input())
    N,M = list(map(int,input().split()))
    ary = [[0 for _ in range(M)] for _ in range(N)]
    for i in range(N):
        a = list(map(int,input().split()))
        for j,elem in enumerate(a):
            if j == 0:
                continue
            ary[i][elem-1] = 1
    cnt = 0
    for j in range(M):
        ok = True
        for i in range(N):
            ok = ok and (ary[i][j]==1)
        if ok:
            cnt += 1
    print(cnt)
    return 0

if __name__=='__main__':
    main()

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

int swap(char *a,char *b){
  char tmp[101];
  strcpy(tmp,b);
  strcpy(b,a);
  strcpy(a,tmp);
  
  return 0;
}

int compare(char *a,char *b,int len){
  int i,j;
  for(i=0;i<len;i++){
    if(a[i]<b[i]){
      return -1;
    } else if(a[i]>b[i]){
      return 1;
    }
  }
  return 0;
}

int main(){
  char s[100][101];
  int i,j,n,l,check;
  
  scanf("%d %d",&n,&l);
  
  for(i=0;i<n;i++){
    scanf("%s",s[i]);
  }
  
  //compare
  for(i=n;0<i;i--){
    for(j=0;j<(i-1);j++){
      check=compare(s[j],s[j+1],l);
      
      if(check==1){
        swap(s[j],s[j+1]);
      } 
    }
  }
  
  for(i=0;i<n;i++){
    printf("%s",s[i]);
  }
}

Measured memory_bytes: 128
# ABC144b


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)

    # map(int,input().split())

    n = int(input())
    for i in range(1, 10):
        if n % i != 0:
            continue
        for j in range(1, 10):
            if n//i % j != 0:
                continue
            if 0 <= n//i//j <= 1:
                print('Yes')
                exit(0)
    print('No')


if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)
#define Yes(condition) if(condition) cout << "Yes" << '\n'; else{ cout << "No" << '\n'; }
#define YES(condition) if(condition) cout << "YES" << '\n'; else{ cout << "NO" << '\n'; }
#define yes(condition) if(condition) cout << "yes" << '\n'; else{ cout << "no" << '\n'; }




int main() {
    ll n, a, b;
    cin >> n;
    if(n == 1){
        cout << "Hello World" << endl;
    }
    else{
        cin >> a >> b;
        cout << a + b << endl;
    }
}


Measured memory_bytes: 256
import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val MOD = 1e9.toLong + 7

  def repeatSquares(x: Long, n: Long): Int = {
    n match{
      case 0 => 1
      case _ =>
        n % 2 == 0 match{
          case true  => repeatSquares(x*x % MOD, n/2)
          case false =>
            ((x * repeatSquares(x*x % MOD, n/2).toLong) % MOD).toInt
        }
    }
  }

  val N = in.next().toInt
  val X = in.next().toInt
  val _S = new Array[Int](N)

  for (i <- 0 until N)
    _S(i) = in.next().toInt


  //
  val S = 0 +: _S.sorted.reverse
  val dp = Array.ofDim[Long](N+1, X+1)
  for (n <- 0 to N; x <- 0 to X)
    dp(n)(x) = -1L

  def calc(i: Int, X: Int): Long = {
    if(i == N)
      X % S(i)
    else if(dp(i)(X) != -1L)
      dp(i)(X)
    else {
      val denom = repeatSquares(N+1-i, MOD-2) % MOD
      val r1 = (denom * calc(i+1, X % S(i))) % MOD
      val r2 = ((N-i) * denom % MOD) * calc(i+1, X) % MOD
      dp(i)(X) = (r1 + r2) % MOD
      dp(i)(X)      
    }
  }

  def fact(n: Long, acc: Long): Long =
    if(n == 1)
      acc
    else
      fact(n-1, (n*acc) % MOD)

  val expected = calc(1, X) % MOD
  val ans = expected * fact(N, 1L)
  println(ans % MOD)
}


class InputReader(stream: InputStream) {
  private val reader = new BufferedReader(new InputStreamReader(stream))
  private var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}



Measured memory_bytes: 227652
//#pragma GCC optimize "trapv"
//-D_GLIBCXX_DEBUG
#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 pm(m) for(auto itr=(m).begin();itr!=(m).end();itr++){itr->first<<" "<<itr->second<<"\n";}
#define int long long int
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define ii pair<int,int>
#define Max 100000+5
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define f first
#define s second
#define pb push_back
#define bug(x) cout<<(x)<<" ";exit(0);
int mod = 1000000007;
int mod1 = 998244353;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
vector<int> g[Max];
bool vis[Max];
int d, x, y;
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
void ex(int A, int B) {
    if(B == 0) {
        d = A;
        x = 1;
        y = 0;
    }
    else {
        ex(B, A%B);
        int temp = x;
        x = y;
        y = temp - (A/B)*y;
    }
}


void dfs(int u){

	vis[u]=1;
	for(int i=0;i<g[u].size();i++){
		int v=g[u][i];
		if(vis[v]!=1)
			dfs(v);
	}
}



int power(int a,int b){
    if(b==1)return a;
    if(a>mod)a%=mod;
    int r=1;
    while(b){
        if(b&1)r=r%mod*a%mod;
        a=a%mod*a%mod;
        b/=2;
    }
    return r;
}
class uf{
    vector<int> v;
    vector<int> sz;
    
    
    public :
    uf(int n){
        v.resize(n+1);
        iota(v.begin()+1,v.end(),1);
        sz.resize(n+1,1);
        //1 to sz
    }
    int root(int b){
        while(v[b]!=b){
            b = v[b];
        }   
        return b;
    }
    void u(int a, int b){
        //combine a and b
        
        int ra=root(a);
        int rb=root(b);
        if(ra==rb)return ;
        if(sz[ra]<sz[rb]){
            v[ra] = v[rb];
            sz[rb]+=sz[ra];
        }else{
            v[rb]=v[ra];
            sz[ra]+=sz[rb];
        }
    }
    bool f(int a,int b){
        //same set
        return (root(a)==root(b));
    }
   
    
};
vector<int> matmul(vector<int> a,vector<int> b){
    vector<int> c(4,0);
    c[0] = (a[0]%mod*b[0]%mod + a[1]%mod*b[2]%mod)%mod;
    c[1] = (a[0]%mod*b[1]%mod + a[1]%mod*b[3]%mod)%mod;
    c[2] = (a[2]%mod*b[0]%mod + a[3]%mod*b[2]%mod)%mod;
    c[3] = (a[2]%mod*b[1]%mod + a[3]%mod*b[3]%mod)%mod;
    return c;
}
vector<int> id={1,0,0,1};

int32_t main(){
	IO
	//freopen("input.txt","r",stdin);
    	//freopen("output.txt","w",stdout);
	int n;
	cin>>n;
	string s;
	cin>>s;
	n%=26;
	for(int i=0;i<s.length();i++)s[i] = s[i]+n >90? s[i]+n-90+64:s[i]+n;
	cout<<s;
}

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;

#if !ONLINE_JUDGE
#define debug
#endif

using namespace std;
 
/*******  All Required define Pre-Processors and typedef Constants *******/
#define mem(a, b) memset(a, (b), sizeof(a))
#define repd(i,k) for(int i=k;i>=0;i--)
#define rep(i,k) for(int i=0;i<k;i++)
#define repn(i,k1,k2) for(ll i=k1;i<k2;i++)
#define sz(x) (ll)(x).size()
#define ff first
#define ss second

#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
#define ee6 (ll)1000001
#define ee5 (ll)100001

#define trav(a, v) for(auto& a : v)

#define tt ll t;cin>>t; while(t--)
typedef long long int ll;
 
typedef pair<ll, ll> pr;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef vector<pr> vpr;
typedef vector<vpr>vvpr;
typedef vector<vi> vvi;

//*X.find_by_order(2) element at index=2
//X.order_of_key(1) how many elements strictly less than 1

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
    tree_order_statistics_node_update>;

#ifdef debug
#define dbg(...) { cerr<<"[ "; dump(#__VA_ARGS__, __VA_ARGS__);}
#undef endl
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &x) {
    return out<<"("<<x.ff<<","<<x.ss<<")";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const unordered_map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
} 
 
template <typename Arg1>
void dump(const string name, Arg1&& arg1){
    cerr << name << " : " << arg1 << " ] " << endl;
}
 
template <typename Arg1, typename... Args>
void dump(const string names, Arg1&& arg1, Args&&... args){
    const string name = names.substr(0,names.find(','));
    cerr<<name<<" : "<<arg1<<" | ";
    dump(names.substr(1+(int)name.size()), args...);
}
#else
    #define dbg(args...)
#endif
 
ll powmod(ll x, ll y) 
{ 
    ll res = 1;  
    x = x % MOD;
    while (y > 0) 
    { 
        if (y & 1) 
          res = (res*x) % MOD; 
        y = y>>1; // y = y/2 
        x = (x*x) % MOD;   
    } 
    return res; 
} 

int a[3*ee5];
int main()
{
  #if !ONLINE_JUDGE
  //freopen("in.txt","r",stdin);
  #endif
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
  ll n;cin>>n;
  rep(i,n+n+n)cin>>a[i];

  sort(a,a+n+n+n);
  ll ans=0;
  for(ll i=n;i<n+n+n;i+=2)
    ans+=a[i];
  cout<<ans;   
}

Measured memory_bytes: 1408
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int k;
    cin>>k;
    string s;
    cin>>s;
    int n=s.length();
    if(n<=k){
        cout<<s<<endl;
    }
    else{
        s.erase(k,n);
        s.append("...");
        cout<<s<<endl;
    }
    
    return 0;
}

Measured memory_bytes: 3656
require 'prime'
require 'set'
require 'tsort'
include Math
ALP = ('a'..'z').to_a
INF = 0xffffffffffffffff
def max(a,b);              a > b ? a : b                              end
def min(a,b);              a < b ?  a : b                             end
def swap(a,b);             a, b = b, a                                end
def gif;                   gets.to_i                                  end
def gff;                   gets.to_f                                  end
def gsf;                   gets.chomp                                 end
def gi;                    gets.split.map(&:to_i)                     end
def gf;                    gets.split.map(&:to_f)                     end
def gs;                    gets.chomp.split.map(&:to_s)               end
def gc;                    gets.chomp.split('')                       end
def pr(num);               num.prime_division                         end
def pr?(num);              Prime.prime?(num)                          end
def digit(num);            num.to_s.length                            end
def array(s,ini=nil);      Array.new(s){ini}                          end
def darray(s1,s2,ini=nil); Array.new(s1){Array.new(s2){ini}}          end
def rep(num);              num.times{|i|yield(i)}                     end
def repl(st,en,n=1);       st.step(en,n){|i|yield(i)}                 end


n=gif
sn = n.to_s.split('').map{|i|i.to_i}.inject(:+)

puts n % sn == 0 ? "Yes" : "No"


Measured memory_bytes: 2428
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <functional>
#include <cmath>
#include <cstring>
#include <numeric>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <complex>
#include <list>
#include <cassert>

#define addf(T) [](T a, T b){return (a + b);}
#define minf(T) [](T a, T b){return min(a, b);}
#define maxf(T) [](T a, T b){return max(a, b);}

using namespace std;
using ll = long long;

/*
struct UnionFind {
    // union tree
    // used for tracking a set of elements partitioned into a number of disjoint subsets
    // rankなしでの実装

    vector<int> par;
    // par[i] means i's parent
    // (ex) par[3] = 2 means 2 is a parent of 3

    UnionFind(int N) : par(N) {
      //used for initialization
      for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) {
      // データxが属する木の根を再帰で得る
      // root(x) = {xの木の根}
      if (par[x] == x) return x;
      return par[x] = root(par[x]);
    }

    void unite(int x, int y) {
      // xとyのtreeのmerge
      int rx = root(x); //xの根をrx
      int ry = root(y); //yの根をry
      if (rx == ry) return; //同じ時はそのままに
      par[rx] = ry; //xの根rxをyの根ryにつける
    }

    bool same(int x, int y) {
      // 2つのデータx, yが属する木が同じならtrueを返す
      int rx = root(x);
      int ry = root(y);
      return rx == ry;
    }
};

template<typename T>
struct SegTree {
  //segment tree

  //木は配列で表現
  vector<T> seg;
  //木の1/2の大きさ
  int size;
  //単位元
  const T unit;
  //比較関数の型
  using F = function<T(T,T)>;
  //mergeする関数
  const F f;

  //単位元がaで大きさnのsegtreeの初期化を行う
  //大きさnとはすなわち葉の数がnであることをいう
  SegTree(int n, const T a, const F f) : unit(a), f(f) {
    size = 1;
    while(size < n) size <<= 1;
    seg.assign(2*size, unit);
    size--;
  }

  //k番目にtを代入する
  void set(int k, const T& t) {
    seg[k + size] = t;
  }

  //関数fによって木を構築する
  void build(){
    for (int i = size - 1; i >=0; i--){
      seg[i] = f(seg[i*2+1],seg[i*2+2]);
    }
  }

  //i番目の要素を返す
  T operator[](const int i){
    return seg[i + size];
  }

  //k番目の値をaに更新する
  void update(int k, T a){
    k = k + size;
    //必要ならばここを変えても良い
    seg[k] = a;
    //自分の親の情報を再帰的に更新していく
    while(k>0){
      k = ((k-1) >> 1);
      seg[k] = f(seg[k*2+1],seg[k*2+2]);
    }
  }

  //[a,b)についてfをした結果を返す
  //例えば、fがminだったらどうなるかを考えるとわかりやすい
  //unitについては足し算なら0,掛け算なら1,minならinf,どんな値が来てもその値を返すもの
  T query(int a, int b, int k, int l, int r) {
    if (r <= a || b <= l) {
      return unit;
    } else if (a <= l && r <= b) {
      return seg[k];
    } else {
      T lch = query(a, b, k * 2 + 1, l, (l + r) / 2);
      T rch = query(a, b, k * 2 + 2, (l + r) / 2, r);
      return f(lch, rch);
    }
  }
  T query(int a, int b) { return query(a, b, 0, 0, size+1); }
};
*/

/* --- ここからコード --- */

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

  ll c = N / (A+B);
  ll ans = 0;
  for(ll i = 0; i < c; i++){
    ans = ans + A;
  }
  ll d = N % (A+B);
  ans = ans + minf(ll)(d,A);
  cout << ans << endl;

  return 0;
}

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

int main(){
	int A, B;
	cin >> A >> B;
	string s;
	cin >> s;
	for(int i = 0;i < s.size();i++){
		if(i != A){
			if(s.at(i) == '-'){
				cout << "No" << endl;
				return 0;
			}
		}
		else{
			if(s.at(i) != '-'){
				cout << "No" << endl;
				return 0;
			}
		}
	}
	cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  string S,T,U;
  int A,B;
  cin >> S >> T >> A >> B >> U;
  if(U == S){
    A--;

  }
  else{
  
    B--;
  }
  cout << A <<" " << B << endl;
  }



Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>

int main() {

    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);

    if ((a > b && b > c) || (a > c && c > b)) {
        printf("%d", b * c / 2);

    } else if ((b > a && a > c) || (b > c && c > a)) {
        printf("%d", a * c / 2);

    } else {
        printf("%d", a * b / 2);

    }




    return 0;

}


Measured memory_bytes: 128
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int i = 0;
        int n = sc.nextInt();

        String s = sc.next();
        String t = sc.next();
        String result = "";

        while(i < n)
        {
            result += s.charAt(i);
            result += t.charAt(i);
            i++;
        }

        System.out.println(result);

    }
}


Measured memory_bytes: 21844
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <random>
#include <chrono>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <sstream>
#include <assert.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

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

template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";}
template <typename T, typename... V>void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef HOME
#warning CHECK int:ll::INT_MAX:LLONG_MAX
#define maxn 20
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define maxn 2000006
#define gcd __gcd
#define debug(x...)
#endif

#define ff first
#define endl '\n'
#define ss second
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define PI 3.14159265358979323846264338327950L
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fr(i,x,n) for(int i=x;i>=n;i--)
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

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


int main() {

	vector<int> a(3, 0); for (int i = 0; i <= 2; i++) cin >> a[i];
	sort(a.begin(), a.end());
	cout << a[0] + a[1];

	return 0;
}

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

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

int main() {
    int k;
    cin >>  k;
    ll total = 0;

    rep2(a,1,k+1){ rep2(b,1,k+1) {rep2(c,1,k+1){
       // cout << "e";
        int tmp = gcd(a,b);
        total += gcd(tmp,c);
    }}}

    

    cout << total;

    
}

Measured memory_bytes: 3676
#include <bits/stdc++.h>
using namespace std; 
int main() { 
    //freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	int a,b,c;
	cin>>a>>b>>c;
	int cnt=0;
	if(a==b)cnt++;
	if(a==c)cnt++;
	if(b==c)cnt++;
	if(cnt==1)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
    return 0; 
}/*
*/

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define vi vector<int>
#define vl vector<ll>
#define vs vector<string>
#define vc vector<char>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,m;
    cin >> n >> m;
    int p = 1;
    rep(_,m) p *= 2;
    cout << (1900*m+100*(n-m))*p;
}


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

int main() {
  int N, K;
  cin >> N >> K;

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

  sort(students.begin(), students.end());

  int cannot = N;

  for(int i=0;i<N;i++) {
    if(students[i] < K) {
      continue;
    } else {
      cannot = i;
      break;
    }
  }

  cout << N - cannot << endl;
}

Measured memory_bytes: 640
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.StringTokenizer;


class Main{

  public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

  static class FastReader {

    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
      br = new BufferedReader(new
          InputStreamReader(System.in));
    }

    String next() {
      while (st == null || !st.hasMoreElements()) {
        try {
          st = new StringTokenizer(br.readLine());
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
      return st.nextToken();
    }

    int nextInt() {
      return Integer.parseInt(next());
    }

    long nextLong() {
      return Long.parseLong(next());
    }

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

    String[] nextSArray() {
      String sr[] = null;
      try {
        sr = br.readLine().trim().split(" ");
      } catch (IOException e) {
        e.printStackTrace();
      }
      return sr;
    }

    String nextLine() {
      String str = "";
      try {
        str = br.readLine();
      } catch (IOException e) {
        e.printStackTrace();
      }

      return str;
    }
  }

  //  static int MOD=1000000000+7;
//  public static void sortbyCol(int arr[][],int col)
//  {
//    Arrays.sort(arr,new Comparator<int[]>(){
//      @Override
//      public int compare(int[] o1, int[] o2) {
//        // To sort in descending order revert
//        // the '>' Operator
//        if(o1[col]>o2[col])
//          return 1;
//        else
//          return -1;
//      }
//    });
//  }


  public static void main(String[] args) throws java.lang.Exception {
    FastReader sc = new FastReader();
//   int t1=sc.nextInt();
//
//   for(int t=0;t<t1;++t)
//   {
//
//   }
    int ans=0;
    for(int i=0;i<5;++i)
    {
      if(sc.nextInt()==0)
        ans=i+1;
    }
    System.out.println(ans);
  }

}

// out.println(al.toString().replaceAll("[\\[|\\]|,]",""));


Measured memory_bytes: 25420
#include <stdio.h>

int C[505];
int S[505];
int F[505];

int main() {

	int N;

	scanf("%d",&N);

	int i,j,k;

	for(i=1;i<=N-1;i++){
	scanf("%d %d %d",&C[i],&S[i],&F[i]);
	}

	for(i=1;i<=N-1;i++){
		int now=S[i]+C[i];
		for(j=i+1;j<=N-1;j++){
			for(k=S[j];;k+=F[j]){
				if(now<=k){break;}
			}
			now=k+C[j];
		}
		printf("%d\n",now);
	}
	printf("0\n");

	return 0;
}

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

#define int long long
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; }

signed main(){
	int a, b, c;
	cin >> a >> b >> c;
	swap(a, b);
	swap(a, c);

	cout << a << " " << b << " " << c << endl;

	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<cstdio>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include <map>
#include<set>
using namespace std;
#define INF 1LL<<62
#define MAX 100000
#define MOD 1000000007
typedef long long ll;
//typedef pair<int,int> P;
//typedef pair<pair<int,int>,int> p;
#define bit(n,k) ((n>>k)&1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)
struct edge{ll to,cost,val;};
template<class T,class U>bool chmin(T&a,const U&b){if(a<=b)return false;a=b;return true;}
template<class T,class U>bool chmax(T&a,const U&b){if(a>=b)return false;a=b;return true;}
//__builtin_popcount(S);
//C.erase(unique(C.begin(),C.end()),C.end());
//#define int ll
//http://drken1215.hatenablog.com/entry/2018/08/28/193000

int N;
vector<ll> A;
vector<ll> sum;

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

    cin>>N;
    A.resize(N); sum.resize(N+1); sum[0]=0;
    for(int i=0;i<N;i++) cin>>A[i],sum[i+1]=sum[i]+A[i];

    ll res=1LL<<60;
    for(int i=2;i<=N-2;i++){
        int low=0,high=i;
        while(high-low>1){
            int mid=(low+high)/2;
            if(sum[mid]>=sum[i]-sum[mid]) high=mid;
            else low=mid;
        }
        ll P=sum[low],Q=sum[i]-sum[low];
        ll P2=sum[high],Q2=sum[i]-sum[high];
        ll left_min=min(P,Q),left_max=max(P,Q);
        if(abs(P2-Q2)<abs(P-Q)) left_min=min(P2,Q2),left_max=max(P2,Q2);

        low=i,high=N;
        while(high-low>1){
            int mid=(low+high)/2;
            if(sum[mid]-sum[i]>=sum[N]-sum[mid]) high=mid;
            else low=mid;
        }
        ll R=sum[low]-sum[i],S=sum[N]-sum[low];
        ll R2=sum[high]-sum[i],S2=sum[N]-sum[high];
        ll right_min=min(R,S),right_max=max(R,S);
        if(abs(R2-S2)<abs(R-S)) right_min=min(R2,S2),right_max=max(R2,S2);

        ll temp=max(left_max,right_max)-min(left_min,right_min);
        chmin(res,temp);
    }
    cout<<res<<endl;
}


Measured memory_bytes: 3456
#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
#define rep(i, a, n) for (int i=(a); i<(n); i++)
#define per(i, a, n) for (int i=(a); i>(n); i--)
typedef long long ll;
const int maxn = 2e5+5;
const int mod = 1e9+7;
using namespace std;

ll mi1 = 1e18, mx1 = -1e18, mi2 = 1e18, mx2 = -1e18, mi3 = 1e18, mx3 = -1e18, mi4 = 1e18, mx4 = -1e18;

void solve() {
	ll n,ans=-1e18,x,y; cin >> n;
	for(int i=0; i<n; i++) {
		cin >> x >> y;
		mi1 = min(mi1, -x+y);
		mx1 = max(mx1, -x+y);
		mi2 = min(mi2, x-y);
		mx2 = max(mx2, x-y);
		mi3 = min(mi3, x+y);
		mx3 = max(mx3, x+y);
		ans = max({mx1+mx2, -mi1-mi2, mx3 - mi3});
	}
	cout << ans << '\n';
}

int main(int argc, char * argv[]) 
{
	ios_base::sync_with_stdio(false); cin.tie(0);
#ifdef DEBUG
	freopen("C:/Users/Fish_Brother/Desktop/in", "r", stdin);
	//freopen("C:/Users/Fish_Brother/Desktop/out", "w", stdout);
#endif

	//int t; cin >> t; while(t--)
	solve();

    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define watch(x) cout << (#x) << " is " << (x) << '\n'
#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())
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef double db;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a; }
//head

void solve(){
    int a, b, c, d, e, k;
    cin >> a >> b >> c >> d >> e >> k;
    string ans;
    if (e-a <= k) ans = "Yay!\n";
    else ans = ":(\n";
    cout << ans;
}

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

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

Measured memory_bytes: 3644
#include <iostream>
#include<string>
using namespace std;
 
int main(){
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int train_fee = 0;
  if (a > b){
    train_fee = b;
  }else{
    train_fee = a;
  }
  int bus_fee = 0;
  if (c > d){
    bus_fee = d;
  }else{
    bus_fee = c;
  }
  cout << bus_fee + train_fee << endl;
  return 0;
}

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

using namespace std;
typedef long long int ll;

#define repi(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,a) repi(i,0,a)
#define rrep(i,a) for(ll i=a-1;i>=0;i--)

int main(){
  ll N, K;
  cin >> N >> K;

  ll frnd = (N-2) * (N-1) / 2;
  if(frnd < K){
    cout << -1 << endl;
  }
  else{
    cout << (N - 1 + frnd - K) << endl;
    repi(i, 2, N+1) printf("%d %lld\n", 1, i);
    repi(i, 2, N+1){
      repi(j, 2, i){
        printf("%lld %lld\n", j, i);
        frnd--;
        if(frnd == K) break;
      }
      if(frnd == K) break;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <ios>
#include <iostream>
#include <vector>

#define ll long long

using namespace std;

int N, K, b;
ll cnt = 0;

int main()
{
    cin >> N >> K;
    for (int b = K + 1; b <= N; b++) {
        if (N % b == b - 1) {
            cnt += (b - K) * ((N + 1) / b - 1);
        } else {
            cnt += (b - K) * ((N + 1) / b);
        }
        cnt += max(N % b - K + (K > 0), 0);
        // cout << b << " " << cnt << endl;
    }

    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
n,m = map(int,input().split())
a = [0] * n
b = [0] * m
for i in range(n):
    a[i] = list(input())
for i in range(m):
    b[i] = list(input())

ans = False

for i in range(n-m):
    for j in range(n-m):
        match = 0
        for k in range(m):
            for l in range(m):
                if a[k+i][l+j] == b[k][l]:
                    match += 1
        if match == m * m:
            ans = True

if n == m:
    match = 0
    for k in range(m):
        for l in range(m):
            if a[k][l] == b[k][l]:
                match += 1
    if match == m * m:
        ans = True

if ans:
    print("Yes")
else:
    print("No")


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

int main() {
    ll n,k;
    cin>>n>>k;
    ll tmp = n;
    ll ans = n;
    n = n%k;
    rep(i,10000){
        ans = min(n,ans);
        tmp = n;
        n = abs(tmp-k);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
N, M = list(map(int, input().split()))
X = list(map(int, input().split()))
X.sort()
L = list()
for i in range(M-1):
    L.append(X[i+1] - X[i])
L.sort(reverse=True)
answer = (X[M-1] - X[0]) - sum(L[:N-1])
print(answer)


Measured memory_bytes: 13968
s = input()
t = input()
len_s = len(s)
len_t = len(t)

check = False
place = len_s - len_t
while place >= 0:
  temp_s = s[place:(place + len_t)]
  sub_s = [char if char != "?" else t[i] for i, char in enumerate(temp_s)]
  if t == "".join(sub_s):
    check = True
    break
  place -= 1

if check:
  result = [char if char != "?" else "a" for char in s]
  result[place:(place+len_t)] = list(t)
  print("".join(result))
else:
  print("UNRESTORABLE")

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

int main(){
	int a[4], b[4];
	while(cin>>a[0]>>a[1]>>a[2]>>a[3]){
		cin>>b[0]>>b[1]>>b[2]>>b[3];
		int hit=0, blow=0;
		for(int i=0; i<4; i++){
			if(a[i]==b[i]) hit++;
			else{
				for(int j=0; j<4; j++){
					if(a[i]==b[j]){
						blow++;
						break;
					}
				}
			}
		}
		cout << hit << " " << blow << endl;
	}
    return 0;
}

Measured memory_bytes: 3012
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vp;
typedef vector<T> vt;
//inline int in() { int x; scanf("%d",&x); return x;}
inline ll in() { ll x; cin >> x; return x; }
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;
#define chmin(x,y) x = min(x,y)

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
map<ll, ll> prime_factor(ll n) {
  map<ll, ll> ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1) ret[n] = 1;
  return ret;
}

vector<int> to[2505];
vector<int> rto[2505];
bool reachablefrom1[2505];
bool reachableToN[2505];
bool ok[2505];

void dfs(int v) {
  if (reachablefrom1[v]) return;
  reachablefrom1[v] = true;
  for (int u : to[v]) {
    dfs(u);
  }
}
void rdfs(int v) {
  if (reachableToN[v]) return;
  reachableToN[v] = true;
  for (int u : rto[v]) {
    rdfs(u);
  }
}

int main() {
  ll r = in();
  cout << r * r << endl;
  return 0;
}


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

#define fi first
#define se second
#define FO(x, n) for (int x = 0; x < n; ++x)
#define FOR(x, a, b) for (int x = a; x < b; ++x)
#define RFO(x, n) for (int x = n - 1; x >= 0; --x)
#define RFOR(x, a, b) for (int x = b - 1; x >= a; --x)
#define FOR_ITER(x, a) for(auto x = a.begin(); x != a.end(); ++x)



using namespace std;
typedef unsigned char byte;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<string, string> pss;
typedef pair<ll, ll> pll;
inline bool feq(const double& a, const double& b) { return fabs(a - b) < 1e-10; }

using namespace std;


int main(){
//    int n, l;
//    cin >> n >> k;
//    vector<bool> dislike(10, false);
//
//    FOR(i, 0, k) {
//        int t;
//        cin >> t;
//        dislike[t] = true;
//    }




int n;

cin >>n;

cout << (n<1200?"ABC":"ARC")<< endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define pp pop_back
#define rt return
#define cinarr(n,arr) for(int i=0;i<n;i++)cin>>arr[i]
#define putarr(n,k,arr) for(int i=0;i<n;i++)arr[i]=k
#define MOD 1000000007
using namespace std;



// Multiplies str1 and str2, and prints result.
string multiply(string num1, string num2)
{
    int len1 = num1.size();
    int len2 = num2.size();
    if (len1 == 0 || len2 == 0)
    return "0";

    // will keep the result number in vector
    // in reverse order
    vector<int> result(len1 + len2, 0);

    // Below two indexes are used to find positions
    // in result.
    int i_n1 = 0;
    int i_n2 = 0;

    // Go from right to left in num1
    for (int i=len1-1; i>=0; i--)
    {
        int carry = 0;
        int n1 = num1[i] - '0';

        // To shift position to left after every
        // multiplication of a digit in num2
        i_n2 = 0;

        // Go from right to left in num2
        for (int j=len2-1; j>=0; j--)
        {
            // Take current digit of second number
            int n2 = num2[j] - '0';

            // Multiply with current digit of first number
            // and add result to previously stored result
            // at current position.
            int sum = n1*n2 + result[i_n1 + i_n2] + carry;

            // Carry for next iteration
            carry = sum/10;

            // Store result
            result[i_n1 + i_n2] = sum % 10;

            i_n2++;
        }

        // store carry in next cell
        if (carry > 0)
            result[i_n1 + i_n2] += carry;

        // To shift position to left after every
        // multiplication of a digit in num1.
        i_n1++;
    }

    // ignore '0's from the right
    int i = result.size() - 1;
    while (i>=0 && result[i] == 0)
    i--;

    // If all were '0's - means either both or
    // one of num1 or num2 were '0'
    if (i == -1)
    return "0";

    // generate the result string
    string s = "";

    while (i >= 0)
        s += to_string(result[i--]);

    return s;
}





int main()
{
 ll n;
 cin>>n;
 string arr[n];
 cinarr(n,arr);
 for(int i=0;i<n;i++)
 {if(arr[i]=="0"){
 cout<<0;rt 0;}
 }
 string ans="1";
  for(int i=0;i<n;i++)
  {
  ans=multiply(ans, arr[i]);
    if(ans.size()>19)
  {cout<<-1;rt 0;}
  }
  if(ans.length()==19){
    for(int i=18;i>0;i--)
    {if(ans[i]!='0')
      {cout<<-1;rt 0;}
    }
    if(ans[0]!='1')
       {cout<<-1;rt 0;}
  }
  cout<<ans;

 rt 0;
}/* End of main */


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

using namespace std;

typedef long long ll;

const int N = 100100;

int k[N];

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        int a;
        cin >> a;
        if (n % 2 == a % 2) {
            cout << 0;
            return 0;
        }
        ++k[a];
    }
    for (int i = n % 2 + 1; i < n; i += 2) {
        if (k[i] != 2) {
            cout << 0;
            return 0;
        }
    }
    if (n % 2 && k[0] != 1) {
        cout << 0;
        return 0;
    }
    ll ans = 1;
    ll e = 1e9 + 7;
    for (int i = 0; i < n / 2; ++i) {
        ans = ans * 2 % e;
    }
    cout << ans;
    return 0;
}

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

#ifndef ONLINE_JUDGE
#  define LOG(x) (cerr << #x << " = " << (x) << endl)
#else
#  define LOG(x) 0
#endif
//#define endl '\n'
#define pb push_back
#define mod 1000000007
typedef int integer;
#define int long long
using namespace std;

int powmod(int a, int b) {
    int res = 1;
    a %= mod;
    assert(b >= 0);
    for (; b; b >>= 1) {
        if (b & 1)res = res * a % mod;
        a = a * a % mod;
    }
    return res;
}

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

const integer NN = (int) 5e5 + 2;
int ar[NN];
int a[NN];
int b[NN];
int n, m, k, x;
string s;

integer main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int T = 1;
//    cin >> T;
    while (T--) {
        cin >> n >> m >> k;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if (i) a[i] += a[i - 1];
        }
        for (int i = 0; i < m; i++) {
            cin >> b[i];
            if (i) b[i] += b[i - 1];
        }
        if (a[n - 1] + b[m - 1] <= k) {
            cout << n + m << endl;
            continue;
        }
        if (a[0] > k && b[0] > k) {
            cout << 0 << endl;
            continue;
        }
        int ans = 0;
        int i;
        for (i = 0; i < n; i++) {
            if (a[i] <= k) ans = i + 1;
            else break;
        }
        i--;
        int sum = i >= 0 ? a[i] : 0;
        int j;
        for (j = 0; j < m; j++) {
            if (b[j] + sum <= k) ans = i + 1 + j + 1;
            else break;
        }
        j--;
//        cout << j << endl;
        sum = a[i] + b[j];
        while (i >= 0){
            i--;
            while (j+1 < m && a[i] + b[j+1] <= k) j++;
            ans = max(ans, i+1+j+1);
        }

        cout << ans << endl;

    }
}


Measured memory_bytes: 6768
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long int
#define pii 3.14
#define mod (ll)(1e9 + 7)
#define inf (ll)(1e18)
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ordered_set tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update>
#define pi pair<int,int>
#define N (ll)(2e5+5)

void solve()
{
   ll x;
   cin>>x;

   for(ll i=-1000;i<=1000;i++)
   {
       for(ll j=-1000;j<=1000;j++)
       {
           ll val = pow(i,5) - pow(j,5);
           if(val == x)
           {
               cout<<i<<" "<<j<<"\n";
               return;
           }
       }
   }
}

int main()
{
    fio;
    ll tc = 1;
    //cin>>tc;
    while(tc--)
    {
        solve();
    }
}


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

int main(){
    ll n,m;cin>>n>>m;
    bool other =0;

    ll A=1;ll B=n;
    rep(i,m){
        ll a,b;cin>>a>>b;
        if(b<A||a>B){other=1;break;}
        A=max(A,a);
        B=min(B,b);
    }

if(other)cout<<0<<endl;
else cout<<B-A+1<<endl;

}


Measured memory_bytes: 256
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    var sList = mutableListOf<Int>()
    var hList = mutableListOf<Int>()
    var cList = mutableListOf<Int>()
    var dList = mutableListOf<Int>()

    for (i in 0 until n) {
        val (a, b) = readLine()!!.split(" ")
        when (a) {
            "S" -> sList.add(b.toInt())
            "H" -> hList.add(b.toInt())
            "C" -> cList.add(b.toInt())
            else -> dList.add(b.toInt())
        }
    }

    for (i in 1..13) {
        if (!sList.contains(i)) {
            println("S $i")
        }
    }

    for (i in 1..13) {
        if (!hList.contains(i)) {
            println("H $i")
        }
    }
    for (i in 1..13) {
        if (!cList.contains(i)) {
            println("C $i")
        }
    }
    for (i in 1..13) {
        if (!dList.contains(i)) {
            println("D $i")
        }
    }
}






Measured memory_bytes: 32000
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front;
#define fbo find_by_order
#define ook order_of_key
#define lb lower_bound
#define ub upper_bound
#define rep(i,n) for(int i=0;i<n;i++)
#define fo(j,a,b) for(int j=a;j<=b;j++)
#define mem(x,a) memset(x,a,sizeof(x))

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef long double ld;
typedef map<ll,ll> spt;
typedef set<ll> si;
typedef multiset<ll>::iterator sit;
typedef map<int,int>::iterator mi;
typedef vector<int>::iterator vit;
typedef vector<ii> vii;
typedef set<ii> sii;
typedef multiset<ll> msi;
typedef vector< vector<ll> > matrix;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost;
typedef tree<ii,null_type,greater<ii>,rb_tree_tag,tree_order_statistics_node_update> ost1;
template<class T> T chmin(T& a, T& b) { if(a>b) return a; }
template<class T> T chmax(T& a, T& b) { if(a<b) return b; }
const ll INF = 1e18;
const int MOD = 1e9 + 7;
const int N = 1e6 +5;
 vector<long long> f(N,1);
long long pow(ll a, ll b, ll MOD)
{
    long long x=1,y=a;
    while(b > 0)
    {
        if(b%2 == 1)
        {
            x=(x*y);
            if(x>MOD) x%=MOD;
        }
        y = (y*y);
        if(y>MOD) y%=MOD;
        b /= 2;
    }
    return x;
}
long long InverseEuler(ll n, ll MOD)
{
    return pow(n,MOD-2,MOD);
}
long long C(ll n, ll r, ll MOD)
{
    if(r>n)
    return 0;
    return (f[n]*((InverseEuler(f[r], MOD) * InverseEuler(f[n-r], MOD)) % MOD)) % MOD;
}
int main()
{
    ll n;
    cin>>n;
    ll a[n+2];
    rep(i,n+1)
    cin>>a[i];
    ll fr[n+2]={-1},i1,i2;
    mem(fr,-1);
    for (int i=2; i<=n+1;i++)
        f[i]= (f[i-1]*i) % MOD;
    rep(i,n+1)
    if(fr[a[i]]==-1)
        fr[a[i]]=i;
    else
    {
        i1=fr[a[i]];
        i2=i;
    }
    ll sum=i2-i1;
    for(int i=1;i<=n+1;i++)
    {
        ll ans=(C(n+1,i,MOD)-C(n-sum,i-1,MOD)+MOD)%MOD;
        cout<<ans<<"\n";
    }
}


Measured memory_bytes: 10624
N=int(input())
a=list(map(int,input().split()))
c=[0]*8
sum=0
tmp=0

for i in a:
    n=int(i/400)
    if(i<3200 and c[n]==0):
        c[n]+=1
        sum+=1
    elif(i>=3200):
        tmp+=1
print(sum if sum!=0 else sum+1,sum+tmp)

Measured memory_bytes: 3064
#include<stdio.h>
int A;
int f(char a){
  int i=10;
  if('2'<=a&&a<='9')i=a-'0';
  if(a=='A'){
    A++;
    i++;
  }
  return i;
}
int main(){
  int n,i,j,p;
  char a,b,s[10];
  scanf("%d",&n);
  while(n--){
    scanf(" %c %c",&a,&b);
    for(i=j=A=0;i<8;i++)scanf(" %c",&s[i]);
    p=f(a)+f(b);//printf("%d ",p);
    if(p==22&&A){
      A--;
      p-=10;
    }
    if(A&&p==21)printf("blackjack\n");
    else{
      while(p<17||p==17&&A){
	p+=f(s[j++]);//printf("%d ",p);
	if(p>21&&A){
	  A--;
	  p-=10;
	}
      }
      if(p>21)printf("bust\n");
      else    printf("%d\n",p);
    }
  }
  return 0;
}
	
     

Measured memory_bytes: 608
MOD=10**9+7
N,K=[int(s) for s in input().split()]
ls=[int(s) for s in input().split()]
ans=set()
ls=sorted(ls, key=lambda x: -abs(x))
mul=1
sign=0
zeroflag=0
flag=[0 for _ in range(N)]
for i in range(K):
  flag[i]=1
  if ls[i]<0:
    sign=(sign+1)%2
if sign==1:
  if 0 in ls:
    zeroflag=1
  a=[0,0,0,0]
  b=[0,0,0,0]
  for j in range(K,N):
    if ls[j]>0:
      for k in range(K):
        if ls[K-1-k]<0:
          a[0]=ls[j]
          b[0]=j
          a[1]=ls[K-1-k]
          b[1]=K-1-k
          break
      break
  for j in range(K,N):
    if ls[j]<0:
      for k in range(K):
        if ls[K-1-k]>0:
          a[2]=ls[j]
          b[2]=j
          a[3]=ls[K-1-k]
          b[3]=K-1-k
          break
      break
  if a==[0,0,0,0]:
    flag.reverse()
  elif b[0]==0 and b[1]==0:
    flag[b[2]]=1
    flag[b[3]]=0
  elif b[2]==0 and b[3]==0:
    flag[b[0]]=1
    flag[b[1]]=0
  elif abs(a[0]*a[3])>abs(a[1]*a[2]):
    flag[b[0]]=1
    flag[b[1]]=0
  else:
    flag[b[2]]=1
    flag[b[3]]=0
if sign==1 and a==[0,0,0,0] and zeroflag==1:
  print(0)
else:
  mul=1
  for i in range(N):
    if flag[i]==1:
      mul=mul*ls[i]%MOD
  print(mul)


Measured memory_bytes: 31756
#include <iostream>
#include <set>
using namespace std;
int cnt = 0;
int cnt2 = 0;
bool check(long long x, int n){
    bool ans;
    set<int> st;
    while(x){
        st.insert(x%10);
        x /= 10;
    }
    if(st.size() == 3) ans = true;
    else ans = false;
    return ans;
}
void dfs(long long x,int n){
    if(n < x) return;
    if(check(x,n)) cnt++;
    dfs(10*x+3,n);
    dfs(10*x+5,n);
    dfs(10*x+7,n);
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n; cin >> n;
    dfs(0,n);
    cout << cnt << endl;
    return 0;
}
//Saw the solution video

Measured memory_bytes: 3584
n=int(input())
s=sorted([int(input()) for i in range(n)])
ans=sum(s)
if ans%10!=0:
    print(ans)
    exit()
else:
    for i in range(len(s)):
        t=s[i]
        if t%10!=0:
            print(ans-t)
            exit()
print(0)

Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
    string s;
    cin >> s;
    if(s == "Sunny") cout << "Cloudy" << endl;
    else if(s == "Cloudy") cout << "Rainy" << endl;
    else cout << "Sunny" << endl;
    return 0;
}


Measured memory_bytes: 504
import sys
s_max = -float('inf')
s = 0
n = int(input())
r = list(map(int, sys.stdin.read().split()))
for i in range(1, n):
	s = max(s, 0) + r[i] - r[i-1]
	s_max = max(s, s_max)
print(s_max)


Measured memory_bytes: 28272