akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <iostream>
#include <string>

int main() {
    int n;
    scanf("%d", &n);
    bool color[8] = {};
    int free = 0;
    for (int i = 0; i < n; i++) {
        int a;
        scanf("%d", &a);
        if (a >= 1 && a <= 399) {
            color[0] = true;
        }
        else if (a >= 400 && a <= 799) {
            color[1] = true;
        }
        else if (a >= 800 && a <= 1199) {
            color[2] = true;
        }
        else if (a >= 1200 && a <= 1599) {
            color[3] = true;
        }
        else if (a >= 1600 && a <= 1999) {
            color[4] = true;
        }
        else if (a >= 2000 && a <= 2399) {
            color[5] = true;
        }
        else if (a >= 2400 && a <= 2799) {
            color[6] = true;
        }
        else if (a >= 2800 && a <= 3199) {
            color[7] = true;
        }
        else if (a >= 3200) {
            free++;
        }
    }
    int ans = 0;
    for (int i = 0; i < 8; i++) {
        if (color[i]) {
            ans++;
        }
    }
    printf("%d %d\n", std::max(ans, 1), ans + free);
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cassert>
#include <functional>
#include <queue>
#define FILL(a, n, x) memset((a), (x), sizeof ((a)[0]) * (n))
#define FILLA(a, x) memset((a), (x), sizeof (a))
#define COPY(a, n, b) memcpy((b), (a), sizeof ((a)[0]) * (n))
#define COPYA(a, b) memcpy((b), (a), sizeof (a))
using namespace std;

typedef pair<int, int> pii;
typedef long long li;
typedef unsigned long long lu;
const int inf = ~0U >> 2;
const li infl = ~0LLU >> 2;

template <class T> inline void Min(T &x, T y) { if (y < x) x = y; }
template <class T> inline void Max(T &x, T y) { if (y > x) x = y; }

const int mod = 998244353;
inline int Add(int x) { return x >= mod ? x - mod : x; }
inline void Add(int &x, int y) { x += y; if (x >= mod) x -= mod; }
inline int Sub(int x) { return x < 0 ? x + mod : x; }
inline void Sub(int &x, int y) { x -= y; if (x < 0) x += mod; }
inline int Mul(int x, int y) { return (int)((li)x * y % mod); }
inline int Mul(int x, int y, int z) { return Mul(x, Mul(y, z)); }
int Pow(int x, int y) { int z = 1;
  for (; y; y >>= 1, x = Mul(x, x)) { if (y & 1) z = Mul(z, x); } return z; }
inline int Inv(int x) { return Pow(x, mod - 2); }
inline int Fix(li x) { x %= mod; if (x < 0) x += mod; return (int)x; }
inline int Fix(int x) { x %= mod; if (x < 0) x += mod; return x; }

// ----------------------------------------

const int maxn = 18;

typedef pair<li, li> pll;

int n, A[maxn];
vector<pll> F[maxn][maxn];

void Shrink(vector<pll> &S) {
  sort(S.begin(), S.end());
  reverse(S.begin(), S.end());
  vector<pll> T;
  for (auto x : S) {
    while (!T.empty() && T.back().second >= x.second) {
      T.pop_back();
    }
    T.push_back(x);
  }
  swap(S, T);
}

void Solve(int l, int r) {
  if (F[l][r].size()) return;
  if (l > r) {
    F[l][r].push_back({0, 0});
    return;
  }

  for (int mid = l; mid <= r; ++mid) {
    Solve(l, mid - 1);
    Solve(mid + 1, r);
    for (auto x : F[l][mid - 1]) {
      for (auto y : F[mid + 1][r]) {
        li L = x.first, R = y.second, M = x.second + y.first + A[mid];
        F[l][r].push_back({L + M, R + M});
      }
    }
  }

  Shrink(F[l][r]);
}

int main(void) {
  scanf("%d", &n);
   for (int i = 0; i < n; ++i) {
    scanf("%d", A + i);
  }
  // if (n == 2) {
  //   printf("%lld\n", (li)A[0] + A[1]);
  //   return 0;
  // }
  Solve(1, n - 2);
  li mx = 1e18;
  for (auto x : F[1][n - 2]) {
    Min(mx, x.first + x.second);
  }
  mx += A[0];
  mx += A[n - 1];
  printf("%lld\n", mx);
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
 
using namespace std;
inline void prep ()
{
  cin.tie (0);
  cin.sync_with_stdio (0);
};
const double pi = acos(-1.);
//printf(%.12lf\n,mid);
// __builtin_popcount(int) count 1's in binary
// get decimal part of number
/*
double intpart;
double thiss = modf((double)(n*m)/(double)k, &intpart);
*/
// round = (int)(num+.5)
long long mod = 1000000007;

// 32 mil = ~1 sec 
long long mymod(long long num){
  if (num< 0 && !(num%mod == 0)){
    if (mod == 1){
      return 0;
    }
    return mod-abs(num)%mod;
  }else{
    return num%mod;
  }
}
 
/*string sentence = And I feel fine...;
    istringstream iss(sentence);
*/  
 
double eps = .000000001;

int main ()
{
  prep();
  int n;
  cin >> n;
  int sum = 0;
  vector<int> these;
  bool have[30001] = {false};
  for (int i=1; i<=30000 && these.size() < n-1; i++){
      if (i%2 == 0){
          sum += i;
          these.push_back(i);
          have[i] = true;
      }else if (i%3 == 0){
          sum += i;
          these.push_back(i);
          have[i] = true;
      }
      
  }
  int must2 = 0;
  int must3 = 0;
  if (sum%2 == 1){
      must2 = 1;
  }
  if (sum%3 == 1){
      must3 = 2;
  }else if (sum%3 == 2){
      must3 = 1;
  }
  int goodnum = 0;
  for (int i=1; i <=30000; i++){
      if (!have[i] && i%2 == must2 && i%3 == must3 && __gcd(i, sum) != 1){
          goodnum = i;
          break;
      }
  }
  
  for (int i : these){
      cout << i << " ";
  }
  cout << goodnum;
  return 0; 
}


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

inline void init(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
}



int main() {
	init();
	int h, w, m;
	cin >> h >> w >> m;
	long long ans = 0;
	vector<pair<int, int>> H(h), W(w);
	map<pair<int, int>, bool> mmap;
	for(int i = 0; i < m; ++i){
		int a, b;
		cin >> a >> b;
		--a, --b;
		mmap[{a,b}] = 1;
		++H[a].first, ++W[b].first;
		H[a].second = a;
		W[b].second = b;
	}
	sort(H.rbegin(), H.rend());
	sort(W.rbegin(), W.rend());
	for(int i = 0; (i < h) && (H[i].first == H[0].first); ++i){
		for(int j = 0; (j < w) && (W[j].first == W[0].first); ++j){
			if(mmap.count({H[i].second, W[j].second})){
//				cout << i << " " << j << endl;
				ans = H[i].first + W[j].first - 1;
			}
			else{
				ans = H[i].first + W[j].first;
//				cout << i << " " << j << endl;
				cout << ans;
				return 0;
			}
		}
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 26592
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//

fn ok(p: &[(i64, i64)], x: f64, y: f64, r: f64) -> bool {
    let eps = 1e-7;
    for &(p, q) in p.iter() {
        let p = p as f64;
        let q = q as f64;
        let dx = p - x;
        let dy = q - y;
        if (dx * dx + dy * dy).sqrt() > r + eps {
            return false;
        }
    }
    true
}

fn run() {
    input! {
        n: usize,
        p: [(i64, i64); n],
    }
    let mut ans = std::f64::MAX;
    for (i, a) in p.iter().enumerate() {
        for b in p[..i].iter() {
            let x = (a.0 + b.0) as f64 * 0.5;
            let y = (a.1 + b.1) as f64 * 0.5;
            let dx = (a.0 - b.0) as f64;
            let dy = (a.1 - b.1) as f64;
            let r = (dx * dx + dy * dy).sqrt() * 0.5;
            if ok(&p, x, y, r) && r < ans {
                ans = r;
            }
        }
    }
    for (i, &a) in p.iter().enumerate() {
        for (j, &b) in p[..i].iter().enumerate() {
            for &c in p[..j].iter() {
                let point = &p;
                let p = 2 * (a.0 - b.0);
                let q = 2 * (a.1 - b.1);
                let r = 2 * (a.0 - c.0);
                let s = 2 * (a.1 - c.1);
                if p * s - q * r == 0 {
                    continue;
                }
                let x = (a.0 + b.0) * (a.0 - b.0) + (a.1 + b.1) * (a.1 - b.1);
                let y = (a.0 + c.0) * (a.0 - c.0) + (a.1 + c.1) * (a.1 - c.1);
                let det = p * s - q * r;
                let z = s * x - q * y;
                let w = -r * x + p * y;
                let (x, y) = (z as f64 / det as f64, w as f64 / det as f64);
                let r = ((a.0 as f64 - x).powi(2) + (a.1 as f64 - y).powi(2)).sqrt();
                if ok(&point, x, y, r) && r < ans {
                    ans = r;
                }
            }
        }
    }
    println!("{:.7}", ans);
}

fn main() {
    run();
}


Measured memory_bytes: 4352
#include <iostream>
#include <queue>

int main(){
    while (true) {
        int n;  // I will buy n vegetables.
        int m;  // One bag contains m vegetables.

        std::cin >> n >> m;
        if ( n==0 && m==0 ) {
            return 0;
        }

        // input vegetable's cost.
        std::priority_queue<int> buy;	            // the first item in 'buy' is the most expensive.
        int in;
        for (int i=0; i < n ; ++i) {
            std::cin >> in;
            buy.push(in);
        }

        int cost = 0;  // How much must I pay?
        int x = 1;  // This is the 'x'th vegetable in the bag.
        while ( ! buy.empty() ) {
            // the 'm'th item in the bag is free!
            if ( x > m-1 ) {
                x = 1;
            }else{
                cost += buy.top();
                ++x;
            }
            buy.pop();
        }

        // output
        std::cout << cost << std::endl;
    }

    return 0;
}

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


int main(){
 
  long long x;
  cin >>x;
  if(floor(sqrt(8*x+1))*floor(sqrt(8*x+1))==8*x+1) cout << (floor(sqrt(8*x+1))-1)/2 << endl;
  else cout << floor((floor(sqrt(8*x+1))-1)/2)+1 << endl;
}

Measured memory_bytes: 256
A, B = map(int, input().split())

print(100, 100)
big = max(A, B)
small = min(A, B)

ans = ['#'*100, '.#'*50]

b = 1
s = 1
flag = True
for i in range(98):
  if s + 50 <= small:
    ans.append(['#.', '.#'][i%2]*50)
    b += 50
    s += 50
  elif s < small < s + 50:
    l = small - s
    ans.append(['#.', '.#'][i%2]*l + '..'*(50-l))
    flag = True
    b += l
    s += l
  elif flag:
    ans.append('.'*100)
    flag = False
  else:
    if b + 50 <= big:
      ans.append('#.'*50)
      b += 50
    elif b < big < b + 50:
      l = big - b
      ans.append('#.'*l + '..'*(50-l))
      b += l
    else:
      ans.append('.'*100)
    flag = True

for i in range(100):
  if A > B:
    print(ans[i].replace('#', '_').replace('.', '#').replace('_', '.'))
  else:
    print(ans[i])

Measured memory_bytes: 3188
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
#%%code
def resolve():
    cnt=0
    for i in input():
        if i =="-":
            cnt-=1
        else:cnt+=1
    print(cnt)
        
#%%submit!
resolve()


Measured memory_bytes: 38256
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

string S;
int main(void) {
  cin >> S;
  int N = S.length();

  int evenc = 0;
  for (int i = 0; i < N; i++) {
    char t = i % 2 == 0 ? '0' : '1';
    if (S[i] != t)
      evenc++; 
  }

  int oddc = 0;
  for (int i = 0; i < N; i++) {
    char t = i % 2 == 0 ? '1' : '0';
    if (S[i] != t)
      oddc++;
  }

  cout << min(evenc, oddc) << endl;

  return 0;
}

Measured memory_bytes: 512
n = int(input())
a = list(map(int, input().split()))
count = 0
cnt = 0
for i in range(n):
    if a[i] % 2 == 0 and (a[i] % 3 == 0 or a[i] % 5 == 0):
        count += 1
    if a[i] % 2 == 0:
        cnt += 1

if count == cnt:
    print("APPROVED")
else:print("DENIED")


Measured memory_bytes: 38384
#include <stdio.h>
#include <string.h>
#define M 1000000
#define L 12
#define MIL (-1)

char  H[M][L];

int ha(int key) {return key%M;}

int hb(int key) {return 1+(key%(M-1));}

int getChar(char ch) {
    if (ch=='A') return 1;
    else if (ch=='C') return 2;
    else if (ch=='G') return 3;
    else if (ch=='T') return 4;
    return 0; 
}
long long getkey(char str[]) {
    long long sum=0,p=1,i;
    for (i=0; i<strlen(str); i++) {
        sum+=p*(getChar(str[i]));
        p*=5;
    }
    return sum;
}
int insert(char str[]) {
    long long key,i,h;
    key = getkey(str);
    for (i=0; ; i++) {
        h = (ha(key)+i*hb(key))%M;
        if (strcmp(H[h],str)==0) {
            return 1;
        } 
        else if (strlen(H[h])==0) {
            strcpy(H[h],str);
            return 0;
        }
    }
    return 0;
}
int find(char str[]) {
    long long key,i,h;
    key = getkey(str);
    for (i=0; ; i++) {
        h = (ha(key)+i*hb(key))%M;
        if (strcmp(H[h],str)==0) {
            return 1;
        }
        else if (strlen(H[h])==0) {
            return 0;
        }
    }
    return 0;
}
int main() {
    int i;
    for (i=0; i<M; i++) {
        H[i][0]='\0';
    }
    int n;
    scanf("%d",&n);
    char str[L],com[9];
    for (i=0; i<n; i++) {
        scanf("%s %s",com,str);
        if (com[0]=='i') {
            insert(str);
        } 
        else {
            if (find(str)) {
                printf("yes\n");
            }
            else {
                printf("no\n");
            }
        } 
    }
    return 0;
}



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

int main(){
  
  string s,t;
  cin>>s>>t;
  
  int ans=0;
  for(int  i=0;i<3;i++) if(s[i]==t[i]) ans++;
  cout<<ans;
  
  
  
 
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>

#define DIV 1000000007
using namespace std;
using ll = long long;

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

	vector<ll> a(N), b(N);
	ll suma = 0, sumb = 0;
	for (int i = 0; i < N; i++) {
		cin >> a[i];
		suma += a[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> b[i];
		sumb += b[i];
	}

	ll K = sumb - suma;
	ll cnta = 0, cntb = 0;
	for (int i = 0; i < N; i++) {
		if (a[i] < b[i]) {
			ll temp = (b[i] - a[i] + 1) / 2;
			cnta +=  temp;
			a[i] += 2 * temp;
			cntb += a[i] - b[i];
			b[i] = a[i];
		}

		else {
			cntb += a[i] - b[i];
			b[i] = a[i];
		}
	}

	if (cnta <= K && cntb <= K && 2 * (K - cnta) == (K - cntb))
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

}

Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

struct job {
	int A, B;
	bool operator < (const job& b) {
		return B < b.B;
	}
};
job J[200010];	
int main()
{
	int N;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> J[i].A >> J[i].B;
	}
	sort(J, J + N);
	int time = 0;
	for (int i = 0; i < N; i++) {
		time += J[i].A;
		if (time > J[i].B) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
}

Measured memory_bytes: 1792
#include<iostream>
#include<fstream>
#include<iomanip>
#include<cstdio>
#include<string>
#include<cstring>
#include<climits>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#include<list>
#include<unordered_map>
#include<random>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define lb lower_bound
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
// #define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};


ll n,a[100][100];
ll dp[1<<16];
ll use[1<<16];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    cin>>n;
    rep(i,n){
        rep(j,n){
            cin>>a[i][j];
        }
    }
    rep(bit,(1<<n)){
        rep(i,n){
            rep2(j,i,n){
                if((bit&(1<<i))&&(bit&(1<<j)))use[bit]+=a[i][j];
            }
        }
    }
    rep(bit,(1<<n)){
        for(ll mask=bit;mask>0;mask=(mask-1)&bit){
            dp[bit]=max(dp[bit],dp[bit-mask]+use[mask]);
        }
    }
    cout<<dp[(1<<n)-1]<<endl;
    return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll n;
ll a[200005];
ll x;
int main(void){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
        x^=a[i];
    }
    for(int i=0;i<n;i++){
        ll ans=x^a[i];
        cout<<ans<<endl;
    }

    return 0;
}



Measured memory_bytes: 5180
import java.util.*;
class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String n = sc.nextLine();
        System.out.println(ret(n));
        sc.close();
    }
    static int ret (String n){
        int ret = 7;
        switch (n) {
            case "MON":
                ret = 6;
                break;
            case "TUE":
                ret = 5;
                break;
            case "WED":
                ret = 4;
                break;
            case "THU":
                ret = 3;
                break;
            case "FRI":
                ret = 2;
                break;
            case "SAT":
                ret = 1;
                break;
            default:
                break;
        }
        return ret;
    }
}

Measured memory_bytes: 21332
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int n,m,l,r,a[N],sum;
int main()
{
    cin>>n>>m;
    for(int i=1;i<=m;i++)cin>>l>>r,a[l]++,a[r+1]--;
    for(int i=1;i<=n;sum+=(a[i]==m?1:0),i++)a[i]+=a[i-1];
    return cout<<sum,0;
}

Measured memory_bytes: 640
import numpy as np
n = int(input())
grid = []
for i in range(n):
    array = list(map(int,input().split()))
    grid.append(array)
sum = 0
for i in range(n):
    for j in range(i+1,n):
        sum += np.sqrt((grid[i][0]-grid[j][0])**2+(grid[i][1]-grid[j][1])**2)
print(sum*(n-1)/n/(n-1)*2)

Measured memory_bytes: 12488
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,k,c;cin>>n>>k>>c;
	string s;cin>>s;

	set<int> st1,st2;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='x') continue;
		st1.insert(i);
		i+=c;
	}
	for(int i=s.size()-1;i>=0;i--)
	{
		if(s[i]=='x') continue;
		st2.insert(i);
		i-=c;
	}

	if(st1.size()>k||st2.size()>k) ;
	else{
		for(int i:st1)
			if(st2.count(i)) cout<<i+1<<"\n";
	}

	return 0;
}

Measured memory_bytes: 20484
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

template<typename T>
void update(T &a, T b) {
    if(a.first < b.first) a = b;
    if(a.first == b.first and a.second > b.second) a = b;
}

int dp[3][20010];
signed main() {
    int N; cin >> N;

    // (耐久, 重さ, 価値)
    vector< tuple<int, int, int, int> > tup;
    for(int i=0; i<N; i++) {
        int a, b, c; cin >> a >> b >> c;
        tup.emplace_back(a+b, b, a, c);
    }

    sort(tup.begin(), tup.end());
    // const pair<int, int> NIL(-1, -1);
    fill(dp[0], dp[2], -1);

    const int MAXS = 20000;
    int ans = 0;
    dp[0][0] = 0;
    for(int i=0; i<N; i++) {
        int cur = i % 2, nxt = 1 - cur;
        for(int j=0; j<=MAXS; j++) {
            if(dp[cur][j] < 0) continue;
            // fprintf(stderr, "dp[%lld][%lld] = (%lld, %lld)\n", i, j, dp[cur][j].first, dp[cur][j].second);
            // fprintf(stderr, "tuple: (%lld, %lld, %lld, %lld)\n", get<0>(tup[i]), get<1>(tup[i]), get<2>(tup[i]), get<3>(tup[i]));
            // fprintf(stderr, "dp[%lld][%lld] = %lld\n", i, j, dp[cur][j]);
            
            // 前のブロックの重さも考慮
            // int pre = dp[cur][j].second;
            // int nj = j + pre;
            
            // 耐久できるなら採用 (取る場合)
            if(j <= MAXS and j <= get<1>(tup[i])) {
                // int fst = dp[cur][j].first + get<3>(tup[i]); // 価値
                // int snd = get<2>(tup[i]); // 重さ
                // update(dp[nxt][nj], make_pair(fst, snd));
                chmax(dp[nxt][j + get<2>(tup[i])], dp[cur][j] + get<3>(tup[i]));
            }

            // 取らない
            // update(dp[nxt][j], dp[cur][j]);
            chmax(dp[nxt][j], dp[cur][j]);
            
            // dp[cur][j] = NIL;
            dp[cur][j] = -1;
        }
    }

    for(int i=0; i<=MAXS; i++) {
        // chmax(ans, dp[N%2][i].first);
        chmax(ans, dp[N%2][i]);
    }
    cout << ans << endl;
    return 0;
}


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

typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define sz(vs) (ll)(vs.size())
#define rep(i,a,b) for (ll i = a; i < b; ++i)
#define rep_(i,a,b) for (ll i = a; i > b; --i)
#define endl '\n'
const ll mod = 1e9 + 7;

const ll maxn = 1e6 + 6;

ll n;
ll m, spf[maxn], multiple_count[maxn];

// #include "debug.h"
void solve() {
	memset(multiple_count, 0, sizeof(multiple_count));
	cin >> n;
	rep(i,0,n) {
		cin >> m;
		while (m > 1) {
			int current_spf = spf[m];
			while (spf[m] == current_spf) m /= current_spf;
			++multiple_count[current_spf];
		}
	}
	bool pairwisecp = true;
	for (int i = 0; i < maxn; ++i) {
		if (multiple_count[i] == n) {
			cout << "not coprime" << endl;
			return;
		}
		if (multiple_count[i] > 1) pairwisecp = false;
	}
	if (pairwisecp) cout << "pairwise coprime" << endl;
	else cout << "setwise coprime" << endl;
}

void aux() {
	memset(spf, 0, sizeof(spf));
	spf[1] = 1;
	for (int i = 2; i < maxn; ++i) {
		if (!spf[i]) {
			spf[i] = i;
			for (int j = i; j <= (maxn - 1) / i; ++j) {
				if (!spf[i * j]) spf[i * j] = i;
			}
		}
	}
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	cout<<fixed<<setprecision(10);
	aux();
	ll _ = 1;
	// cin>>_;
	while(_--) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 19240
/**
 *    author:  tourist
 *    created: 23.09.2017 15:03:08       
**/
#include <bits/stdc++.h>

using namespace std;

void err() {
  puts("No");
  exit(0);
}

int main() {
  int h, w;
  cin >> h >> w;
  vector<int> cnt(26, 0);
  for (int i = 0; i < h; i++) {
    string s;
    cin >> s;
    for (char c : s) {
      cnt[c - 'a']++;
    }
  }
  if ((h * w) % 2 == 1) {
    for (int i = 0; i < 26; i++) {
      if (cnt[i] % 2 == 1) {
        cnt[i]--;
        break;
      }
    }
  }
  for (int i = 0; i < 26; i++) {
    if (cnt[i] % 2 == 1) {
      err();
    }
  }
  int k2 = 0;
  if (h % 2 == 1) {
    k2 += w / 2;
  }
  if (w % 2 == 1) {
    k2 += h / 2;
  }
  int have2 = 0;
  for (int i = 0; i < 26; i++) {
    have2 += (cnt[i] % 4 == 2);
  }
  if (have2 > k2) {
    err();
  }
  puts("Yes");
  return 0;
}


Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int n; cin>>n;
    vi v(n);rep(i,n)cin>>v[i];
    vi dp(n,0);
    int cnt=1,flag = 3,ans;
    rep(i,n-1){
        if(v[i]<v[i+1]){
            if(!i||flag==3){flag=1;}
            if(flag!=1){cnt++;flag=3;continue;}
            flag=1;
        }else if(v[i]>v[i+1]){
            if(!i||flag==3){flag=0; }
            if(flag!=0){cnt++;flag=3; continue;}
            flag=0;
        }else continue;
    }
    cout<<cnt<<endl;
}

Measured memory_bytes: 1024
/*

                              Jai Shree Krishna !!
                                 Radhe Radhe !!
                                 
             उद्यमेन हि सिद्ध्यन्ति कार्याणि न मनोरथैः। नहि सुप्तस्य सिंहस्य मुखे प्रविशन्ति मृगाः।।
             
*/
   
   
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
typedef long long ll;
#define loop(i,n)  for(int i=0;i<n;i++)
#define read(a) int a; cin >>a;
#define readarr(a,n) int a[n] ; for(int i=0;i<n;i++) cin >> a[i];
#define readmat(a,n,m) int a[n][m]; for(int i=0;i<n;i++) for(int j=0;j<m;j++) cin >> a[i][j];
#define pb push_back
#define ff first
#define ss second
#define vi vector<int>
#define pi pair<int,int>
#define vvi vector<vector<int>>
#define sti set<int>
#define vpi vector<pair<int,int>>
#define print(a,n) for(int i=0;i<n;i++) cout<<a[i]<<" "; cout<<endl;
#define printmat(a,n,m) for(int i=0;i<n;i++) {for(int j=0;j<m;j++) cout<<a[i][j]<<" "; cout<<endl;}
#define fast ios_base::sync_with_stdio(false);  cin.tie(NULL);
#define endl "\n"
#define mp make_pair
#define ins insert
#define rep(i,s,e)  for(int i=s;i<=e;i++)
#define repd(i,s,e)  for(int i=e;i>=s;i--)
#define vb vector<bool>
#define read2(n,m) int n,m; cin >> n >> m;
#define range(v) v.begin(),v.end()
#define sortd(v) sort(v.begin(),v.end(),greater<int>())
#define sorti(v) sort(v.begin(),v.end())

const ll inf = 1e18;
const ll mod = 1e9 + 7;
 
signed main()
{
 
    fast;
    int n ; cin >> n;
    readarr(a,n);
    readarr(b,n);
    int p[n];
    loop(i,n) p[i]=i+1;
    int k=0,aa=0,bb=0;
    do { 
    k++;
    int r=0;
    rep(i,0,n-1) if(a[i]==p[i]) r++;
    if(r==n) aa=k;
    r=0;
    rep(i,0,n-1) if(b[i]==p[i]) r++;
    if(r==n) bb=k;
  } while ( next_permutation(p,p+n) );  
  cout<<abs(aa-bb)<<endl;
    return 0;
}

/* Pooja Yadav */

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define INF (ll)(1e18)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }





int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    
    
    string s;
    cin >> s;
    // かっこ列
    stack<char> stk;
    rep(i, sz(s)) {
        if (s[i] == 'S') {
            stk.push('S');
        } else {
            if (sz(stk) && stk.top() == 'S') {
                stk.pop();
            } else {
                stk.push('T');
            }
        }
    }
    cout << sz(stk) << endl;
    
}


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

const double PI = acos(-1);

int main(){
    double A, B, H, M;
    cin >> A >> B >> H >> M;
    double ax = A*sin(2*PI*(H+M/60)/12);
    double ay = A*cos(2*PI*(H+M/60)/12);
    double bx = B*sin(2*PI*M/60);
    double by = B*cos(2*PI*M/60);
    double ans = hypot(ax-bx, ay-by);
    cout << fixed << setprecision(10) << ans << endl;
    return 0;
}


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

int main(){
	int x;
	cin >> x;
	while(x > 3100) x-= 1000;
	bool isOK = false;
	rep(a, 21){
		rep(b, 21){
			rep(c, 21){
				rep(d, 21){
					rep(e, 21){
						rep(f, 21){
							if(100*a + 101*b + 102*c + 103*d + 104*e + 105*f == x) isOK = true;
						}
					}
				}
			}
		}
	} 

	if(isOK) cout << 1 << endl;
	else cout << 0 << endl;
	return 0;
}

Measured memory_bytes: 3596
#!usr/bim/python
#! -*- coding: utf-8 -*-

hw = raw_input()
hw = hw.split()
hw = map(int,hw)

n = raw_input()
n = int(n)

a = raw_input()
a = a.split()
a = map(int,a)

ans = []

i = 0
for j in a:
    for k in range(j):
        ans.append(i+1)
    i += 1

import numpy as np

ans = np.array(ans)
ans = ans.reshape([hw[0],hw[1]])

i = 0
while i < hw[0]:
    if i % 2 == 0:
        ans[i] = ans[i][::-1]
    i += 1

for line in ans:
    for i in line:
        print str(i),
    print ""


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


int main(){



    long long int n;

    cin>>n;

    long long int arr[n];

    cin>>arr[0];
    long long z=arr[0];


    for(int i=1;i<n;i++)
    {
        cin>>arr[i];
        z=z^arr[i];
    }



    for(int i=0;i<n;i++){
        long long x=z^arr[i];
        cout<<x<<" ";
    }

    cout<<endl;





    return 0;
}


Measured memory_bytes: 5124
L,A,B,M=map(int,input().split())
K=19
gap=[-1 for k in range(K)]
for k in range(K):
    tmp=10**k-A
    if tmp%B==0:
        gap[k]=-1+tmp//B
    else:
        gap[k]=tmp//B
    gap[k]=min(L-1,gap[k])
    gap[k]=max(-1,gap[k])
num=[0 for k in range(K)]
for k in range(1,K):
    #k-1,k
    num[k]=-gap[k-1]+gap[k]
def matrix(d):
    return [[pow(10,d,M),1,0],[0,1,B],[0,0,1]]
def mattime(P,Q):
    R=[[0,0,0],[0,0,0],[0,0,0]]
    for i in range(3):
        for j in range(3):
            for k in range(3):
                R[i][j]+=P[i][k]*Q[k][j]
                R[i][j]%=M
    return R
def matexp(P,n):
    if n==0:
        return [[1,0,0],[0,1,0],[0,0,1]]
    elif n%2==0:
        return matexp(mattime(P,P),n//2)
    else:
        return mattime(P,matexp(mattime(P,P),n//2))
Mat=[[1,0,0],[0,1,0],[0,0,1]]
for d in range(1,K):
    Mat=mattime(matexp(matrix(d),num[d]),Mat)
print((A*Mat[0][1]+Mat[0][2])%M)


Measured memory_bytes: 3188
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#define M 1000000007
typedef long long int ll;
int main()
{
  ll n,i;
  ll ans=0;
  cin>>n;
  for(i=1;i*i<=n;i++)
  {
      if(n%i==0)
      {
          ll p,q;
          p=i;
          q=n/i;
          if(p==q)
          {
              ll g=p-1;
              if(g!=0)
              {
                  if((n/g)==(n%g))
                  {
                      ans+=g;
                  }
              }
          }
          else
          {
              ll g=p-1;
              if(g!=0)
              {
                  if((n/g)==(n%g))
                  {
                      ans+=g;
                  }
              }
              g=q-1;
              if(g!=0)
              {
                  if((n/g)==(n%g))
                  {
                      ans+=g;
                  }
              }
          }
      }
  }
      cout<<ans;



}


Measured memory_bytes: 384
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <utility>

using namespace std;

int main() {

	int N, W;
	scanf("%d %d", &N, &W);

	pair<int, int> items[N + 1];
	for (int i = 1; i <= N; ++i) {
		int v, w;
		scanf("%d %d", &v, &w);
		items[i] = make_pair(v, w);
	}

	int V[N + 1][W + 1];
	for (int i = 0; i <= N; ++i) {
		V[i][0] = 0;
	}
	for (int i = 0; i <= W; ++i) {
		V[0][i] = 0;
	}
	for (int i = 1; i <= N; ++i) {
		for (int j = 1; j <= W; ++j) {
			if (items[i].second <= j) {
				V[i][j] = max(V[i - 1][j], V[i - 1][j - items[i].second] + items[i].first);
			} else {
				V[i][j] = V[i - 1][j];
			}
		}
	}
	int maxv = 0;
	for (int i = 1; i <= W; ++i) {
		maxv = max(maxv, V[N][i]);
	}
	cout << maxv << endl;

	return 0;
}

Measured memory_bytes: 7160
//input: S T
//output: ST

#include <stdio.h>

int main() {
	char ayam1 [102];
	char ayam2 [102];
	
	scanf("%s %s", &ayam1, &ayam2);
	printf("%s%s\n", ayam2, ayam1);
	
	return 0;
}

Measured memory_bytes: 1664
#include<iostream>
#include<fstream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstring>

using namespace std;
long long n,m;
string st[50+10];
int a[50+10][50+10];
int main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++)
	{
		cin>>st[i];
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=0;j<m;j++)
		{
			if(st[i][j]=='#')
			a[i][j+1]=-1;
		}
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
		{
			if(a[i][j]==-1)
			{
				cout<<"#";continue;
			}
			cout<<abs(a[i-1][j-1]+a[i-1][j]+a[i-1][j+1]+a[i][j-1]+a[i][j+1]+a[i+1][j+1]+a[i+1][j]+a[i+1][j-1]);
		}
		cout<<endl;
	}
	return 0;
}

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

long long gcd(long long aaa,long long bbb) {
    if(bbb==0) {
        return aaa;
    }
    return gcd(bbb,aaa%bbb);
}

int main (){

    string S,tmp,cmp;
    cin >> S;
    ll ans = S.size()-2,tmpp = S.size();
    S = S.substr(0,S.size()-2);
    for(int i = 0; i < tmpp/2; i++) {
        tmp = S.substr(0,ans/2);
        cmp = S.substr(ans/2,ans/2);
        if(tmp == cmp) {
            cout << ans << endl;
            return 0;
        }
        S = S.substr(0,S.size()-2);
        ans-=2;
    }

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(a),i##_end=(b);i<=i##_end;++i)
#define For(i,a,b) for(int i=(a),i##_end=(b);i<i##_end;++i)
#define per(i,a,b) for(int i=(b),i##_st=(a);i>=i##_st;--i)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define dbg(x) cerr<<#x" = "<<x<<endl
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define Es(x,i) for(Edge*i=G[x];i;i=i->nxt)
typedef long long ll;
typedef pair<int,int> pii;
const int inf=~0u>>1,MOD=1e9+7;
inline int rd() {
    int x,c,f=1;while(!isdigit(c=getchar()))f=c!='-';x=c-'0';
    while(isdigit(c=getchar()))x=x*10+c-'0';return f?x:-x;
}
int main(){
	int n=rd(),nx=0,ny=0,lst=0;
	rep(i,1,n){
		int t=rd(),x=rd(),y=rd();
		int sum=abs(nx-x)+abs(ny-y);
		if(sum<=t-lst&&(t-lst-sum)%2==0){
			nx=x,ny=y;
		}
		else {
			puts("No");
			return 0;
		}
		lst=t;
	}
	puts("Yes");
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

        double ans = (double) t / (double) x;
        System.out.println(ans);
    }

}


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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

void print(const vector<int> &v) {
  for(auto x : v) {
    cout << x << " ";
  }
  cout << endl;
}

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  ll a, b;
  cin >> n >> a >> b;
  VL h(n);
  rep(i, n) cin >> h[i];
  ll hmax = *max_element(all(h));
  ll left = 0;
  ll right = hmax + 1;
  ll ans;
  while(right - left > 1) {
    ll mid = (right + left) / 2;
    ll count = 0;
    rep(i, n) {
      if(mid * b >= h[i]) continue;
      count += (ll)ceil((double)(h[i] - mid * b) / (double)(a - b));
    }
    if(count <= mid){
      right = mid;
      ans = mid;
    }
    else {
      left = mid;
    }
  }
  out(ans);
  return 0;
}


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

// bool acgt(string a) {
//   if(a == 'A' || a == 'C' || a == 'G' || a == 'T') {
//     return true;
//   } else {
//     return false;
//   }
// }

int main() {
  string s;
  cin >> s;
  int co = 0;
  int ans = 0;
  for(int i = 0; i < s.size(); i++) {
    if(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
      co++;
      if(ans < co) ans = co;
    } else {
      if(ans < co) ans = co;
      co = 0;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

// Sort
type Val struct {
	id, num int
}
type ByNum []Val

func (a ByNum) Len() int           { return len(a) }
func (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }
func (a ByNum) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	D, N := sc.nextInt(), sc.nextInt()
	var ans int
	if N == 100 {
		ans = pow(100, D)*N + pow(100, D)
	} else {
		ans = pow(100, D) * N
	}

	fmt.Fprintln(wtr, ans)
	wtr.Flush()
}


Measured memory_bytes: 640
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Arrays;
import java.util.Collections;
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    int M = scan.nextInt();
    if(N > M){
      System.out.println("No");
    }
    else{
      System.out.println("Yes");
    }
  }
}




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

int n, ans=0;
vector<int> a;
vector<int> b;

int main() {
    cin >> n;
    a.resize(n);
    b.resize(n);

    for (int i = 0; i < n; ++i) cin >> a.at(i);
    for (int i = 0; i < n; ++i) cin >> b.at(i);

    for (int i = 0; i < n; ++i)
    {
        bool on_a = true;
        int sum = 0;
        for (int j = 0; j < n; ++j)
        {
            if (j == i)
            {
                sum += a.at(j);
                sum += b.at(j);

                on_a = false;
            } else {
                if (on_a)
                {
                    sum += a.at(j);
                } else {
                    sum += b.at(j);
                }
            }
        }
        ans = max(sum, ans);
    }

    cout << ans << endl;
}

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

using ll = long long;

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

    int N, M, K;
    cin >> N >> M >> K;

    for (int n = 0; n <= N; ++n) {
        for (int m = 0; m <= M; ++m) {
            if (m * (N - n) + n * (M - m) == K) {
                cout << "Yes" << '\n';
                return 0;
            }
        }
    }

    cout << "No" << '\n';

    return 0;
}


Measured memory_bytes: 256
/*"Everything in the universe is balanced. Every disappointment
   you face in life will be balanced by something good for you!
                Keep going, never give up."            */

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


#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
ordered_set<int>  os;
#define up_bound(i) os.order_of_key(i) << endl; // the number of elements in the os less than i
#define access_idx(i) *os.find_by_order(i) // print the i-th smallest number in os(0-based)

typedef double f80;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l, int r){uniform_int_distribution<int> uid(l, r); return uid(rng); }

#define ll long long int
#define ld double 
#define rep(i,a,b) for(int i=a; i<=b; ++i)
#define repd(i,a,b) for(int i=a; i>=b; --i)
#define deb cerr << "Line no." << __LINE__
#define nl '\n'
#define pb push_back
#define all(a) a.begin(),a.end()
#define P pair<ll,ll> 
#define F first
#define S second
const ll p_mod=9999999999999983;
const long double pi = 3.14159265358979323;
const ll N=1e6+9;
const ll mod=1e9+7;
ll powerk(ll x, ll y);
ll mul(ll x, ll y);
ll add(ll x, ll y);
ll sub(ll x, ll y);

ll a[N],dp[N];

void solve()
{    
  ll n,m;
  cin>>n>>m;
  rep(i,1,n)cin>>a[i];
  rep(i,1,m)
  {
  	ll flag=0;
  	rep(j,1,n)
  	{
  		if(i-a[j]>=0 && dp[i-a[j]]==0)
  			flag=1;
  	}
  	dp[i]=flag;
  }
  if(dp[m])cout<<"First"<<nl;
  else cout<<"Second"<<nl;

}


int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    ll t=1;
    //pre();
    //cin>>t;
    while(t--)
    {
      solve();
    }  
}
ll mul(ll x, ll y){return (x*y)%mod;}
ll add(ll x, ll y){return (x+y)%mod;}
ll sub(ll x, ll y){return (x-y+mod)%mod;}
ll powerk(ll x, ll y)
{
  if(y==0)return 1;
  if(y==1)return x%mod;
  if(y&1)
    return ((powerk((x*x)%mod, y/2)%mod)*x)%mod;
  else return powerk((x*x)%mod,y/2)%mod;
}

// Xorawar

Measured memory_bytes: 3072
a = list(input().split())
l = []
for c in a:
    if c == '+':
        l.append(l.pop() + l.pop())
    elif c == '-':
        l.append((l.pop() - l.pop()) * -1)
    elif c == '*':
        l.append(l.pop() * l.pop())
    else:
        l.append(int(c))
print(l.pop())

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

typedef struct {
    int no;
    int ac;
    int wa[11];
    int pe;
} TEAM;


int main(void)
{
    int T, P, R;
    TEAM team[51], tmp;
    int tid, pid, time;
    char message[10];
    int i, j, k;
    
    
    while (1){
        scanf("%d%d%d", &T, &P, &R);
        if ((T | P | R) == 0){
            break;
        }
        
        memset(team, 0, sizeof(team));
        
        for (i = 1; i <= T; i++){
            team[i].no = i;
        }
        
        for (i = 0; i < R; i++){
            scanf("%d%d%d%s", &tid, &pid, &time, message);
            
            if (message[0] == 'W'){
                team[tid].wa[pid]++;
            }
            else {
                team[tid].ac++;
                team[tid].pe += (1200 * team[tid].wa[pid] + time);
            }
        }
//for (i = 1; i <= T; i++){
//    printf(">%d %d %d\n", team[i].no, team[i].ac, team[i].pe);
//}
        
        for (i = 1; i <= T; i++){
            for (j = 1; j <= T - 1; j++){
                if ((team[j].ac < team[j + 1].ac) ||
                    (team[j].ac == team[j + 1].ac && team[j].pe > team[j + 1].pe) ||
                    (team[j].ac == team[j + 1].ac && team[j].pe == team[j + 1].pe && team[j].no > team[j + 1].no)
                   ){
                    
                    tmp = team[j];
                    team[j] = team[j + 1];
                    team[j + 1] = tmp;
                }
            }
        }
        
        for (i = 1; i <= T; i++){
            printf("%d %d %d\n", team[i].no, team[i].ac, team[i].pe);
        }
    }
    return (0);
}

Measured memory_bytes: 608
#include<bits/stdc++.h>
#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(){
    ll X, K, D;
    cin >> X >> K >> D;
    
    if(abs(X) > abs(K*D)){
        cout << abs(X)-abs((K*D)) << endl;
        return 0;
    }

    K=K-abs((X/D));
    X=abs(X)-abs((X/D)*D);

    if(K%2 == 1) X=abs(X-D);

    ll ans=abs(X);
    cout << ans << endl;
    return 0;
}

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

using namespace std;

const int SGM = 30;

int f[SGM];

int main()
{
    ios_base::sync_with_stdio(NULL);
    cin.tie(0);
    cout.tie(0);
    string s;
    int k;
    cin >> s >> k;
//    ///dp[i][0/1] = primele i, modificam i sau nu
    if (s.size() == 1)
        return cout << k / 2, 0;
    for (int i = 0; i < s.size(); ++i)
        f[s[i] - 'a'] = 1;
    int numdist(0);
    for (int i = 0; i < SGM; ++i)
        if (f[i])
            ++numdist;
    if (numdist == 1)
        return cout << (s.size() * k) / 2, 0;
//    int adaugate(0);
//    int cur(0);
//    while (s[cur] == s.back())
//        s.push_back(s[cur++]), ++adaugate;
//    dp[0][0] = 0;
//    dp[0][1] = 1;
//    for (int i = 1; i < s.size(); ++i) {
//        if (s[i] == s[i - 1]) {
//            dp[i][0] = dp[i - 1][1];
//            dp[i][1] = 1 + min(dp[i - 1][0], dp[i - 1][1]);
//        }
//        else {
//            dp[i][0] = min(dp[i - 1][1], dp[i - 1][0]);
//            dp[i][1] = 1 + dp[i][0];
//        }
//    }
    ///o sa fie pur si simplu pt fiecare secventa de cifre egale ans += l / 2;
    int front_back(0), first(0), last(s.size() - 1);
    char the_one(s[0]);
    bool prob(1);
    if (s[first] != s[last])
        prob = 0;
    else {
        while (s[first] == the_one)
            ++first, ++front_back;
        while (s[last] == the_one)
            --last, ++front_back;
    }
    ///acum calculam shmecheria pe [first, last]
    int imp(0);
    int capat(first);
    for (int i = first; i <= last; ++i) {
        if (i != first && s[i] != s[i - 1]) {
            imp += (i - 1 - capat + 1) / 2;
            capat = i;
        }
    }
    imp += (last - capat + 1) / 2;
    if (prob)
        cout << 1LL * imp * k + first / 2 + (s.size() - last - 1) / 2 + 1LL * front_back / 2 * (k - 1);
    else
        cout << 1LL * imp * k;
    return 0;
}


Measured memory_bytes: 256