akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

void Main()
{
    string s;
    cin >> s;

    if (s == "Sunny")
    {
        cout << "Cloudy" << endl;
    }
    else if (s == "Cloudy")
    {
        cout << "Rainy" << endl;
    }
    else
    {
        cout << "Sunny" << endl;
    }
}

int main()
{
    std::cout << std::fixed << std::setprecision(15);
    Main();
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;

const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 29;
const ll INF64 = 1ll << 45;
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;
  }
};

// h(n, r) = c(n+r-1, r)
struct combination
{
  vector<mint> fact, ifact;
  combination(int n) : fact(n + 1), ifact(n + 1)
  {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i)
    fact[i] = fact[i - 1] * i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i)
    ifact[i - 1] = ifact[i] * i;
  }
  mint operator()(int n, int k)
  {
    if (k < 0 || k > n)
    return 0;
    return fact[n] * ifact[k] * ifact[n - k];
  }
};

int main()
{
  int n;
  ll a, b;
  cin >> n >> a >> b;
  vector<ll> h(n);
  rep(i, n) cin >> h[i];
  ll l = 0, r = 10000000000ll;
  while(r - l > 1ll) {
    ll mid = l+(r-l)/2;
    ll add = 0;
    rep(i, n) {
      if(h[i]-mid*b <= 0) continue;
      else {
        double del = h[i]-mid*b;
        add += (ll)ceil(del/(a-b));
      }
    }
    if(add > mid) l = mid;
    else r = mid;
  }
  cout << r << endl;
}

Measured memory_bytes: 1024
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var n,cnt int
    fmt.Scan(&n)
	
	for i := 1; i <= n; i++ {
		dgt := len(strconv.Itoa(i))
		if dgt % 2 != 0 {
			cnt++
		}
 	}
  fmt.Println(cnt)
}

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

int main() {
  int h, a;
  cin >> h >> a;
  int ans = 0;
  while(true){
      if(h > 0){
          h -= a;
          ans++;
      }else{
          break;
      }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>

#define MOD ((int)(1e9 + 7))

using namespace std;

long long  powMod(int a, int x) {
	if (x == 1) return a;
	long long num = powMod(a, x / 2) % MOD;
	if (x % 2 == 0) {
		return (num * num) % MOD;
	}
	else {
		return (((a * num) % MOD) * num) % MOD;
	}
}

long long combinationMod(int n, int r) {
	long long  nume = 1, deno = 1;
	for (int i = 1; i <= n; i++)
	{
		nume = (nume * i) % MOD;
	}
	for (int i = 1; i <= n - r; i++)
	{
		deno = (deno * i) % MOD;
	}
	for (int i = 1; i <= r; i++) {
		deno = (deno * i) % MOD;
	}
	//フェルマーの小定理を利用して剰余ありコンビネーション計算
	return (nume * powMod(deno, MOD - 2)) % MOD;
}



int main() {
	long long N, M, K;

	cin >> N >> M >> K;

	long long lenx = 0, leny = 0;
	//x方向
	for (int i = 1; i < M; i++)
	{
		lenx += i * (M - i) * N * N;
		lenx %= MOD;
	}
	long long comb = combinationMod(N * M - 2, K - 2);
	lenx = (lenx * comb) % MOD;

	//y方向
	for (int i = 1; i < N; i++)
	{
		leny += i * (N - i) * M * M;
		leny %= MOD;
	}
	leny = (leny * comb) % MOD;

	long long ans = (lenx + leny) % MOD;

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
pub fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

pub fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

pub fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

pub fn read_col<T: std::str::FromStr>(n: u32) -> Vec<T> {
    (0..n).map(|_| read()).collect()
}

use std::cmp::min;

fn main() {
    let v: Vec<u32> = read_vec();
    let shower = v[1];
    let t: Vec<u32> = read_vec();
    let l = t.len();

    let mut w: u32 = shower;

    for i in 0..l - 1 {
        w += min(shower, t[i + 1] - t[i]);
    }

    println!("{}", w);
}


Measured memory_bytes: 8444
#include <bits/stdc++.h>
#include <chrono>
#define watch(x) cout << (#x) << " is " << (x) << endl
#define eps 1e-9

typedef long long ll;

using namespace std;

const int N = 1e5;
int a[N+5];
int freq[3];

int main()

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

    string s;

    cin >> s;

    for (int i = 0; i < 3; i++) freq[s[i]-'a']++;

    if (freq[0] == 1 && freq[1] == 1) cout << "Yes";
    else cout << "No";

    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<map>
#include<cctype>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int m;
    while(cin>>m)
    {
        cout<<24-m+24<<endl;
    }
   return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(x,y) for(lli i=x;i<y;i++)
#define pb push_back
#define mp make_pair
#define bg() begin()
#define en() end()
#define ft first
#define sc second
#define vect_lli_it vector<lli>::iterator
#define set_lli_it set<lli>::iterator
#define inf 1e18
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli k,n;
    cin>>k>>n;
    lli arr[n];
    rep(0,n)
    cin>>arr[i];
    lli max_dis=0;
    rep(0,n-1){
    	max_dis=max(max_dis,abs(arr[i]-arr[i+1]));
	}
	max_dis=max(max_dis,k-arr[n-1]+arr[0]);
	cout<<k-max_dis;
	return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define LLINF 9223372036854775807
#define MOD ll(1e9+7)

ll calculate_gcd(ll a, ll b){
    if(a<b){swap(a,b);}
    if(b<1){return 0;}
    ll r;
    while((r = a%b) != 0){
        a = b;
        b = r;
    }
    return b;
}

ll calculate_lcm(ll a,ll b){
    return a*b/calculate_gcd(a,b);
}

int main() {
    ll n, m;
    string s, t;
    cin >> n >> m;
    cin >> s;
    cin >> t;

    ll lcm = calculate_lcm(n,m);
    bool isOK = true;
    ll L = lcm;
    ll ln = L/n;
    ll lm = L/m;

    int j = 0;
    for(int i = 0; i < n/lm; i++){
        if(s[i*lm] != t[i*ln]){
            cout << "-1" << endl;
            return 0;
        }
    }


    cout << lcm << endl;

    return 0;
}


Measured memory_bytes: 640
#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() {
    int w, h, n;
    cin >> w >> h >> n;

    int xmin = 0, ymin = 0;
    int xmax = w, ymax = h;
    rep(i, n) {
        int x, y, a;
        cin >> x >> y >> a;
        if (a == 1) xmin = max(xmin, x);
        if (a == 2) xmax = min(xmax, x);
        if (a == 3) ymin = max(ymin, y);
        if (a == 4) ymax = min(ymax, y);
    }

    int x = xmax - xmin > 0 ? xmax - xmin : 0;
    int y = ymax - ymin > 0 ? ymax - ymin : 0;
    cout << x * y << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include <vector>
#include <string>
#include <queue>
using namespace std;
long long int ans;
long long int cnt[11][11];

void check( long long int bit, long long int num, long long int m, long long int l ) {
  if ( bit == ( 1 << m ) - 1 ) {
    ans = min( ans, l );
    return;
  }
  for ( long long int i = 0; i < m; i++ ) {
    if ( ( bit & ( 1 << i ) ) == 0 ) {
      check( bit + ( 1 << i ), i, m, l + cnt[num][i] );
    }
  }
  return;
}

int main() {

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

  long long int w, h;

  string input;

  while( cin >> w >> h, w ) {

    vector< long long int > x, y;
    vector< string > map;
    map.push_back( "xxxxxxxxxxxxxxxxxxxxxx" );
    for ( long long int i = 0; i < h; i++ ) {
      cin >> input;
      map.push_back( "x" + input + "x" );
      for ( long long int j = 0; j < w; j++ ) {
	if ( map[i+1][j+1] == 'o' ) {
	  x.push_back( j+1 );
	  y.push_back( i+1 );
	  map[i+1][j+1] = 'a';
	}
      }
    }
    map.push_back( "xxxxxxxxxxxxxxxxxxxxxx" );
    for ( long long int i = 0; i < h+2; i++ ) {
      for ( long long int j = 0; j < w+2; j++ ) {
	if ( map[i][j] == '*' ) {
	  map[i][j] = 'a' + x.size();
	  x.push_back( j );
	  y.push_back( i );
	}
      }
    }
    for ( long long int i = 0; i < x.size(); i++ ) {
      for ( long long int j = 0; j < x.size(); j++ ) { 
	cnt[i][j] = -1;
      }
    }
    for ( long long int i = 0; i < x.size(); i++ ) {
      int flag[22][22] = {0};
      queue<int> qx, qy;
      qx.push( x[i] );
      qy.push( y[i] );
      flag[x[i]][y[i]] = 1;
      while( qx.size() > 0 ) {
	int k = flag[qx.front()][qy.front()];
	for ( long long int j = 0; j < 4; j++ ) {
	  int lx = qx.front() + dx[j];
	  int ly = qy.front() + dy[j];
	  if ( map[ly][lx] != 'x' && flag[lx][ly] == 0 ) {
	    flag[lx][ly] = k + 1;
	    qx.push(lx);
	    qy.push(ly);
	    if ( map[ly][lx] != '.' ) {
	      cnt[i][ map[ly][lx] - 'a' ] = k;
	    }
	  }
	}
	qx.pop();
	qy.pop();
      }
    }
    bool f = false;
    for ( long long int i = 1; i < x.size(); i++ ) {
      if ( cnt[0][i] == -1 ) {
	cout << "-1" << endl;
	f = true;
	break;
      }
    }
    if ( f ) continue;
    ans = 40*11;
    check( 1, 0, x.size(), 0 );
    cout << ans << endl;

  }

  return 0;

}

Measured memory_bytes: 1244
package main

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

var scanner = bufio.NewScanner(os.Stdin)
 
func nextStr()string{
	scanner.Scan()
	return scanner.Text()
}

const MAX=2000

func main(){
	var(
		h,w int
		grid [MAX+2][MAX+2]int
	)
	fmt.Scanln(&h,&w)
	for i:=0;i<h;i++{
		s:=nextStr()
		for j:=0;j<w;j++{
			if s[j]=='#'{
				grid[i+1][j+1]=-1
			}
		}
	}
	for i:=0;i<h+2;i++{
		grid[i][0]=-1
		grid[i][w+1]=-1
	}
	for j:=0;j<w+2;j++{
		grid[0][j]=-1
		grid[h+1][j]=-1			
	}


	for i:=1;i<h+1;i++{
		//left
		for j,cur:=1,1;j<w+1;j++{
			if grid[i][j]!=-1{
				grid[i][j]+=j-cur
			} else {
				cur=j+1
			}
		}
		//right
		for j,cur:=w,w;j>0;j--{
			if grid[i][j]!=-1{
				grid[i][j]+=cur-j
			} else {
				cur=j-1
			}
		}
	}

	
	for j:=1;j<w+1;j++{
		//up
		for i,cur:=1,1;i<h+1;i++{
			if grid[i][j]!=-1{
				grid[i][j]+=i-cur
			} else {
				cur=i+1
			}
		}
		//down
		for i,cur:=h,h;i>0;i--{
			if grid[i][j]!=-1{
				grid[i][j]+=cur-i
			} else {
				cur=i-1
			}
		}		
	}

	max:=0
	for i:=1;i<h+1;i++{
		for j:=1;j<w+1;j++{
			if max<grid[i][j]{
				max=grid[i][j]
			}
		}
	}

	fmt.Println(max+1)
}

Measured memory_bytes: 36096
#include <iostream>
#include <algorithm>

int GCD(int a, int b) {
	if(a < b) {
		std::swap(a, b);
	}
	
	while(a % b != 0) {
		int r = a % b;
		a = b;
		b = r;
	}
	return b;
}

int main() {
	int A, B, C;
	std::cin >> A >> B >> C;

	int gcd = GCD(A, B);

	std::cout << (C % gcd == 0 ? "YES" : "NO") << std::endl;

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
 
#define N 10000
#define true 1
#define false 0
 
int main()
{
  int i,n,k;
  int j=0;
  int array[N];
 
  scanf("%d",&n);
 
  for(i = 0 ; i < n ; i++){
    scanf("%d",&array[i]);
  }
 
  for(i = 0 ; i < n ; i++){
  k = isprime(array[i]); 
  if(k == 1) j++;
  }
 
  printf("%d\n",j);
 
  return 0;
}
 
  int isprime(int x)
  {
    int i = 3;
 
    if(x == 2) return true;
     
    if(x < 2 || x % 2 == 0) return false;
 
    while(i*i <= x){
      if(x % i == 0) return false;
      i+=2;
    }
 
    return true;
  }

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

int n;
int a[300010];

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n;
	for (int i = 1; i <= 3 * n; ++i) cin >> a[i];
	sort(a + 1, a + 3 * n + 1);
	long long ans = 0;
	for (int i = n + 1; i <= 3 * n; i += 2) ans += a[i];
	cout << ans << endl;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N;
    cin >>N;
    vector<int>vec(N);
    for(int i=0;i<N;i++){
        cin >> vec.at(i);
    }
    sort(vec.begin(),vec.end());
    reverse(vec.begin(),vec.end());
      int mass=vec.at(0);
      int count=1;
    for(int i=0;i<N-1;i++){
        if(mass>vec.at(i+1)){
            mass =vec.at(i+1);
            count++;
         }
    }
        cout << count << endl;
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll inf=1e9+7;
const ll mod=1e9+7;
int main(){
    ll x,y;cin>>x>>y;
    if(abs(x-y)==1||x==y)cout<<"Brown";
    else cout<<"Alice"<<endl;
}

Measured memory_bytes: 256
N, M, C = [int(x) for x in input().split(' ')]
B = [float(x) for x in input().split(' ')]
ALIS = []
for i in range(N):
  ta = [float(x) for x in input().split(' ')]
  ALIS.append(ta)
  
ans = 0
for i in range(N):
  s = float(C)
  for a,b in zip(ALIS[i],B):
    s += a*b
  if s > 0:
    ans+=1
  #print(s)
print(ans)

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

int main() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  if(a >= k) {
    cout << k << endl;
    return 0;
  }
  else if(a + b >= k) {
    cout << a << endl;
    return 0;
  }
  // a + b < k cを使う場合になる
  else {
    int max = a + -1*(k - a - b);
    cout << max << endl;
    return 0;
  }
}

Measured memory_bytes: 3552
#include <stdio.h>
#include <math.h>
 
using namespace std;
 
int main(){
    double a,b,c,degree,S;
    scanf("%lf %lf %lf",&a,&b,&degree);
    S = (0.5)*a*b*sin(M_PI*degree/180);
    c = sqrt(a*a+b*b-2*a*b*cos(M_PI*degree/180));
    printf("%.8lf\n",S);
    printf("%.8lf\n",a+b+c);
    printf("%.8lf\n",2*S/a);
}


Measured memory_bytes: 3092
//これではずしたらしばく
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(ll)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define rep2(i,j,n) for(int j=i;j<n;j++)
#define rep3(i,j,n) for(int j=i;j<=n;j++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define sp(n) cout << fixed << setprecision(n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
int main(void){
    int n;cin>>n;
    vector<pair<ll,pair<int,int>>> p(n);
    rep(i,n){
        ll h;int x,y;cin>>x>>y>>h;
        p[i]={h,{x,y}};
    }
    
    rep(i,101)rep(j,101){
        ll H=-1;
        rep(k,n){
            ll h=p[k].first;
            if(h==0)continue;
            int x=p[k].second.first;
            int y=p[k].second.second;
            H=h+abs(x-i)+abs(y-j);
            break;
        }
        bool jud=true;
        rep(k,n){
            ll h=p[k].first;
            int x=p[k].second.first;
            int y=p[k].second.second;
            ll th=max(H-abs(x-i)-abs(y-j),(ll)0);
            if(th!=h){
                jud=false;
                break;
            }
        }
        if(jud){
            cout<<i<<" "<<j<<" "<<H<<endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
// PROXY

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        long k = scan.nextLong();
        long a = scan.nextLong();  
        long b = scan.nextLong();
        long biscuit = 1;
        long yen = 0;
        
        if(b - a < 3){
            for(int i = 1; i <= k; i++){
                biscuit += 1;
            }
        System.out.println(biscuit);
        } else {
            if(k % 2 == 1 && a % 2 == 1){
                for(long i = 1; i <= a; i++ ) biscuit += 1;
                for(long j = 1; j <= (k - a)/2; j++ ) biscuit +=(b-a);
                System.out.println(biscuit);
            } else if(k % 2 == 0 && a % 2 == 0){
                for(long i = 1; i <= a; i++ ) biscuit += 1;
                for(long j = 1; j <= (k - a)/2; j++ ) biscuit +=(b-a);
                System.out.println(biscuit);
            } else if(k % 2 == 1 && a % 2 == 0){
                for(long i = 1; i <= a - 1; i++ ) biscuit += 1;
                for(long j = 1; j <= (k - a + 1)/2; j++) biscuit +=(b-a);
                System.out.println(biscuit);
            } else if(k % 2 == 0 && a % 2 == 1){
                for(long i = 1; i <= a - 1; i++ ) biscuit += 1;
                for(long j = 1; j <= (k - a + 1)/2; j++) biscuit +=(b-a);
                System.out.println(biscuit);
            }
        }
    }
}

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

int main(){
  int n,m;
  int a[100];
  cin>>n>>m;
  for(int i=0;i<n;i++) cin>>a[i];
  for(int i=2;i<=m;i++){
    for(int j=0;j<n-1;j++){
      if(a[j]%i > a[j+1]%i) swap(a[j],a[j+1]);
    }
  }
  for(int i=0;i<n;i++) cout<<a[i]<<endl;

  return 0;
}

Measured memory_bytes: 1164
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <set>
using namespace std;

int main() {
    string sa, sb, sc; cin >> sa >> sb >> sc;

    bool flag = true;
    string tmp = sa.substr(0, 1);

    while(flag) {
        if(tmp == "a" && sa.size() >= 1) {
            tmp = sa.substr(0, 1);
            sa.erase(0, 1);
        } else if(tmp == "b" && sb.size() >= 1) {
            tmp = sb.substr(0, 1);
            sb.erase(0, 1);
        } else if(tmp == "c" && sc.size() >= 1) {
            tmp = sc.substr(0, 1);
            sc.erase(0, 1);
        } else {
            if(tmp == "a") {
              cout << "A" << endl;
            } else if(tmp == "b") {
              cout << "B" << endl;
            } else if(tmp == "c") {
              cout << "C" << endl;
            }
            flag = false;
        }
    }
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
	long long int a,b;
	char op;
	
	scanf("%lld %c %lld",&a,&op,&b);
	
	if(op == '+'){
		printf("%lld",a+b);
	}else{
		printf("%lld",a-b);
	}
	
	return 0;
}

Measured memory_bytes: 128
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Objects;

//import org.junit.Test;

public class Main {
//	@Test
//	public void testName() throws Exception {
//		main(null);
//	}

	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(
				System.in))) {

			new Main().solution(br);
		}
	}

	private void solution(BufferedReader br) throws IOException {
		for (String line = br.readLine(); Objects.nonNull(line); line = br
				.readLine()) {
			// String line = br.readLine();
			String[] strList = line.split(" ", 0);

			int num1 = Integer.parseInt(strList[0]);
			int num2 = Integer.parseInt(strList[1]);

			// char char1 = str.charAt(1);
			// char char2 = str.charAt(3);
			// int num1 = Integer.parseInt("" + char1);
			// int num2 = Integer.parseInt("" + char2);

			if (num1 == 0 && num2 == 0) {
				break;
			} else if (num1 > num2) {
				System.out.println(num2 + " " + num1);
			} else {
				System.out.println(num1 + " " + num2);
			}

		}
	}

}

Measured memory_bytes: 26864
#include<bits/stdc++.h>
using namespace std;
int main(){
  int x,y,p=0;
  cin>>x>>y;
  for(int i=0;i<=y;i++){
    if((i*4)+ abs(x-i)*2 == y){
      p=1;
      break;
    }
  }
  if(p>0) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Measured memory_bytes: 3640
/*
Arthor : Ender_zzm
E-mail zzm_ender_wiggin@outlook.com
Blog oi.ender-zzm.pro
*/
#include <bits/stdc++.h>
using namespace std;

template<class T>
inline void read(T &a) {
    register T x = 0, flag = 1;
    register char ch;
    while (!isdigit(ch = getchar())) if (ch == '-') flag = -1;
    while (x = x * 10 + (ch & 15), isdigit(ch = getchar()));
    a = x * flag;
}

template <class T>
inline void write(T x) {
    if (x < 0)
        putchar('-'), x = -x;
    if(x >= 10) write(x / 10); 
    putchar(x % 10 + '0');
}

template<class T> inline bool Chkmax(T& x, const T& y) { return x < y ? x = y, true : false; }
template<class T> inline bool Chkmin(T& x, const T& y) { return x > y ? x = y, true : false; }

#define For(i, a, b) for (int i = (a); i <= (b); i++) 
#define Rep(i, a, b) for (int i = (a); i >= (b); i--) 
#define For_edge(x) for (int i = head[x]; i; i = net[i])
#define mem0(a) memset(a, 0, sizeof a)

#define int long long
const int Mod = 998244353;
int Pow(int x, int y) {
	int ans = 1;
	while (y) {
		if (y & 1) ans = 1ll * ans * x % Mod;
		x = 1ll * x * x % Mod;
		y >>= 1;
	}
	return ans;
}
int pre[300000];
long long hh(int x, int p) {
	if (x == 1) return p;
	return 1ll * p * Pow(p - 1, x - 1) % Mod;
}
long long C(int x, int y) {
	if (x <= y) return 1;
	return 1ll * pre[x] * Pow(1ll * pre[y] * pre[x - y] % Mod, Mod - 2) % Mod;
}
long long Js(int x, int p) {
	x += p;
	return 1ll * C(x - 1, p - 1)  % Mod;
}
signed main() {
	int n, m, k;
	read(n); read(m); read(k);
	pre[0] = 1;
	For (i, 1, n) {
		pre[i] = 1ll * i * pre[i - 1] % Mod;
	}
	if (n == 1) {
		cout << m << endl;
		return 0;
	}
	int Inv = Pow(m - 1, Mod - 2);
	int ans = 1ll * m * Pow(m - 1, n - 1) % Mod;
	int las = ans;
	For (i, 1, k) {
		ans = (ans + 1ll * hh(n - i, m) * Js(i, n - i)% Mod) % Mod;
	}
	cout << ans;
}


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

int main() {
  int n; cin >> n;
  for(int i = 0; i < n; i++){
    int a;
    cin >> a;
    if(a % 2 == 0){
      if(a % 3 == 0){
        continue;
      }else if(a % 5 == 0){
        continue;
      }else{
        cout << "DENIED";
        return 0;
      }
    }
  }
  cout << "APPROVED";
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <vector> 
#include <math.h> 
#include <algorithm> 
using namespace std;
int main(void){
    int N; cin >> N;
    int i = 0;
    int answer = 0;
    vector<int> a(N);
    while(i < N) {
        cin >> a[i];
        answer += a[i];
        i++;
    }
    cout << answer - N << endl;
}

Measured memory_bytes: 3564
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define P pair<int,int>
#define vp vector<P>
#define PP pair<P,int>
#define vpp vector<PP>
#define fi first
#define se second
#define INF (1<<30)
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(x) (x).begin(),(x).end()
signed main(){
    int q,h,s,d;
    cin>>q>>h>>s>>d;
    int n;
    cin>>n;
    int x=min(s,min(h*2,q*4));
    int y=min(x*2,d);
    cout<<n/2*y+n%2*x<<endl;
    return 0;
}

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

#define rep(i,n) for(int i = 0;i<n;i++)
#define cint(a) int a; cin >> a;
#define cstr(str) string str; cin >> str;


using namespace std;
using ll = long long;

const ll mod = 1e9 + 7;

int main(void) {

	ios::sync_with_stdio(false);
	cin.tie(0);

	cint(n);
	cout << (n + 1) / 2 << endl;





	return 0;
}


Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
int N;
int Height[100];
int memo = -1;
int kai = 0;
int main(){
    cin >> N;
    for(int i=0;i<N;i++){
        cin >> Height[i];
    }
    for(int i=0;i<N;i++){
        if(memo <= Height[i]){
            kai += 1;
            memo = Height[i];
        }
    }
    cout << kai << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    int H,W,i,j,k;
    for(k=0; k<300; k++){
        scanf("%d %d",&H,&W);
        if(H==0 && W==0)
        break;       
        for(j=0; j<H; j++){
            for(i=0; i<W; i++){
                if(j==0 || j==H-1 || i==0 || i==W-1){
                printf("#");
            }else{
                printf(".");}
            }printf("\n");
        }
    printf("\n");
    }
    return 0;
}


Measured memory_bytes: 2048
# import re
# pattarn = re.compile('A|C|G|T')
# S = str(input())
# ans = re.match(pattarn, S)
# print(ans.group())


words = ['A', 'C', 'T', 'G']

S = str(input())

ans = 0
answers = []

for i in range(len(S)):
    if S[i] in words:
        ans += 1
    else:
        answers.append(ans)
        ans = 0

answers.append(ans)

print(max(answers))


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

using namespace std;
int dp[300007][5];
const int INF = 1e9;
signed main() {
	#ifdef LOCAL
		freopen("H_input.txt", "r", stdin);
		//freopen("C_output.txt", "w", stdout);
	#endif
    ios_base::sync_with_stdio(0); cin.tie(0);
    string s;
    cin >> s;
    for (int i=0; i <= s.size(); i++) for (int j=0; j < 5; j++) dp[i][j] = -INF;
    dp[0][0] = 0;
	for (int i=0; i < s.size(); i++){
	    for (int len=1; len <= 4; len++){
	        int last = i+1-len;
	        if (last < 0) continue;
	        for (int was=0; was <= 4; was++){
	        	if (dp[last][was] == -INF) continue;
	        	if (was != len) dp[i+1][len] = max(dp[i+1][len], dp[last][was]+1);
	        	else{
		            string a = "", b = "";
		            for (int e=0; e < was; e++){
		                a += s[i-e];
		                b += s[last-1-e];
		            }
		            if (a==b) continue;
		            dp[i+1][len] = max(dp[i+1][len], dp[last][was]+1);
	       		}
	    	}
		}
	}
	//cout << dp[1][1] << endl;
	int ans=-INF;
  	for (int i=0;i<=4;i++) ans = max(ans, dp[s.size()][i]);
    cout << ans;
}

Measured memory_bytes: 4628
// clang-format off
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#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 rrep(i,n) for(ll i=n-1; i>=0; --i)
#define rrep1(i,n) for(ll i=n; i>0; --i)
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort(all(x))
#define SORT_DESC(x) sort((x).rbegin(),(x).rend())
#define pb push_back
#define mp make_pair
#define coutl cout<<fixed<<setprecision(10)
#define ANS(ans) cout<<ans<<endl
#define END(ans) ANS(ans); return
const ll LINF = (1LL << 62) - 1;
const int INF = (1 << 30) - 1;
template<class T>inline bool chmax(T &a, const T &b){if (a<b){a=b;return 1;}return 0;}
template<class T>inline bool chmin(T &a, const T &b){if (b<a){a=b;return 1;}return 0;}
// clang-format on

vector<vector<ll>> G;
ll dp[100100];

ll rec(ll v) {
  if (dp[v] != -1)
    return dp[v];
  ll ans = 0;
  for (ll nv : G[v]) {
    chmax(ans, rec(nv) + 1);
  }
  return dp[v] = ans;
}

void solve(long long N, long long M, std::vector<long long> x, std::vector<long long> y) {
  G.assign(N, vector<ll>());
  rep(i, M) {
    G[x[i] - 1].pb(y[i] - 1);
  }
  rep(i, N) dp[i] = -1;

  ll ans = 0;
  rep(i, N) chmax(ans, rec(i));
  ANS(ans);
}

// clang-format off
int main() {
  long long N;
  scanf("%lld",&N);
  long long M;
  scanf("%lld",&M);
  std::vector<long long> x(M);
  std::vector<long long> y(M);
  for(int i = 0 ; i < M ; i++){
    scanf("%lld",&x[i]);
    scanf("%lld",&y[i]);
  }
  solve(N, M, std::move(x), std::move(y));
  return 0;
}


Measured memory_bytes: 9600
#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{
   string s;
   cin>>s;
   vector<int > v;
   int i;
    for(i=0;i<s.length();++i)
    {
      if(s[i]=='0'||s[i]=='1')
          v.push_back(s[i]-48);
      
      else
      { if(v.size()>0)
         v.pop_back();
       
        else
           continue;
      }
       
    }
  
   for(i=0;i<v.size();++i)
       cout<<v[i];
          
}

Measured memory_bytes: 256
N = int(input())

x = []
y = []
h = []
for i in range(N):
    a,b,c = map(int, input().split())
    x.append(a)
    y.append(b)
    h.append(c)

for cx in range(101):
    for cy in range(101):
        ch = -1

        for i in range(N):
            if h[i] != 0:
                if ch == -1:
                    ch = abs(cx - x[i]) + abs(cy - y[i]) + h[i]
                else:
                    input_h = abs(cx - x[i]) + abs(cy - y[i]) + h[i]
                    if input_h != ch:
                        ch = -2
                        break
        if ch == -2:
            continue

        for i in range(N):
            if h[i] == 0:
                if ch > (abs(cx - x[i]) + abs(cy - y[i])):
                    ch = -2
        if ch != -2:
            print(cx, cy, ch)


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

using namespace std;

int main(){
    int n,x,y;
    cin >> n >> x >> y;
    vector<int> ans(n+1);

    for(int i=1;i<n;i++){
        for(int k=i+1;k<=n;k++){
           int _min = min(abs(k-i),abs(x-i)+abs(y-k)+1);
           ans[_min]++;
        }
    }

    for(int i=1;i<n;i++){
        cout << ans[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int maxx, minn, a, b;
	cin>>a>>b;
	maxx = max(a, b);
	minn = a + b - maxx;
	cout<<maxx + max(maxx - 1, minn); 
	return 0;
} 

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

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>

const int maxn = 1e5+10;
const int mod = 1e9+7;

using namespace std;

set<int> f[maxn],b[maxn],ts;
vector<set<int>> path;
bool vis[maxn];
int ans[maxn];

void dfs(int cur){
	if(vis[cur])
		return;
	vis[cur]=1;
	for(auto &x:f[cur])
		dfs(x);
	ts.insert(cur);
}

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n,m,k;
	cin>>n>>m>>k;
	for(int i=0,x,y;i<m;++i){
		cin>>x>>y;
		f[x].insert(y);
		f[y].insert(x);
	}
	for(int i=0,x,y;i<k;++i){
		cin>>x>>y;
		b[x].insert(y);
		b[y].insert(x);
	}
	for(int i=1;i<=n;++i){
		if(vis[i]) continue;
		if(!vis[i]){
			ts.clear();
			dfs(i);
		}
		int full = ts.size();
		for(auto x:ts){
			int value = full-f[x].size();
			for(auto v:b[x])
				if(ts.count(v))
					--value;
			ans[x]=value-1;
		}
	}
	for(int i=1;i<=n;++i){
		cout<<ans[i]<<" \n"[i==n];
	}
	return 0;
}

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

using namespace std;

string s;

string parseCypher(int &p);

char parseLetter(int &p)
{
	char ret;
	if(s[p] == '+'){
		p++;
		ret = parseLetter(p);
		if(ret != '?'){
			ret++;
			if(ret > 'Z') ret = 'A';
		}
	}
	else if(s[p] == '-'){
		p++;
		ret = parseLetter(p);
		if(ret != '?'){
			ret--;
			if(ret < 'A') ret = 'Z';
		}
	}
	else{
		ret = s[p];
		p++;
	}
	return ret;
}

string parseString(int &p)
{
	string ret;
	while(1){
		if(s[p] == '#' || s[p] == ']') break;
		if(s[p] == '['){
			p++;
			string t = parseCypher(p);
			reverse(t.begin(), t.end());
			ret += t;
			p++;
		}
		else ret += parseLetter(p);
	}
	return ret;
}

string parseCypher(int &p)
{
	string ret;
	while(1){
		if(s[p] == '#' || s[p] == ']') break;
		ret += parseString(p);
	}
	return ret;
}

int main(void)
{
	while(1){
		cin >> s;
		if(s == ".") break;
		s += "#";
		
		int p = 0;
		string ans = parseCypher(p);
		for(int i = 0; i < ans.size(); i++) if(ans[i] == '?') ans[i] = 'A';
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 3148
//In the name of God

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

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

const int N = 4e2+10 , mod = 1e9+7;

ll dp[N][N] , sm[N][N] , a[N];

int32_t main(){
   ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
   cout << fixed << setprecision(9);
   int n;
   cin >> n;
   for(int i = 0 ; i < n ; i++)
      cin >> a[i];
   for(int len = 1 ; len <= n ; len++){
      for(int i = 0 ; i + len <= n ; i++){
         int j = i + len - 1;
         dp[i][j] = 1ll * mod * mod;
         if(len == 1){
            sm[i][j] = a[i];
            dp[i][j] = 0;
            continue;
         }
         sm[i][j] = sm[i][j - 1] + a[j];
         for(int k = i ; k < j ; k++)
            dp[i][j] = min(dp[i][j] , dp[i][k] + dp[k + 1][j] + sm[i][j]);
      }
   }
   cout << dp[0][n - 1];
   return 0;
}


Measured memory_bytes: 2816
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <cstdint>
#include <sstream>
#include <map>
#include <vector>
#include <queue>
#include <iomanip>

using namespace std;
typedef long long ll;

ll ans, mx, sum, mn = 1e8, cnt;

double a;
int main(){
	ll n,k;
	cin>>n>>k;
	
	for(ll i=1; i<=n; i++){
		ll cnt=i;
		ans=0;
		for(ll j=1; j<k; j++){
			if(cnt>=k){
				break;
			}
			else {
				cnt*=2;
				ans++;
			}
		}
		a +=pow(0.5,ans);		
	}
	double b=a/n;
	cout<<fixed<<setprecision(12)<<b<<endl;
}


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

const double EPS = 1e-8;
const double INF = 1e12;

//point
typedef complex<double> P;
namespace std {
	bool operator < (const P& a, const P& b) {
		return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
	}
}
double cross(const P& a, const P& b) {
	return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
	return real(conj(a)*b);
}
// line
struct L : public vector<P> {
	L(const P& a, const P& b) {
		push_back(a); push_back(b);
	}
};

// polygon
typedef vector<P> G;

P extreme(const vector<P> &po, const L &l) {
  int k = 0;
  for (int i = 1; i < po.size(); ++i)
    if (dot(po[i], l[1]-l[0]) > dot(po[k], l[1]-l[0])) k = i;
  return po[k];
}

enum { OUT, ON, IN };
int contains(const G& po, const P& p) {
  bool in = false;
  for (int i = 0; i < po.size(); ++i) {
  	P a = po[i] - p, b = po[(i+1)%po.size()] - p;
    if (imag(a) > imag(b)) swap(a, b);
    if (imag(a) <= 0 && 0 < imag(b))
      if (cross(a, b) < 0) in = !in;
    if (cross(a, b) == 0 && dot(a, b) <= 0) return ON;
  }
  return in ? IN : OUT;
}

double area2(const G& po) {
	double A = 0;
  	for (int i = 0; i < po.size(); ++i) 
    	A += cross(po[i], po[(i+1)%po.size()]);
	//????????????????????????????????¨????????????
  	return A/2;
}
	
int main() {
	int n;
	cin >> n;
	G po;
	for(int i=0; i<n; ++i) {
		double x, y;
		cin >> x >> y;
		P p(x, y);
		po.push_back(p);
	}
	cout << fixed << setprecision(1) << area2(po) << endl;
	return 0;
}

Measured memory_bytes: 3292
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<limits.h>
#include<math.h>

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))

int main(void){
	long long int a,b,c;
	
	scanf("%lld%lld%lld",&a,&b,&c);

	printf("%.10f\n",(double)(MAX(0,a-2*c)*(c!=0?2:1)+MIN(a,2*c))*(b-1)/a/a);
	
	return 0;
}


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

class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
        self.size = [1 for _ in range(n+1)]
 
    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
 
    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.size[y] += self.size[x]
        else:
            self.par[y] = x
            self.size[x] += self.size[y]
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
 
    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)
    
ki = UnionFind(h*w)

vx = [0,1,0,-1]
vy = [1,0,-1,0]

for i in range(h):
    for j in range(w):
        if si[i][j] == '#':
            #print(i,j,i,j)
            for k in range(4):
                ny = i + vy[k]
                nx = j + vx[k]
                if ny >= 0 and ny < h and nx >= 0 and nx < w:
                    #print(ny,nx)
                    if si[ny][nx] == '.':
                        #print(i,j,ny,nx)
                        #print(ki.same_check(i*w+j,ny*w+nx))
                        if ki.same_check(i*w+j,ny*w+nx) == True:
                            continue
                        #print(i,j,k)
                        ki.union(i*w+j,ny*w+nx)
                        #print(ki.par)
ans = 0
#exit()


#print(ki.size)
#print(ki.par)
li = [0]*(h*w+1)

for i in range(h):
    for j in range(w):
        #print(ki.find(i*w+j),1111111)
        ki.find(i*w+j)
        """
        if si[i][j] == '.':
            li[ki.find(i*w+h)] += 1
            print(ki.find(i*w+h))
        """
#print(ki.par)
for i in range(h):
    for j in range(w):
        if si[i][j] == '.':
            li[ki.par[i*w+j]] += 1
            #print(ki.par[i*w+h],ki.par)
#print(li)
#print(ki.par)

for i in range(h):
    for j in range(w):
        if si[i][j] == '#':
            #print(ki.size[i*w+j])
            #print(i,j)
            #tmp = 
            #print(ki.find(i*w+j))
            ans += li[ki.find(i*w+j)]
            #print(ans,i,j)
            
print(ans)

Measured memory_bytes: 13384
import java.util.*;
public class Main{
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int x = scan.nextInt();
        int count=  x%500;
        int hp=(x/500)*1000;
        hp+=(count/5)*5; 
        System.out.println(hp);
    }
    }


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

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

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int a, b;
    cin >> a >> b;
    cout << max(a-2*b, 0) << endl;
}

Measured memory_bytes: 256
s = input()
ym = False
my = False
if int(s[:2]) > 0 and int(s[:2]) < 13:
  my = True
if int(s[2:]) > 0 and int(s[2:]) < 13:
  ym = True
if ym and my:
  print("AMBIGUOUS")
elif ym:
  print("YYMM")
elif my:
  print("MMYY")
else:
  print("NA")
  

Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <map>
#include <string>

using namespace std;

void solve();

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

void solve() {
    int n;
    int y;
    cin >> n >> y;
    for(int i = 0; i <= n; i++) {
        for(int j = 0; j <= n - i; j++) {
            int tmp = y - 10000 * i - 5000 * j;
            if(tmp / 1000 == n - i - j) {
                cout << i << " " << j << " " << n - i - j << endl;
                return;
            }
        }
    }
    cout << -1 << " " << -1 << " " << -1 << endl;
}

Measured memory_bytes: 256
n,y=map(int,input().split())
for i in range(2001):
	for j in range(2001):
		if (y-(10000*i+5000*j))//1000==n-i-j and n-i-j>=0:
			print(i,j,n-i-j)
			exit()
print(-1,-1,-1)

Measured memory_bytes: 2940
/*

    author : s@if

*/

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

#define 		NIL 			-1
#define		 	fi	 		    first
#define 		sec 			second
#define 		MAX 			INT_MAX
#define			INF 			99999999
#define 		ll 			    long long
#define 		PI 			    acos(-1.0)
#define			MOD 			1000000007
#define 		PLL 			pair<ll,ll>
#define 		PII			    pair<int,int>
#define 		ull 			unsigned long long
#define 		For(i,a,b) 		for(int i=a;i<=(int)b;i++)


inline int in() {int x; scanf("%d", &x); return x; }
bool Check(int N , int pos)	{	return (bool) (N & (1<<pos));}
int Set(int N, int pos) {	return N = N | (1<<pos);}

int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};
int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};
int hr[]={-2,-2,-1,+1,+2,+2,-1,+1};
int hc[]={+1,-1,+2,+2,-1,+1,-2,-2};
int dx[]={+1,-1,+0,+0};
int dy[]={+0,+0,+1,-1};

const int MAXN = (int)1e5+9;

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

    int i,j,k,l,m,n,p,q,x,y,u,v,r,tc,t;

    cin>>n;

    int ara[n+9];

    For(i,1,n)
        cin>>ara[i];

    int ans = 0;

    for(i=1; i<=n; )
    {
        int cnt = 0;

        j = i+1;

        while(j<=n && ara[j]<=ara[j-1])
        {
            cnt++;
            j++;
        }

        i = j;

        ans = max(ans, cnt);
    }

    cout<<ans<<endl;

    return 0;
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)


Measured memory_bytes: 640
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <fstream>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define sz size()
#define endl "\n"
#define print(X) cout << (X) << "\n"
// // #define input(X) getline(cin,X)
static const ll  INF = 1e9+7;
static const ll INFL = 1e18+7;
ll n,m,l, p;
string s,t;
ll d[200010],e[200010],dp[1001][1001];
char field[202][202];

int x = 0,y = 0;

vector<P> get(char c){
	vector<P> ans;
	rep(i,0,n){
		rep(j,0,m){
			if(field[i][j] == c)ans.pb(P{i,j});
		}
	}
	return ans;
}

int calc(vector<P> vec){
	P now;
	int ans = INF;
	rep(i,0,vec.sz){
		P point = vec[i];
		int l = abs(x-point.first)+abs(y-point.second) + 1;
		if(l < ans){
			now = point;
			ans = l;
		}
	}

	x = now.first;
	y = now.second;
	return ans;
}

int solve(){
	int ans = 0;
	rep(i,0,s.sz){
		vector<P> points = get(s[i]);
		ans += calc(points);
	}
	return ans;
}

int main(){
	while(cin >> n >> m, n){
		int ans = 0;
		x = y = 0;

		rep(i,0,n)cin >> field[i];
		cin >> s;
		print(solve());
	}
	return 0;
}


Measured memory_bytes: 3184
/// Containers Start
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
/// C Header Files
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <math.h>
#include <stdio.h>
/// Containers End

using namespace std;

/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF 1e+18
#define MAX_V 100100
/// Math End

/// Extra Start
#define nn '\n'
#define pb push_back
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
/// Extra End

#define rep(i, n) for (int i = 0; i < n; i++)
#define Cini(a)                                                                \
    int a;                                                                     \
    cin >> a;
#define Cinii(a, b)                                                            \
    int a, b;                                                                  \
    cin >> a >> b;
#define Ciniii(a, b, c)                                                        \
    int a, b, c;                                                               \
    cin >> a >> b >> c;
#define Cins(s)                                                                \
    string s;                                                                  \
    cin >> s;
#define Cinss(s1, s2)                                                          \
    string s1, s2;                                                             \
    cin >> s1 >> s2;
#define Cinc(c)                                                                \
    char c;                                                                    \
    cin >> c;
/// Functions End

/// Graph Start
struct edge {
    int from, to;
    long long cost;
};
/// Graph End

/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl;
#define deb3(x, y, z)                                                          \
    cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "   \
         << z << endl;
/// Debug End

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

/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/

/// template



signed main(void) {
    cin.sync_with_stdio(false);
    cin.tie(0);
    Cinii(a,b);
    cout << (double)a/b << nn;

    return 0;
}

Measured memory_bytes: 256
x,y=list(map(int,input().split()))
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=[2]
if(x in a and y in a):
    print('Yes')
elif(x in b and y in b):
    print('Yes')
elif(x in c and y in c):
    print('Yes')
else:
    print('No')


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

int main(int argc,char** argv)
{

	int n, a;
	cin >> n >> a;
	if(n%500 > a){
		cout << "No" << endl;
	}
	else{
		cout << "Yes" << endl;
	}

	return 0;

}


Measured memory_bytes: 256
// I can !

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

#define ll long long
#define pb push_back
#define mp make_pair
#define forn(i,n) for(ll i=0;i<n;i++)
#define fore(i,a,b) for(ll i=a;i<=b;i++)
#define ford(i,n) for(ll i=n-1;i>=0;i--)
#define fi first
#define se second
#define endl "\n"
#define all(a) a.begin(),a.end()
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

const ll maxn=1e6+1,mod=1e9+7;

int main(){

    sync

    string s;
    cin>>s;
    int w = count(all(s),'o');
    if(w+15-s.size()>=8) cout<<"YES";
    else cout<<"NO";
    
    return 0;
}

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

int main() {
	/*int r;
	cin >> r;
	cout << 3 * r * r;*/


	int N, D;
	cin >> N >> D;
	int ans;
	ans = N / (2 * D + 1) + 1;
	if ( N % (2 * D + 1) == 0)ans = N / (2 * D + 1);
	cout << ans;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;


int main(){
	ll x;
	cin>>x;
	ll k = x /11LL*2LL;
	if((x% 11LL)==0);
	else if((x % 11LL) > 6) k += 2;
	else k += 1;
	cout<<k<<endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, x) for (ll i = 0; i < (x); i++)

using namespace std;
typedef long long int ll;


int main(void) {
  ll x, y;
  cin >> x >> y;
  rep(i, x+1) {
    ll j = x - i;
    if (2 * i + 4 * j == y) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3636