akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<(n);i++)
#define loop(i,a,n) for(i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;

struct SCC{
  int n;
  vector<vector<int> > G,rG,T,C;
  vector<int> vs,used,belong;
  SCC(){}
  SCC(int sz):n(sz),G(sz),rG(sz),used(sz),belong(sz){}
  
  void add_edge(int from,int to){
    G[from].push_back(to);
    rG[to].push_back(from);
  }
  
  void input(int m,int offset=0){
    int a,b;
    for(int i=0;i<m;i++){
      cin>>a>>b;
      add_edge(a+offset,b+offset);
    }
  }
  
  void dfs(int v){
    used[v]=1;
    for(int i=0;i<(int)G[v].size();i++){
      if(!used[G[v][i]]) dfs(G[v][i]);
    }
    vs.push_back(v);
  }
  
  void rdfs(int v,int k){
    used[v]=1;
    belong[v]=k;
    C[k].push_back(v);
    for(int i=0;i<(int)rG[v].size();i++){
      if(!used[rG[v][i]]) rdfs(rG[v][i],k);
    }
  }
  
  int build(){
    fill(used.begin(),used.end(),0);
    vs.clear();
    for(int v=0;v<n;v++){
      if(!used[v]) dfs(v);
    }
    fill(used.begin(),used.end(),0);
    int k=0;
    for(int i=vs.size()-1;i>=0;i--){
      if(!used[vs[i]]){
	T.push_back(vector<int>());
	C.push_back(vector<int>());
	rdfs(vs[i],k++);
      }
    }
    for(int i=0;i<n;i++)
      for(int u:G[i])
	if(belong[i]!=belong[u])
	  T[belong[i]].push_back(belong[u]);
    for(int i=0;i<k;i++){
      sort(T[i].begin(),T[i].end());
      T[i].erase(unique(T[i].begin(),T[i].end()),T[i].end());
    }
    return k;
  }
};


int diff(int a, int b){//time difference
  int ret=abs(a-b);
  return min(ret, 24-ret);
}

int main(void) {
  int i,j;
  int n;
  cin>>n;

  vi a(n);
  rep(i,n)cin>>a[i];
  a.push_back(0);
  n++;

  for(int ans=12;ans>=0;ans--){

    SCC scc((n+1)*2);//1-indexed

    rep(i,n) rep(j,n){
      if(i==j) continue;
      if(diff(a[i], a[j]) < ans || diff(24-a[i], 24-a[j]) < ans){
	scc.add_edge(n+(i+1), n-(j+1));
	scc.add_edge(n-(i+1), n+(j+1));
      }
      if(diff(a[i], 24-a[j]) < ans || diff(24-a[i], a[j]) < ans){
	scc.add_edge(n-(i+1), n-(j+1));
	scc.add_edge(n+(i+1), n+(j+1));
      }

    }

    scc.build();

    bool c=true;

    auto belong=scc.belong;
    for(int i=0;i<n;i++){
      if(belong[n-(i+1)]==belong[n+(i+1)]){
	c=false;
      }
    }
    if(c){
      cout<<ans<<endl;
      return 0;
    }

  }

}



Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define ALL(a)  (a).begin(),(a).end()
typedef long long ll;
int main() {
  vector<int> v(3);
  cin >> v[0] >> v[1] >> v[2];
  sort(ALL(v));
  cout << v[2] * 10 + v[1] + v[0];
  return 0;
}


Measured memory_bytes: 256
/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

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

int main()
{
    int n,k;
    cin>>n>>k;
    int arr[n];
    for(int i=0;i<n;i++)
        cin>>arr[i];
    int dp[n];
    dp[n-1]=0;
    dp[n-2]=abs(arr[n-2]-arr[n-1]);
    int l=2;
    int j;
    for(int i=n-3;i>=0;i--){
        j=1;
        dp[i]=INT_MAX;
        while(j<=min(l,k)){
            dp[i]=min(dp[i+j]+abs(arr[i+j]-arr[i]),dp[i]);
            j++;
        }
        l++;
    }
    cout<<dp[0]<<endl;
}


Measured memory_bytes: 4384
#include <bits/stdc++.h>
using namespace std;
int main(){
	string s; cin>>s;
	for(int i = 0; i < (int)s.size(); i++){
		int j = i + 1;
		if(j % 2 != 0){
			if(!(s[i] =='R' || s[i] =='U' || s[i] =='D')){
				cout<<"No\n";
				return 0;
			}
		}
		else{
			if(!(s[i] =='L' || s[i] =='U' || s[i] =='D')){
				cout<<"No\n";
				return 0;
			}
		}
	}
	cout<<"Yes\n";
}


Measured memory_bytes: 256
h,w = map(int,input().split())
l = [list(input()) for i in range(h)]

dp = [[-1]*w for i in range(h)]
if l[0][0] == ".":
    dp[0][0] = 0
else:
    dp[0][0] = 1

for i in range(h):
    for j in range(w):
        if i == 0 and j == 0:
            continue

        if i == 0:
            if l[i][j-1] == "." and l[i][j] == "#":
                dp[i][j] = dp[i][j-1]+1
            else:
                dp[i][j] = dp[i][j-1]
        elif j == 0:
            if l[i-1][j] == "." and l[i][j] == "#":
                dp[i][j] = dp[i-1][j]+1
            else:
                dp[i][j] = dp[i-1][j]
        else:
            a = dp[i-1][j]
            b = dp[i][j-1] 
            if l[i-1][j] == "." and l[i][j] == "#":
                a += 1
            if l[i][j-1] == "." and l[i][j] == "#":
                b += 1
            dp[i][j] = min(a,b)
print(dp[-1][-1])
         
            

Measured memory_bytes: 43120
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF          1e9
#define INFLL        1e18
#define EPS          1e-9
#define MOD          1000000007
#define REP(i,n)     for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)    for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)    for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)   for(ll i=(n);i>0;--i)
#define REPC(i,obj)  for(auto i:obj)
#define ALL(obj)     (obj).begin(),(obj).end()
#define SETP(n)      cout<<fixed<<setprecision(n)
#define VV(T,h,w)    move(vector<vector<T>>(h,move(vector<T>(w))))
#define VVI(T,h,w,i) move(vector<vector<T>>(h,move(vector<T>(w,i))))
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

int main()
{
	map<string, ll>blue, red;
	set<string>ss;
	ll n = in();
	REP(i, n) {
		string s; cin >> s;
		ss.insert(s);
		++blue[s];
	}
	ll m = in();
	REP(i, m) {
		string t; cin >> t;
		ss.insert(t);
		++red[t];
	}
	ll ans = -1;
	REPC(i, ss) {
		ans = max(ans, max(blue[i] - red[i], 0LL));
	}
	cout << ans << endl;
}

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

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

	int H, A; cin >> H >> A;
	if (H%A == 0) cout << H/A << endl;
	else cout << H/A+1 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <float.h>
#include <cfloat>
#include <string>
#include <ctype.h>
#include <algorithm>
#include <errno.h>
#include <cerrno>
#include <assert.h>
#include <cassert> 
#include <map>
#include <memory.h>
#include <cctype>
#include <ctype.h>
#include <math.h>
#include <vector> 
#include <cstdio> 
#include <set>
#include <string.h>
#include <stdio.h>
#include <new>
#include <memory>
#include <cmath>
#include <queue>
#include <cstring>
#define ll long long
#define fo(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define fol(i,m,n) for(ll i=(ll)m;i<(ll)n;i++) 
#define br break
#define ct continue
#define all(s) s.first(),s.end() 
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define pii pair<int,int>  
#define em empty()
#define vei vector<int>
#define ves vector<string>
#define qui queue<int> 
#define qu queue
#define mem(a,b) memset(a,b,sizeof(a))
#define lb lower_bound
#define ub upper_bound
#define li long int 
using namespace std;
int a[5050],b[5050],a1[5050],c,tc,a2[5050];
int main(){
    int n,t;
    cin>>n>>t;
    int cnt=n;
    fo(i,0,n){
        cin>>a[i]>>b[i];
    }
    fo(i,0,n){
        if(b[i]>t){
            cnt--;
            a1[c++]=a[i];
        }
        else{
            a2[tc++]=a[i];
        }
    }
    sort(a2,a2+tc);
    if(cnt){
        cout<<a2[0]<<endl;
    }
    else{
        cout<<"TLE"<<endl;
    }
    return 0;
}

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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

using namespace std;

int main() {
  in(ll, n, m);
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  vector<ll> s(n + 1);
  rep(i, n) s[i + 1] = s[i] + a[i];
  ll ans = 0;
  map<ll, ll> seen;
  rep(i, n + 1) {
    ans += seen[s[i] % m];
    ++seen[s[i] % m];
  }
  out(ans);
}

Measured memory_bytes: 8668
def main():
    N = int(input())
    count = 0
    for a in range(N) :
        a += 1
        for b in range(N):
            b += 1
            c = N - a * b
            if c <= 0 :
                break
            else :
                count += 1

    print(count)

if __name__ == '__main__':
    main()


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

using namespace std;

using ll = long long;
using p  = pair<ll, ll>;

ll dp[51][2 * 51 * 51];

int main(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll N, A;
    cin >> N >> A;
    
    ll X = A;
    vector<ll> cards(N);
    for (auto&& c : cards) {
        cin >> c;
        X = max(X, c);
    }
    
    dp[0][N * X] = 1;
    for (ll j = 1; j <= N; j++) {
        for (ll t = 0; t <= 2 * N * X; t++) {
            ll y = cards[j - 1] - A;
            if (j >= 1 && (t - y < 0 || t - y > 2 * N * X)) {
                dp[j][t] = dp[j - 1][t];
            } else if (j >= 1 && 0 <= t - y && t - y <= 2 * N * X) {
                dp[j][t] = dp[j - 1][t] + dp[j - 1][t - y];
            } else {
                dp[j][t] = 0;
            }
        }
    }
    
    cout << dp[N][N * X] - 1 << endl;
    
    return 0;
}

Measured memory_bytes: 2304
#include <stdio.h>
 
char q[8];
char a[8], b[8], u[16], v[16];  // 衝突検出用 a:縦上下、b:横左右、u,v: 斜め方向
 
void found()
{
    int r, c;
 
    for (r = 0; r < 8; r++) {
        for (c = 0; c < 8; c++) {
            if (q[r] == c) putchar('Q');
            else           putchar('.');
        }
        putchar('\n');
    }
}
 
int check(int r)
{
    int c;
 
    if (r == 8) { found(); return 1; }
    if (b[r]) { if (check(r+1)) return 1; }
    for (c = 0; c < 8; c++) {
        if (b[r] || a[c] || u[r+c] || v[r-c+7]) continue;
        a[c] = u[r+c] = v[r-c+7] = 1;
        q[r] = c;
        if (check(r+1)) return 1;
        a[c] = u[r+c] = v[r-c+7] = 0;
    }
    return 0;
}
 
int main()
{
    int k, r, c;
 
    scanf("%d", &k);
    while (k--) {
        scanf("%d%d", &r, &c);
        q[r] = c;
        a[c] = b[r] = u[r+c] = v[r-c+7] = 1;
    }
    check(0);
    return 0;
}



Measured memory_bytes: 2096
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
 long long int i,ans,c,s,x,n;
 ans=0;
 cin >> n;
 c=0;
 while(n%2==0)
 {
  n/=2;
  c++;
 }
 x=1;
 s=0;
 while((s+x)<=c)
 {
  s+=x;
  x++;
 }
 ans+=x-1;
 for(i=3;i<=1000001;i+=2)
 {
  c=0;
  while(n%i==0)
  {
   n/=i;
   c++;
  }
  x=1;
  s=0;
  while((s+x)<=c)
  {
   s+=x;
   x++;
  }
  ans+=x-1;
 }
 if(n!=1)
 ans++;
 cout << ans;
 return 0;
}

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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define repr(i,a,b) for(int i=(int)(a-1);i>=b;i--)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout << #x" = " << x << endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

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

#define INF INT_MAX/3

int main(){
    cin.sync_with_stdio(false);
    int x, y, z;
    cin >> x >> y >> z;
    x -= z;
    cout << x / (y + z) << endl;
    return 0;
}

Measured memory_bytes: 256
N=int(input())
A=[int(s)for s in input().split()]

cnt=0
for i in range(N):
  if A[i]<0:cnt+=1

AA=[abs(x)for x in A]
AA=sorted(AA)
if cnt%2==0:print(sum(AA))
else:print(sum(AA)-2*AA[0])
    

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

const int64 mod = 1e9+7;

using Row = vector<int64>;
using Mat = vector<Row>;


int64 N, M;
vector<int64> G[112345];

int64 dp[112345];

int64 dfs(int32 v){
	if(~dp[v]) return dp[v];
	int64 &res = dp[v];
	res = 0;
	REP(i, G[v].size()){
		chmax(res, dfs(G[v][i]));
	}
	res += 1;
	return res;
}

int main(void){
	cin >> N >> M;
	memset(dp, -1, sizeof dp);
	REP(i, M){
		int64 x, y;
		cin >> x >> y; x--; y--;
		G[x].push_back(y);
	}
	int64 res = 0;
	REP(i, N){
		chmax(res, dfs(i));
	}
	cout << res-1 << endl;
}


Measured memory_bytes: 8960
use std::io;
use std::str::FromStr;

fn main () {
    let mut s = String::new();
    io::stdin().read_line(&mut s).ok();
    let mut it = s.split_whitespace ()
        .map(|n| i64::from_str(n).unwrap ());
    let (a,b,c) = (it.next().unwrap (), it.next().unwrap (), it.next().unwrap ());
    
    if (a==5 && b==5 && c==7) ||
       (a==5 && b==7 && c==5) ||
       (a==7 && b==5 && c==5) {
        println!("YES");
    } else {
        println!("NO");
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
//			#include <ext/pb_ds/assoc_container.hpp>
//			#include <ext/pb_ds/tree_policy.hpp>

			using ll = long long;
			using ld = long double;
			#define rep(i, a, n) for(ll i = (a); i < (n); i++)
			#define per(i, a, n) for(ll i = (n-1); i >= (a); i--)
			#define F first
			#define S second
			#define endl "\n"
			#define all(x) begin(x),end(x)
			#define maxx(a, b) a = max(a, b)
			#define minn(a, b) a = min(a, b)
			#define db(x) cerr<<#x<<" = "<<x<<endl
			#define N 1111111
			#define mod 1000000007
			#define rt return
			#define inf 1234567891123456789ll

			using namespace std;
//			random_device rd;
//			mt19937 mt(rd());
//			using namespace __gnu_pbds;
//
//			typedef tree<pair<ll,ll>, null_type, less<pair<ll,ll>>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

			#define error(args...){string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

			void err(istream_iterator<string> it) {}
			template<typename T, typename... Args>
			void err(istream_iterator<string> it, T a, Args... args)
			{
				cerr<<*it<<" = "<<a<<endl;
				err(++it, args...);
			}

			ll modlaber(ll a, ll m = mod)
			{
				rt ((a+m)%m+m)%m;
			}

			int main()
			{
				ios_base::sync_with_stdio(0);
				cin.tie(0);
				cout.tie(0);

				int x,y; cin>>x>>y;
				rep(i,0,101)
					rep(j,0,101)
						if(i+j == x && 2*i+4*j == y)
							rt cout<<"Yes",0;
				cout<<"No";

				rt 0;
			}





















Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int N;
	cin >> N;

  for (int i = 0; i < N; i++) {
    char S;
    cin >> S;
    if (S == 'Y') {
      cout << "Four" << endl;
      return 0;
  }
 }
 cout << "Three" << endl; 
 return 0;      
}

Measured memory_bytes: 256
<?php
# C - Exception Handling

fscanf(STDIN, "%d", $N);

$max = 0;
$second = 0;
$array = [];
for ($i = 1; $i <= $N; $i++) {
    fscanf(STDIN, "%d", $a);
    $array[] = $a;
    if ($max < $a) {
        $second = $max;
        $max = $a;
    } elseif ($second < $a) {
        $second = $a;
    }
}

for ($i = 0; $i < $N; $i++) {
    if ($max == $array[$i]) {
        echo $second . PHP_EOL;
        continue;
    }
    echo $max . PHP_EOL;
}

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

int main(){
    ll x, k, d;
    cin >> x >> k >> d;
    x = abs(x);
    ll n = x / d;
    if(k <= n){
        cout << x - d * k << endl;
        return 0;
    }
    ll rem = k - n;
    ll pos = x - (d*n);
    if(rem % 2 == 0){
        cout << pos << endl;
    }
    else{
        cout << abs(pos-d) << endl;
    }
    return 0; 
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define pii pair<int, int>
#define pll pair<ll, ll>
int main()
{
    ll n, sm = 0;
    scanf("%lld", &n);
    vector<ll> arr(n);
    for (int i = 0; i < n; i++)
    {
        scanf("%lld", &arr[i]);
        sm += arr[i];
    }
    ll mn = sm, cnt = 0;
    for (int i = 0; i < n; i++)
    {
        cnt += arr[i];
        mn = min(mn, abs(cnt - (sm - cnt)));
    }
    printf("%lld\n", mn);
    return 0;
}

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

int main() {
  	//
  int N, A;
  cin >> N >> A;
  if( N % 500 <= A){
    cout << "Yes" << endl;
  }
  if( N % 500 > A){
    cout << "No" << endl;
  }
}
    

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

typedef long long ll;
const ll INF = 1e18;
const int BIG = 1e9 + 555;
const int maxN = 1e5 + 9;

int n;
int a[maxN], b[maxN];

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

	for(int i = 1; i + 1 <= n; i++){
		cin >> b[i];
	}
	
	b[0] = b[n] = BIG;
	ll sum = 0;
	for(int i = 1; i <= n; i++){
		a[i] = min(b[i - 1], b[i]);
		sum += a[i];
	}
	
	cout << sum << '\n';

	return 0;
}

Measured memory_bytes: 256
import java.io.FileInputStream;
import java.util.NoSuchElementException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;

public class Main {
	
	public static void main(String[] args) throws IOException {
		//FastScanner sc = new FastScanner(new FileInputStream("input.txt"));
		FastScanner sc = new FastScanner(System.in);
		
		int N = sc.nextInt();
		int M = sc.nextInt();
		long ans = (100 * (N - M) + 1900 * M) * (long)Math.pow(2, M);
		System.out.println(ans);
	}
}

class FastScanner {
    private InputStream in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    public FastScanner(InputStream in) {
		this.in = in;
	}
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() {
    	if (hasNextByte()) return buffer[ptr++];
    	else return -1;
    }
    private static boolean isPrintableChar(int c){
    	return 33 <= c && c <= 126;
    }
    public boolean hasNext() {
    	while(hasNextByte() && !isPrintableChar(buffer[ptr]))
    		ptr++; return hasNextByte();
    }
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() {
    	return Double.parseDouble(next());
    }
}


Measured memory_bytes: 22100
#!/usr/bin/env python3
import heapq


def solve(n, a):

    ans = [0] * n

    q = []
    for i in range(n):
        ai = a[i]
        heapq.heappush(q, (-ai, i))

    ap, p = heapq.heappop(q)
    ap = -ap
    c = 0
    cnt = 1
    while len(q):
        ai, i = heapq.heappop(q)
        ai = -ai
        if p < i:
            c -= ap - ai
            cnt += 1
        else:
            ans[p] = c + (ap - ai) * cnt
            cnt += 1
            p = i
            ap = ai
            c = 0

    ans[p] = c + ap * cnt

    for c in ans:
        print(c)


def main():
    n = input()
    n = int(n)
    a = list(map(int, input().split()))

    solve(n, a)

if __name__ == '__main__':
    main()



Measured memory_bytes: 22196
H, W = map(int, input().split())

m = []
for i in range(H):
    m.append(input().rstrip('\n'))

wei = [[0]*(W+1) for _ in range(H+1)]
for h in range(H):
    for w in range(W):
        if m[h][w] == '.':
             wei[h][w] = wei[h][w-1] + 1
        else:
            wei[h][w] = 0
    #reverse
    for wz in range(W-1, -1, -1):
        if wei[h][wz] > 0 and wei[h][wz] < wei[h][wz+1]:
                wei[h][wz] = wei[h][wz + 1]

hei = [[0]*(W+1) for _ in range(H+1)]
for w in range(W):
    for h in range(H):
        if m[h][w] == '.':
             hei[h][w] = hei[h-1][w] + 1
        else:
            hei[h][w] = 0

    #reverse
    for hz in range(H-1, -1, -1):
        if hei[hz][w] > 0 and hei[hz][w] < hei[hz+1][w]:
            hei[hz][w] = hei[hz+1][w]

ans = 0
for h in range(H):
    for w in range(W):
       val = wei[h][w] + hei[h][w] - 1
       if ans < val:
           ans = val

print(ans)


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

int main() {
	// your code goes here
	int x=1;
	int y=1;
	while(x!=0||y!=0)
	{
		cin>>x>>y;
		if(x!=0||y!=0)
		{
			if(x>y)
			{
			cout<<y<<" "<<x<<endl;
			}
			if(x<=y)
			{
				cout<<x<<" "<<y<<endl;
				
			}
		}
	}
	return 0;
}


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

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

	sort (high, high+10);
	for(int i=9;i>6;i--){
		cout << high[i]<<endl;
	}
}

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

using namespace std;

int main()
{
    int n;
    int a, b;

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

    return 0;
}


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

int main()
{
    int n,k;
    cin>>n>>k;
    int arr[n];
    for(int i=0;i<n;i++)
    cin>>arr[i];
    
    
    bool temp[k+1];
    memset(temp,false,sizeof(temp));
    
    for(int i=1;i<=k;i++){
        for(int j =0;j<n;j++){
            if(i >= arr[j] && !temp[i-arr[j]])
                temp[i] = true;
        }
    }
     if(temp[k] == true)
     cout<<"First";
    
    else cout<<"Second";
}

Measured memory_bytes: 384
#include <iostream>

int main(int argc, char** argv) {
  int k;
  int x;

  bool isFirst = true;
  std::cin >> k >> x;

  for (int i = -1000000; i <= 1000000; i++) {
    if (x-k < i && i < x+k) {
      if (isFirst) {
        isFirst = false;
      } else {
        std::cout << " ";
      }
      std::cout << i;
    }
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n; cin>>n;
    vector<ll> x(n), y(n);
    rep(i,n){
        ll X,Y;cin>>X>>Y;
        x[i]=X+Y, y[i]=X-Y;
    }
    sort(ALL(x));sort(ALL(y));
    cout<<max(x[n-1]-x[0], y[n-1]-y[0]);
    return 0;
}

Measured memory_bytes: 6360
#include<bits/stdc++.h>
using namespace std;
char s[60][60];
int h,w;

bool judge(int r1,int w1)
{
    int t=0;
    if(r1-1>=0&&s[r1-1][w1]=='#') t++;
    if(r1+1<h&&s[r1+1][w1]=='#') t++;
    if(w1-1>=0&&s[r1][w1-1]=='#') t++;
    if(w1+1<w&&s[r1][w1+1]=='#') t++;
    if(t==0)return 0;
    else return 1;
}

int main()
{
    while(cin>>h>>w)
    {
        int flag=1;
        for(int i=0;i<h;i++)cin>>s[i];
        if(h==1&&w==1&&s[0][0]=='.'){
            cout<<"Yes"<<endl;continue;
        }
        for(int i=0;i<h;i++){
            for(int j=0;j<w;j++){
                if(s[i][j]=='#'){
                    if(judge(i,j)==0){
                        flag=0;break;
                    }
                }
            }
        }
        if(flag)
            cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
A=[0,0,0,0]

for i in range(3):
  a,b=map(int,input().split())
  A[a-1]+=1
  A[b-1]+=1
  
A.sort()

if A[0]==A[1] and A[0]==1 and A[2] == A[3] and A[2]==2:
  print("YES")
else:
  print("NO")

Measured memory_bytes: 3064
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> PI;
typedef vector<int> vi;
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#define pb push_back
#define F first
#define S second


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

bool app[50][50][50][50];
char lr[53][53],rr[53][53];
string ans;
int rsx,rsy,lsx,lsy,clx,cly,crx,cry,nrx,nlx,nry,nly;

PI tp;

main(){
  int w,h;
  while(cin>>w>>h,w|h){
    memset(app,0,6250000);
    rep(i,h){
      scanf(" %s %s ",lr[i],rr[i]);
      rep(j,w){
        if(lr[i][j]=='L')lsx=i,lsy=j;
        if(rr[i][j]=='R')rsx=i,rsy=j;
      }
    }

    ans="No";
    queue<pair<PI,PI> > Q;
    Q.push(mp(mp(lsx,lsy),mp(rsx,rsy)));

    while(!Q.empty()){
      tp=Q.front().F;
      clx=tp.F,cly=tp.S;
      tp=Q.front().S;Q.pop();
      crx=tp.F,cry=tp.S;
      if(lr[clx][cly]=='%' && rr[crx][cry]=='%'){
        ans="Yes";
        break;
      }
      if(lr[clx][cly]=='%' || rr[crx][cry]=='%')continue;
      app[clx][cly][crx][cry]=true;

      rep(i,4){
        nrx=crx+dx[i],nlx=clx+dx[i],nry=cry+dy[i],nly=cly-dy[i];
        if(nrx<0 || nry<0 || nrx>=h || nry>=w || rr[nrx][nry]=='#')nrx=crx,nry=cry;
        if(nlx<0 || nly<0 || nlx>=h || nly>=w || lr[nlx][nly]=='#')nlx=clx,nly=cly;
        if(app[nlx][nly][nrx][nry])continue;
        app[nlx][nly][nrx][nry]=true;
        Q.push(mp(mp(nlx,nly),mp(nrx,nry)));
      }
    }
    cout<<ans<<endl;
  }
}

Measured memory_bytes: 7960
#include<stdio.h>
#include<math.h>
int main()
{
              long long int a,b,n,d,c=0,i,s;
                  double r;
               scanf("%lld%lld",&n,&d);
               for(i=0;i<n;i++)
               {


               scanf("%lld%lld",&a,&b);

               s=a*a+b*b;
               r=(sqrt(s));
               if(r<=d)
               {
                   c++;
               }



                }
                printf("%lld\n",c);

    return 0;


}













Measured memory_bytes: 2128
import collections
import fractions
N,M=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N)]

lst=set()
value=0
for k in range(M):
    data=[0 for m in range(0,M+1)]
    for n in range(N):
        for m in range(M):
            if A[n][m] not in lst:
                data[A[n][m]]+=1
                break
    #print(lst)
    if value==0:value=max(data)
    else:value=min(max(data),value)
    lst.add(data.index(max(data)))
print(value)


Measured memory_bytes: 6260
N=int(input())
L=list(map(int,input().split()))

# 昇順にする
L.sort()

import bisect
count=0
for i in range(N):
    for j in range(i+1,N):
        # 2分探索を使うことでn^2*log(n)の探索で終わる,このindexは新たにL[i]+L[j]が挿入できるindexなので、このindex-1が条件を満たす最大のcのindex
        maximum_index = bisect.bisect_left(L,L[i]+L[j])
        count+= maximum_index-1 - j 
print(count)







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


int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  // 3桁の数字なので1000
  rep(i,1000) {
    string t;
    int x = i;
    // 文字列で3桁の数を作成
    rep(j,3) {
      // '0'+とすることで先頭に0も付けられる
      t += '0'+x%10;
      x /= 10;
    }
    int ti = 0;
    // 連続する数なため
    rep(j,n) {
      if (s[j] == t[ti]) {
        ++ti;
        if (ti == 3) {
          break;
        }
      }
    }
    if (ti == 3) {
      ans ++;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int h,w;
    cin >> h >> w;
    queue<pair<pair<int,int>,int>> q;
    pair<pair<int,int>,int> v;
    vector<int> dx={1,1,1,-1,-1,-1,0,0},dy={1,-1,0,1,-1,0,1,-1};
    vector<vector<int>> a(w+2,vector<int>(h+2));
    for (int i=0;i<h+2;i++){
        for (int j=0;j<w+2;j++){
            a.at(j).at(i)=0;
        }
    }
    for (int i=1;i<h+1;i++){
        for (int j=1;j<w+1;j++){
            char s;
            cin >> s;
            if (s!='.') a.at(j).at(i)=s-'0';
        }
    }
    for (int i=1;i<h+1;i++){
        for (int j=1;j<w+1;j++){
            if (a.at(j).at(i)==0){
                for (int k=0;k<8;k++){
                    if (a.at(j+dx.at(k)).at(i+dy.at(k))!=0) {
                        a.at(j+dx.at(k)).at(i+dy.at(k))--;
                        if (a.at(j+dx.at(k)).at(i+dy.at(k))==0){
                            a.at(j+dx.at(k)).at(i+dy.at(k))=10;
                            v.first.first=j+dx.at(k);v.first.second=i+dy.at(k);v.second=1;
                            q.push(v);
                        }
                    }
                }
            } 
        }
    }
    while(!q.empty()){
        int x=q.front().first.first,y=q.front().first.second,p=q.front().second;
        a.at(x).at(y)=0;
        q.pop();
        for (int k=0;k<8;k++){
                    if (a.at(x+dx.at(k)).at(y+dy.at(k))!=0) {
                        a.at(x+dx.at(k)).at(y+dy.at(k))--;
                        if (a.at(x+dx.at(k)).at(y+dy.at(k))==0){
                            v.first.first=x+dx.at(k);v.first.second=y+dy.at(k);v.second=p+1;
                            q.push(v);
                        }
                    }
                }
            
        }
        cout << v.second << endl;
    }



Measured memory_bytes: 6832
// https://atcoder.jp/contests/agc034/tasks/agc034_b

#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
#include <vector>
using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

#define EPS (1e-7)
#define INF (1e9)
#define MODI (1000000007)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOREACH(x, a) for (const auto &(x) : (a))
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

// long gcd(long a, long b) { return b ? gcd(b, a % b) : a; }
// long lcm(long a, long b) { return a * b / gcd(a, b); }

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, a, b, c, d;
    string s;
    cin >> n >> a >> b >> c >> d >> s;
    bool ans = true;
    s = " " + s;
    // C＞Dの場合、AはBを追い越す動作を優先する
    // Aを動かせるなら動かす（1マス優先）
    // 無理ならBを動かす（1マス優先）

    // C＜Dの場合、Bを優先して動かす
    // Bを動かす（1マス優先）
    // 無理ならAを動かす（1マス優先）
    if (c > d) {
        while (a != c || b != d) {
            if (a + 1 != b && s[a + 1] == '.') {
                a++;
            } else if (a + 2 != b && s[a + 2] == '.') {
                a += 2;
            } else if (b + 1 != a && s[b + 1] == '.') {
                b++;
            } else if (b + 2 != a && s[b + 2] == '.') {
                b += 2;
            } else {
                ans = false;
                break;
            }
        }
    } else {
        while (a != c || b != d) {
            if (b + 1 != a && s[b + 1] == '.') {
                b++;
            } else if (b + 2 != a && s[b + 2] == '.') {
                b += 2;
            } else if (a + 1 != b && s[a + 1] == '.') {
                a++;
            } else if (a + 2 != b && s[a + 2] == '.') {
                a += 2;
            } else {
                ans = false;
                break;
            }
        }
    }

    if (ans) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }

    return 0;
}

Measured memory_bytes: 720
#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(int i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<int,int> Pi;
const int INF=(ll)(1LL<<31)-1;
const double INFd=100000000000.0;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int n;
int d[21][21];
int m;
int main(){
	while(1){
		cin>>n;
		if(n==0)break;
		REP(i,21)
			REP(j,21)
				d[i][j]=0;
		for(int i=0;i<n;i++){
			int t,s;
			cin>>t>>s;
			d[t][s]=1;
		}
		cin>>m;
		int nx=10,ny=10;
		d[nx][ny]=0;
		for(int i=0;i<m;i++){
			char t;
			int s;
			cin>>t>>s;
			for(int j=0;j<s;j++){
				if(t=='N'){
					ny++;
				}else if(t=='E'){
					nx++;
				}else if(t=='S'){
					ny--;
				}else if(t=='W'){
					nx--;
				}
				d[nx][ny]=0;
			}
			//cout<<endl;
		}
		int flag=0;
		for(int i=0;i<21;i++){
			for(int j=0;j<21;j++){
				if(d[i][j]==1)flag=1;
			}
		}
		if(!flag)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
	return 0;
}


Measured memory_bytes: 3004
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i, n) for(int i =0 ; i < n; ++i)
#define Rep(i,a,b) for(int i=a;i<=b;i++)
#define pii pair < int, int >
typedef vector<int> vi;
typedef  long long ll;
const int mod =1e9+7;
const int N = (int)2e5 + 5;



void solve(){
	ll x;
	cin>>x;
	//for(int x=1e9-100000;x<=1e9;x++){
	for(ll i=-1000;i<=1000;i++){
		ll d=x+(ll)i*i*i*i*i*1LL;
		//cout<<d<<" ";
		ll m=pow(d,1.0/5);
		//cout<<m<<" ";
		if(pow(m,5)==d){
			//cout<<"x --> "<<x<<" "<<m<<" "<<i<<endl;
			cout<<m<<" "<<i;
			return;
			//break;
		}
	//}
//}
}
}

int main(){
	Red;
	int t=1;
	//cin>>t;
	while(t--)
	solve();
	return 0;
}

Measured memory_bytes: 4088
#include <stdio.h>
#include <bits/stdc++.h>
 
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = l; i < r; i++)
#define repb(i, r, l) for (int i = r; i > l; i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define mp(a, b) make_pair(a, b)
 
using namespace std;
 
const int N = 100000;
const int inf = (int)1e9 + 1;
const ll big = (ll)1e18 + 1;
const int P = 31;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const double eps = 1e-9;
const double pi = atan2(0, -1);

int main()
{
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(20);
    //ll TL = 0.95 * CLOCKS_PER_SEC;
    //clock_t time = clock();
    int n, A, B;
    cin >> n >> A >> B;
    int a[n];
    rep(i, 0, n)
        cin >> a[i];
    int l = 0, r = 1000000000, mid;
    while (r - l > 1)
    {
        mid = (l + r) / 2;
        ll cnt = 0;
        rep(i, 0, n)
            if (a[i] > (ll)B * mid)
                cnt += ((a[i] - (ll)B * mid + (A - B) - 1) / (A - B));
        cnt <= mid ? r = mid : l = mid;
    }
    cout << r << endl;
    return 0;
}

Measured memory_bytes: 640
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	int n;
	vector<pair<int, int> > point;	// 得点, チーム番号
	vector<int> rank;
	
	scanf("%d", &n);
	
	point.resize(n);
	rank.resize(n);
	for(int i = 0; i < n; ++i)
		point[i].first = 0, point[i].second = i;
	
	for(int i = 0; i < n * (n - 1) / 2; ++i) {
		int a, b, c, d;
		scanf("%d%d%d%d", &a, &b, &c, &d);
		if(c > d) point[a - 1].first += 3;
		else if(c < d) point[b - 1].first += 3;
		else point[a - 1].first += 1, point[b - 1].first += 1;
	}
	
	sort(point.begin(), point.end());
	int prev = point[n - 1].first, same = 0, order = 1;
	
	for(int i = n - 1; i >= 0; --i) {
		
		int score = point[i].first, team = point[i].second;
		if(prev == score) {
			++same;
		} else {
			prev = score;
			order += same;
			same = 1;
		}
		rank[team] = order;
	}
	
	for(int i = 0; i < n; ++i)
		printf("%d\n", rank[i]);
	
	return 0;
}

Measured memory_bytes: 1040
#include "bits/stdc++.h"
#define rep(i, a) for (ll i = 0; i < (a); ++i)
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define FORV(a, A) for (auto& a : A)

using namespace std;
using ll = long long;
using P = pair<int, int>;

// auto mod int
const int mod = 1000000007;
struct mint {
  ll x;  // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return (*this) *= a.inv(); }
  mint operator/(const mint a) const {
    mint res(*this);
    return res /= a;
  }
};

struct Sieve {
  int n;
  vector<int> f, primes;
  Sieve(int n) : n(n), f(n + 1) {
    f[0] = f[1] = -1;
    for (int i = 2; i <= n; ++i) {
      if (f[i]) continue;
      primes.emplace_back(i);
      f[i] = i;
      for (int j = i + i; j <= n; j += i) {
        if (!f[j]) f[j] = i;
      }
    }
  }
  bool isPrime(int x) { return f[x] == x; }
  vector<int> factorList(int x) {
    vector<int> res;
    while (x != 1) {
      res.push_back(f[x]);
      x /= f[x];
    }
    return res;
  }
  vector<P> factor(int x) {
    vector<int> fl = factorList(x);
    if (fl.size() == 0) return {};
    vector<P> res(1, P(fl[0], 0));
    for (int p : fl) {
      if (res.back().first == p)
        res.back().second++;
      else
        res.emplace_back(p, 1);
    }
    return res;
  }
};

void Main() {
  int n;
  cin >> n;
  int mx = 0;
  vector<int> A(n);
  rep(i, n) {
    int a;
    cin >> A[i];
    mx = max(mx, A[i]);
  }
  Sieve si(mx);
  vector<int> B[n];
  map<int, int> K;
  rep(i, n) for (auto p : si.factor(A[i])) {
    K[p.first] = max(K[p.first], p.second);
  }

  mint S = 1;
  for (auto itr = K.begin(); itr != K.end(); ++itr) {
    rep(_, itr->second) S *= itr->first;
  }
  mint ans = 0;
  rep(i, n) {
    mint B = S;
    for (int f : si.factorList(A[i])) {
      B /= f;
    }
    ans += B;
  }

  cout << ans.x << endl;
  return;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}


Measured memory_bytes: 5240
a, b = map(int, input().split())
cnt = 0
for i in range(a, b + 1):
    flag = True
    si = str(i)
    for j in range(len(si) // 2):
        if si[j] != si[-(j + 1)]:
            flag = False
    if flag:
        cnt += 1
print(cnt)

Measured memory_bytes: 3060
import java.util.*;
    public class Main {
     
    	public static void main(String[] args) {
    			
    		Scanner scan=new Scanner(System.in);
    		
    		int a=Integer.parseInt(scan.next());
    		int b=Integer.parseInt(scan.next());
    		int c=Integer.parseInt(scan.next());
    		
    		System.out.print(a<=c && c<=b? "Yes":"No" );
    		
    	
  
    				
    	}
     
    }

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

inline void read(int &x) {
    char ch;
    bool flag = false;
    for (ch = getchar(); !isdigit(ch); ch = getchar())if (ch == '-') flag = true;
    for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar());
    x = flag ? -x : x;
}


inline void read(long long  &x) {
    char ch;
    bool flag = false;
    for (ch = getchar(); !isdigit(ch); ch = getchar())if (ch == '-') flag = true;
    for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar());
    x = flag ? -x : x;
}

int const maxn=150000;
int a[maxn];
int num[maxn];
int n;
int main(){
    read(n);
    int tot=0;
    int ans=0;
    for (int i=1;i<=n;i++)
    {
        read(a[i]);
        if (a[i]==i)
            tot++;
        if (a[i]!=i)
            {
                ans+=(tot+1)/2;
                tot=0;
            }
    }
    if (tot!=0)
        ans+=(tot+1)/2;
    printf("%d\n",ans );
    return 0;
}


Measured memory_bytes: 640
//Name : Rupa Dey
  //Date : 28 august 2020
//joi sri gour hori gobindo...
//gobindo ja hobe vlor jonnoi hobe..
#include<bits/stdc++.h>
#define ll long long
#define d double
#define ld long double
#define vi vector<int>
#define vul vector<ull>
#define vl vector<ll>
#define pb push_back
#define si set<int>
#define sl set<ll>
#define yes cout<<"YES\n"<<endl
#define no cout<<"NO\n"<<endl
#define ys cout<<"Yes\n"<<endl
#define n cout<<"No\n"<<endl
#define test cin>>t; while(t--)
#define for(i,a,n) for(i=a;i<n;i++)
#define mp make_pair
#define ft first
#define sc second
#define gap " ";
#define MAX 9999999
#define MOD 1000000007
#define nd endl
using namespace std;
int main()
{
   ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int x,y,i,j,total=0;
    double select =0; //ceil return floating point
    cin>>x>>y;
    int a[x];
    for(i,0,x)
    {
        cin>>a[i];
        total+=a[i];
    }
    select = (ceil(total))/(4*y);
      //cout<<select;
    sort(a,a+x,greater<int>());

    for(j,0,y)
    {
        if(a[j]<select){   //less than select ..
            n;
           return 0;}
           //j--;
    }
    ys;
}
//hare krishna...
//hey gobindo kripa koro......
//only gobindo exists..^..


Measured memory_bytes: 3588
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <functional>
using namespace std;
#define int long long
#define All(v) (v).begin(),(v).end()
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
int Dy[8] = {-1,-1,0,1,1,1,0,-1};
int Dx[8] = {0,1,1,1,0,-1,-1,-1};
const int mod = 1000000007;
const int inf = mod*mod;
const int d5 = 100100;
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    int k;
    cin>>s>>k;
    int l=s.size();
    s=s+s+s;
    for(int i=1;i<s.size();i++){
        if(s[i]==s[i-1])s[i]='!';
    }
    int res=0;
    int cnt=0;
    if(s.substr(l,l)==s.substr(2*l,l)){
        for(int i=0;i<l;i++){
            if(s[i]=='!')res++;
        }
        for(int i=l;i<2*l;i++){
            if(s[i]=='!')cnt++;
        }
        cnt*=(k-1);
    }
    else{
        for(int i=0;i<l;i++){
            if(s[i]=='!')res++;
        }
        int tmp1=0,tmp2=0;
        for(int i=l;i<2*l;i++){
            if(s[i]=='!')tmp1++;
        }
        for(int i=2*l;i<3*l;i++){
            if(s[i]=='!')tmp2++;
        }
        if(k%2==1)cnt=(tmp1+tmp2)*(k/2);
        else cnt=tmp1*(k/2)+tmp2*(k/2-1);
    }
    cout<<res+cnt<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <unordered_set>
#include <cstdint>
#include <vector>
#include <string>
#include <climits>
#include <set>
#include <algorithm>
using namespace std;

int main()
{
	int a;
	cin >> a;
	cout << a + a * a + a * a * a;
}

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

const int Nmax = 110;
int L[Nmax];

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i)
		cin >> L[i];
	sort(L, L + n);
	int res = 0;
	for (int i = 0; i < n; ++i) {
		for (int j = i + 1; j < n; ++j) {
			if (L[i] == L[j])
				continue;
			for (int k = j + 1; k < n; ++k) {
				if (L[k] == L[i] || L[k] == L[j])
					continue;
				if (L[i] + L[j] > L[k])
					res++;
			}
		}
	}
	cout << res << '\n';
}

Measured memory_bytes: 3644