akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using intl = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for(intl i = 0; i < (intl)(n); i++)
#define repd(i, n) for(intl i = (intl)(n); i >= 0; i--)
#define repi(i, a, b) for(intl i = (intl)(a); i < (intl)(b); i++)
#define repid(i, a, b) for(intl i = (intl)(a); i >= (intl)(b); i--)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,1,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define alength(a) (sizeof(a) / sizeof(a[0]))
#define cin(i, a) rep(i, alength(a))cin >> a[i]
#define ccin(i, j, a) rep(i, alength(a))rep(j, alength(a[i]))cin >> a[i][j]
#define debug(x) cout << #x << ":" << x << endl
#define rdebug(i,x) rep(i, alength(x))cout << #x << "[" << i << "]:" << x[i] << endl
#define sqrt sqrtl
#define int intl
#define itn intl
#define double ld
#define pb push_back
#define mp make_pair
const intl INF = 1e9;
const intl MOD = 1e9+7;
const ld eps = 1.0e-14;//-9
void fp(bool f){cout << (f ? "Yes" : "No") << endl;}
void fp(bool f, string s, string t){cout << (f ? s : t) << endl;}
intl kai(intl k){
    intl a = 1;
    for(int i = 2; i <= k; i++){
        a *= i;
    }
    return a;
}
intl gcd(intl a, intl b){
    if(!b)return a;
    return gcd(b, a % b);
}
intl lcm(intl a,intl b){
    return a / gcd(a, b) * b;
}
intl digit10(intl a){
    if(!a)return 1;
    intl b = 0;
    while(a){
        a /= 10;
        b++;
    }
    return b;
}
signed main(){
    cout << fixed << setprecision(10);
    intl n;
    cin >> n;
    intl a[5];
    cin(i,a);
    sort(a, a + 5);
    intl ans = 5;
    ans += (n%a[0] ? n/a[0]:n/a[0]-1);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#define WMAX 10000
#define HMAX 10000

//コメントアウトするとdebug()を実行しない
#define DEBUG

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

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

int H,W;
char C[HMAX][WMAX];

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

void solve(){
	for (int i = 0; i < H; ++i)
	{
		for (int j = 0; j < 2; ++j)
		{
			for (int k = 0; k < W; ++k)
			{
				cout << C[i][k];
			}
			cout << "\n";
		}
	}
}


int main(){
	cin >> H >> W;
	for (int i = 0; i < H; ++i)
	{
		for (int j = 0; j < W; ++j)
		{
			cin >> C[i][j];
		}
	}
	solve();
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const double PI2 = 8.0 * atan(1.0);

#define REP(i,n)	for(int i=0;i<(int)n;++i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define FOR(i,s,n)	for(int i=s;i<(int)n;++i)

int main(int argc, char **argv) {
	int h, w;
	cin >> h >> w;
	REP(i, w + 2) cout << '#';
	cout << endl;
	REP(i, h) {
		string a;
		cin >> a;
		cout << '#' << a << '#' << endl;
	}
	REP(i, w + 2) cout << '#';
	return 0;
}


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

#define rep(i, n) for(int i=0; i<(n); ++i)
#define max  200001

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );}
int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;}
int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);}

int main(void){
 
    int n, i;
    
    scanf("%d%d", &n, &i);
    
    printf("%d", n-i+1);
    
    return 0;
}



Measured memory_bytes: 1700
#include<cstdio>

#define MAX 10000
#define NIL -1

struct Node{int parent, left, right;};

Node T[MAX];
int n, D[MAX], H[MAX];

void setDepth(int u, int d){
    if(u==NIL) return;
    D[u] =d;
    setDepth(T[u].left, d+1);
    setDepth(T[u].right, d+1);
}

int setHeight(int u){
    int h1=0, h2=0;
    if(T[u].left !=NIL){
        h1 = setHeight(T[u].left)+1;
    }
     if(T[u].right !=NIL){
        h2 = setHeight(T[u].right)+1;
    }
    return H[u] = (h1>h2 ? h1 : h2);
}

// 接点uの兄弟のノード番号を返す
int getSibling(int u){
    if(T[u].parent == NIL) return NIL;
    if(T[T[u].parent].left != u && T[T[u].parent].left != NIL){
        return T[T[u].parent].left;
    }
    if(T[T[u].parent].right != u && T[T[u].parent].right != NIL){
        return T[T[u].parent].right;
    }
    return NIL;
}

void print(int u){
    printf("node %d: ", u);
    printf("parent = %d, ", T[u].parent);
    printf("sibling = %d, ", getSibling(u));
    
    int deg = 0; //接点の子の数
    if(T[u].left != NIL) deg++;
    if(T[u].right != NIL) deg++;
    printf("degree = %d, ", deg);
    printf("depth = %d, ", D[u]);
    printf("height = %d, ", H[u]);

    if(T[u].parent ==NIL){
        printf("root\n");
    }
    else if(T[u].left == NIL && T[u].right == NIL){
        printf("leaf\n");
    }
    else{
        printf("internal node\n");
    }
}

int main(){
    int v, l,r, root=0;

    scanf("%d", &n);

    for(int i =0; i<n; i++) T[i].parent =NIL;

    for(int i=0; i<n;i++){
        scanf("%d %d %d", &v, &l, &r);
        T[v].left = l;
        T[v].right = r;
        if(l!=NIL) T[l].parent = v; //子の親のノード番号を代入している
        if(r!=NIL) T[r].parent = v;
    }

    for(int i=0; i<n; i++) if(T[i].parent == NIL) root =i;

    setDepth(root, 0);
    setHeight(root);

    for(int i=0; i<n; i++) print(i);
    
    return 0;
}


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

int main()
{
	int h;
	while (cin >> h && h != 0)
	{
		int map[10 + 1][5];
		for (int j = 0; j < 5; j++)
		{
			map[0][j] = -1;
		}
		for (int i = 1; i <= h; i++)
		{
			for (int j = 0; j < 5; j++)
			{
				cin >> map[i][j];
			}
		}
		int ans = 0;

		while (true)
		{
			vector<int> heightIndex;
			for (int i = 1; i <= h; i++)
			{
				if (map[i][2] == -1)continue;
				int left = 2;
				int right = 2;
				int value = map[i][2];
				while (left - 1>= 0 && map[i][left - 1] == value)left--;
				while (right + 1 < 5 && map[i][right + 1] == value)right++;
				int count = (right - left) + 1;
				if (count >= 3)
				{
					for (int k = left; k < right + 1; k++)
					{
						map[i][k] = -1;
					}
					ans += value * ((right - left) + 1);
					heightIndex.push_back(i);
				}
			}

			if (heightIndex.size() == 0)break;

			for (int i = h; i >= 1; i--)
			{
				for (int j = 0; j < 5; j++)
				{
					int k = 0;
					while (k + i <= h && map[i + k][j] == -1)
					{
						map[i + k][j] = map[i + k - 1][j];
						map[i + k - 1][j] = -1;
						k++;
					}
				}
			}
		}
		cout << ans <<endl;
	}
	return 0;
}

Measured memory_bytes: 1216
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::io::{BufWriter, Write};

// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn solve() {
    input!(
        s: String,
    );
    let s: String = s;

    let mut map = BTreeMap::new();
    map.insert("SUN", 7);
    map.insert("MON", 6);
    map.insert("TUE", 5);
    map.insert("WED", 4);
    map.insert("THU", 3);
    map.insert("FRI", 2);
    map.insert("SAT", 1);

    println!("{}", map[s.as_str()]);
}

fn main() {
    let stack_size = 1 << 28;
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


Measured memory_bytes: 8572
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<int,P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define mp1(a,b,c) P1(a,P(b,c))

const int INF=1000000000;
const int dir_4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const int dir_8[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};

const ll M = 1000000007;

int main(){
	ll K,A,B;
	cin >> K >> A >> B;
	
	ll ret = 1;
	ret += min( K , A-1 );
	K -= min( K , A-1 );
	if(B-A >= 2){
		ret += (K/2)*(B-A);
		ret += K%2;
	}
	else ret += K;
	cout << ret << endl;
}


Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>
#include <complex>
#include <cstdint>
#include <tuple>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define MOD 1000000007


int main() {
	LL n, m;
	cin >> n >> m;
	if (n > m)swap(m, n);
	if (n == 1) {
		if (m == 1) {
			cout << 1 << endl;
		}
		else {
			cout << m - 2 << endl;
		}
	}
	else cout << (m - 2)*(n - 2) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector> 
# include <cstdint>
#define FOR(i,l,r) for(int i=(l);i<(r);++i)
#define RFOR(i,l,r) for(int i=(l);i>=(int)(r);i--)
#define rep(i,n)  FOR(i,0,n)
#define rrep(i,n)  RFOR(i,n-1,0)

#define int long long
using namespace std;
const int MX = 1e6;
const int inf = 1e13;
const int mod = 1e9+7;
#define ll long long

signed main() {
  int n;
  string s,t;
  cin >> n >> s >>t;
  int sz = s.length();
  int tz = t.length();
  if(sz+tz<=n) {
      cout << n << endl;
      return 0;
  }
  int ma = 0;
  rrep(i,tz) {
      int ss = sz-1;
      int tmp=0;
      while(i>=0 && ss>=0) {
         // cout << s[ss]<<t[i]<<ss<<" "<<i<<" " << endl;
          if(s[ss]==t[i]) {
              if(i==0) {
                  cout << sz+tz-(sz-ss) << endl;
                return 0;
              }
              ss--;
              tmp++;
          }else {
              if(tmp>0) i++;
              break;
          }
          i--;
      }
      ma=max(tmp,ma);
      //cout << ma << endl;
  }
  cout << sz+tz-ma << endl;
  return 0;
}



Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(false); cin.tie(NULL);

#define endl '\n'
#define D(x) cout << #x << " = " << (x) << endl;

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

  vector<int> v(n);
  for (auto &x : v) cin >> x;

  int ans = v[0];
  for (auto x : v) ans = __gcd(ans, x);
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 640
use proconio::input;
use proconio::marker::Chars;
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused)]
const ALPHA_SMALL: [char; 26] = [
    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
    't', 'u', 'v', 'w', 'x', 'y', 'z',
];
#[allow(unused)]
const ALPHA: [char; 26] = [
    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
    'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
];

fn main() {
    input!(D: usize, T: usize, S: usize);
    if (D + S - 1) / S <= T {
        println!("Yes");
    } else {
        println!("No");
    }
}


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

int main()
{
    ll n,k;
    cin>>n>>k;
    ll ans=1;
    for(int i=0;i<n;i++){
        if(i==0){
            ans*=k;
        }
        else{
            ans*=k-1;
        }
    }
    cout<<ans<<endl;
}


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

int main(void){
    long long a, b;
    int k;
    cin >> a >> b >> k;
    for (int i = a; i <= min(b, a + k - 1);i++)
        cout << i <<endl;
    for (int i = max(b - k + 1, a + k); i <= b;i++)
        cout << i << endl;
}

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

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

typedef long long ll;
typedef long double ld;

const int INF = 1e9;
const ld EPS = 1e-8;

int main(){
  string s, t;
  cin >> s >> t;
  int M = s.length();
  int N = t.length();

  vector<vector<int>> dp(M + 1, vector<int> (N + 1, 0));
  REP(i, M)REP(j, N) {
    if(s[i] == t[j]) {
      dp[i + 1][j + 1] = 1 + dp[i][j];
    }else{
      dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1]);
    }
  }

  string ret = "";
  int y = M, x = N;
  while((y > 0) && (x > 0)) {
    if(dp[y][x] == dp[y - 1][x]) {
      --y;
    }else if(dp[y][x] == dp[y][x - 1]) {
      --x;
    }else{
      --y;
      --x;
      ret += s[y];
    }
  }
  reverse(ALL(ret));
  cout << ret << endl;
  return 0;
}



Measured memory_bytes: 35584
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;

void printToFrom(vector<long long> v1, vector<long long> v2){
    for(int i = 0; i <v2.size(); i++){
        cout << v1[i] << " ";
    }
    cout << endl;
    for(int i = 0; i < v2.size(); i++){
        cout << v2[i] << " ";
    }
    cout << endl;
}

int main(){
    int n; cin >> n;
    vector<int> a(n,0);
    vector<long long> to(n,0);
    vector<long long> from(n,0);
    for(int i = 0; i < n; i++){
        cin >> a[i];
        if(i == 0){
            to[i] = abs(a[i]);
        } else {
            to[i] = to[i-1] + abs(a[i] - a[i-1]);
        }
    }
    for(int i = n-1; i >= 0; i--){
        if(i == n-1){
            from[i] = abs(a[i]);
        } else {
            from[i] = from[i+1] + abs(a[i] - a[i+1]);
        }
    }

    // printToFrom(to,from);

    for(int i = 0; i < n; i++){
        if(i == n-1){
            cout << to[i-1] + abs(a[i-1]) << endl;
            continue;
        }
        if(i == 0){
            cout << abs(a[1]) + from[1] << endl;
            continue;
        }
        cout << to[i-1] + from[i+1] + abs(a[i+1] - a[i-1])<< endl;
    }
}


Measured memory_bytes: 3200
import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int ans = c - (a - b);
		if( ans < 0)ans = 0;
		System.out.println(ans);

	}

}


Measured memory_bytes: 22996
#include <iostream>
#include<math.h>

using namespace std;


int main() {

    long long D, N;

    cin >> D >> N;

//    //
//    if (N == 100) {
//        cout <<  (N + 1) * pow(100 , D) << endl;
//        return 0;
//    }
//
//    cout <<  N * pow(100 , D) << endl;
//


    //
    if( N != 100 )
    {
        cout << ((int)pow(100,D)) * N << endl;
    }
    else
    {
        cout << ((int)pow(100,D))*(N + 1) << endl;

    }


    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<ctime>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<string>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<utility>
#include<iomanip>
#include<map>
#include<vector>
using namespace std;
int read(){
    int xx=0,ff=1;char ch=getchar();
    while(ch>'9'||ch<'0'){if(ch=='-')ff=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){xx=xx*10+ch-'0';ch=getchar();}
    return xx*ff;
}
long long READ(){
    long long xx=0,ff=1;char ch=getchar();
    while(ch>'9'||ch<'0'){if(ch=='-')ff=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){xx=xx*10+ch-'0';ch=getchar();}
    return xx*ff;
}
char one(){
	char ch=getchar();
	while(ch==' '||ch=='\n')
		ch=getchar();
	return ch;
}
int K,X;
int main(){
	//freopen("in","r",stdin);
	K=read(),X=read();
	for(int i=X-K+1;i<X+K-1;i++)
		printf("%d ",i);
	printf("%d\n",X+K-1);
	return 0;
}



Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype

template <class T>
int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

const double EPS = 1e-8;
typedef long long ll;
typedef pair<int, int> pint;


int main()
{
	int W, H;
	int dx[] = { 1, 0, -1, 0 };
	int dy[] = { 0, -1, 0, 1 };
	char* dirs = "ENWS";

	while (scanf("%d%d", &W, &H), W | H)
	{
		char maze[64][64];
		for (int i = 0; i < H; ++i)
			scanf("%s", maze + i);

		int time;
		for (time = 1; time <= 180; ++time)
		{
			int left = 0;
			bool canMove[64][64];
			bool dest[64][64];
			memset(canMove, 0, sizeof(canMove));
			memset(dest, 0, sizeof(dest));
			for (int i = 0; i < H; ++i)
			{
				for (int j = 0; j < W; ++j)
				{
					char* hoge = strchr(dirs, maze[i][j]);
					if (!hoge)
						continue;

					++left;

					int dir = hoge - dirs;
					int next_dir = -1;
					for (int k = -1; k < 3; ++k)
					{
						int d = (dir + k + 4) % 4;
						int tx = j + dx[d];
						int ty = i + dy[d];
						if (tx < 0 || ty < 0 || tx >= W || ty >= H)
							continue;

						char c = maze[ty][tx];
						if (c == '.' || c == 'X')
						{
							next_dir = d;
							break;
						}
					}
					if (next_dir != -1)
					{
						maze[i][j] = dirs[next_dir];
						dest[i+dy[next_dir]][j+dx[next_dir]] = true;
						canMove[i][j] = true;
					}
				}
			}

			for (int i = 0; i < H; ++i)
			{
				for (int j = 0; j < W; ++j)
				{
					if (!dest[i][j])
						continue;

					int k;
					int tx, ty;
					for (k = 0; k < 4; ++k)
					{
						tx = j + dx[k];
						ty = i + dy[k];
						char* pp;
						if (tx >= 0 && ty >= 0 && tx < W && ty < H
							&& (pp = strchr(dirs, maze[i+dy[k]][j+dx[k]])) != NULL
							&& pp - dirs < 4 && maze[ty][tx] == dirs[(k+2)%4]
						&& canMove[ty][tx])
						{
							if (maze[i][j] == '.')
								maze[i][j] = maze[ty][tx];
							else
								--left;
							break;
						}
					}
					maze[ty][tx] = '.';
				}
			}

			if (!left)
				break;
		}
		if (time != 181)
			printf("%d\n", time);
		else
			puts("NA");
	}

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define ll long long
#define p pair<int, int>
using namespace std;

int main() {
    int n;
    cin >> n;
    string s[n];
    for (int i = 0; i < n; i++) cin >> s[i];
    ll ans = 0;
    ll r2 = 0, rA = 0, rB = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < s[i].size() - 1; j++) {
            if (s[i][j] == 'A' && s[i][j + 1] == 'B') ans++;
        }
        if (s[i][0] == 'B' && s[i][s[i].size() - 1] == 'A') {
            r2++;
        } else if (s[i][0] == 'B' && s[i][s[i].size() - 1] != 'A') {
            rB++;
        } else if (s[i][0] != 'B' && s[i][s[i].size() - 1] == 'A') {
            rA++;
        }
    }
    if (r2 >= 1) ans += r2 - 1LL;
    if (r2 >= 1) {
        if (rB >= 1) {
            ans++;
            rB--;
        }
        if (rA >= 1) {
            ans++;
            rA--;
        }
    }
    ans += max(0LL, min(rA, rB));
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 768
from math import *
from fractions import *
a,b,c,d=map(int,input().split())

def lcm(a,b):
    return a * b // gcd(a, b)

def f(a,b,c):
    return (b - a + 1) // c + (1 if b % c <= a % c else 0)

if c != 1 and d != 1:
    print ((b-a+1) - (b // c - ceil(a / c) + 1) - (b // d - ceil(a / d) + 1) + (b // lcm(c, d) - ceil(a / lcm(c, d)) + 1))
else:
    print (0)

Measured memory_bytes: 5048
#include <iostream>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <algorithm>
 
using namespace std;
 
int main() {
	// 入力
    int ABC[3];
    for (int i = 0; i < 3; ++i) cin >> ABC[i];
    int K;
    cin >> K;
    
    sort(ABC, ABC+3, greater<int>());
    for (int i = 0; i < K; ++i) ABC[0] *= 2;
    
 
    int sum = ABC[0] + ABC[1] + ABC[2];
    
	//出力
    cout << sum << endl;
}

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

int main(){
	int x,y,w,h,r;
	cin >> w >> h >> x >> y >> r;
	if((x<=w-r)&&(x>=r)&&(y<=h-r)&&(y>=r )) cout << "Yes" << endl;
	    else cout << "No" << endl;
	return 0;
}


/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/


Measured memory_bytes: 3116
n=int(input())
s=[0+(m=="o") for m in input()]

#o:1,x:0
#Sheep:1,wolf:0
def nxt(a,b,m):
	if a==b:
		return m
	else:
		return 1-m

for a,b in ((1,1),(0,1),(1,0),(0,0)):
	c,d = a,b
	ans = [a,b]
	for i in range(n-2):
		a,b = b,nxt(a,b,s[i+1])
		ans.append(b)
	if nxt(a,b,s[-1])==c and nxt(b,c,s[0])==d:
		for x in ans:
			if x:
				print("S",end="")
			else:
				print("W",end="")
		exit()
print(-1)

Measured memory_bytes: 6152
#include <iostream>
#include <iomanip>

void Multiplication(int n, int m, int in_vector[100], int matrix[100][100], int out_vector[100]) {
	for (int i = 0; i < n; ++i) {
		int sum = 0;
		for (int j = 0; j < m; ++j) {
			sum += matrix[i][j] * in_vector[j];
		}
		out_vector[i] = sum;
	}
}

int main()
{
	int in_vector[100], out_vector[100];
	int matrix[100][100];
	int n, m;
	std::cin >> n >> m;
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < m; ++j) {
			std::cin >> matrix[i][j];
		}
	}
	for (int i = 0; i < m; ++i) {
		std::cin >> in_vector[i];
	}

	Multiplication(n, m, in_vector, matrix, out_vector);

	for (int i = 0; i < n; ++i) {
		std::cout << out_vector[i] << std::endl;
	}
	return 0;
}




Measured memory_bytes: 3120
S=input()

if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
else :
    print(1)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
int main()
 
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	long long int n,m,rem,msize=0;
	cin>>n >>m;
	if(n*2<=m)
	{
		rem=m-n*2;
		if(rem>=4)
		{
			while(rem!=0)
	
		{  
			msize++;
			rem=rem-4;
		}

      	cout<< msize+n;
		}
		else
		{
			cout << n;
		}
	
	}
	else
	
	{
		m=m/2;
		msize=+m;
		cout<<msize;
	}
	
	

}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
using namespace std;
 
int main(){
  string s;
  cin>>s;
  if(s[0]==s[2]){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
 
}

Measured memory_bytes: 256
import warnings


data = 1

i = 0

while (i == 0):
    temp = raw_input().split()

    if (temp[1] == '+'):
        data = int(temp[0]) + int(temp[2])
        print data
    elif (temp[1] == '-'):
        data = int(temp[0]) - int(temp[2])
        print data
    elif (temp[1] == '*'):
        data = int(temp[0]) * int(temp[2])
        print data
    elif (temp[1] == '/'):
        data = int(temp[0]) / int(temp[2])
        print data
    else:
        break

Measured memory_bytes: 4236
//int a = s - '0'; 文字から数字
//小文字から大文字
//transform(a.begin(), a.end(), a.begin(), ::toupper);
//map 全探索
//auto begin = p.begin(), end = p.end();
//for (auto it = begin; it != end; it++) {}
//mapのキー：it->first mapのバリュー：it->second
//大文字判定 isupper(文字) 小文字判定 islower(文字)
//do{}while(next_permutation(ALL(配列)))
//小文字に対応する文字コード：S[i] - 'a'
//文字コード→小文字：(char)(数字+'a')
//グラフの距離:隣接行列で扱う
//bool型　初期値はTrue
//島渡りの問題：中間ノードに着目
//数が大きい時の比較はstring型で行う
//全て0になったか調べたい->0になるたびにcntする
//例外処理は最初にする
//x = p^m + q^n...の約数の個数:(n+1)*(m+1)....
//N!のどの素因数で何回割れるか
//⇔1~Nまでの数がそれぞれどの素因数で何回割り切れるかの和
//パズルの問題->一般化して全探索
//stack<ll> s;
//s.push(要素);s.top();s.pop();
//queue<ll> q;
//q.push(要素);q.front();q.pop();
//同じ作業繰り返す系の問題：収束先を見つける
//過半数：N/2.0で判定
//優先度付きキュー
//priority_queue<
//ll,
//vector<ll>
//> q;
#include <bits/stdc++.h>
#define rep(i,N) for(int i = 0; i < N;i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
#define PI 3.14159265358979323846264338327950L
using namespace std;

//割るやつ
const ll MOD = (pow(10, 9) + 7);

// K進数でのNの桁数
ll dig(ll N, ll K) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= K;
	}
	return dig;
}
// a,bの最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}

//a,bの最小公倍数
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}

//階乗計算
ll f(ll n) {
	if (n == 0 || n == 1) return 1;
	else return (n * f(n - 1));
}

//Nのd桁目の数
ll dignum(ll N, ll d) {
	ll x = pow(10, d);
	N %= x;
	ll y = pow(10, d - 1);
	N /= y;
	return N;
}

//Nをdで何回割れるか
ll divcnt(ll N, ll d) {
	ll ans = 0;
	while (1) {
		if (N%d == 0) {
			ans++;
			N /= d;
		}
		else break;
	}

	return ans;
}

//素数判定
bool prime(ll num) {
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false;
	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2) {
		if (num % i == 0) return false;
	}
	return true;
}

//フィボナッチ数列
vector<ll> memo(pow(10, 6) + 1);
ll fibo(ll n) {
	if (n == 1) return 1;
	else if (n == 2) return 1;
	else if (memo[n] != 0) return memo[n];
	else return memo[n] = fibo(n - 1) + f(n - 2);
}

ll RS(ll N, ll P, ll M) {
	if (P == 0) return 1;
	if (P % 2 == 0) {
		ll t = RS(N, P / 2, M);
		return t * t % M;
	}
	return N * RS(N, P - 1, M);
}

vector<int> IntegerToVector(int bit, int N) {
    vector<int> S;
    for (int i = 0; i < N; ++i) {
        if (bit & (1 << i)) {
            S.push_back(i);
        }
    }
    return S;
}

int main() {
	int x;cin >>x;
	if(x) cout << 0 << endl;
	else cout << 1 << endl;
}	

Measured memory_bytes: 11012
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct Node{
  struct Node *right;
  struct Node *left;
  struct Node *parent;
  int key;
};
typedef struct Node *n;
n root,NIL;

void insert(int);
void inorder(n);
void preorder(n);
n find(n,int);

int main(){
  int num, i, x;
  char a[20];

  scanf("%d", &num);

  for ( i = 0; i < num; i++ ){
    scanf("%s", a);

    if ( a[0] == 'f' ){
      scanf("%d", &x);
      n t = find(root,x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    }
    else if ( a[0] == 'i'){
      scanf("%d", &x);
      insert(x);
    }
    else if ( a[0] == 'p'){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }
  
  return 0;
}

n find(n u,int k){
  while(u!=NIL && k!=u->key){
    if(k < u->key) u = u->left;
    else u = u->right;
  }
  return u;
}

void insert(int k){
  n y = NIL;
  n x = root;
  n z;

  z = malloc(sizeof(struct Node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key) x = x->left;
    else x = x->right;
  }

  z->parent = y;
  if(y == NIL) root = z;
  else{
    if(z->key < y->key) y->left = z;
    else y->right = z;
  }
}

void inorder(n u){
  if(u==NIL) return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}

void preorder(n u){
  if(u==NIL) return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}




Measured memory_bytes: 20472
#include<cstdio>
    #include<algorithm>
    using namespace std;
     
    int n, len;
    int t[111], v[111];
    double ma[111*222*2];
     
    int main() {
    	scanf("%d", &n);
    	len = 0;
    	for(int i=1;i<=n;i++) {
    		scanf("%d", &t[i]);
    		len += t[i]*2;
    	}
    	int it = 0;
    	ma[0] = 0;
    	for(int i=1;i<=n;i++) {
    		scanf("%d", &v[i]);
    		for(int j=0;j<t[i]*2;j++) {
    			it++;
    			ma[it] = min(1.*ma[it-1]+.5, 1.*v[i]);
    		}
    	}
    	it = len;
    	ma[len] = 0;
    	for(int i=n;i>0;i--) {
    		for(int j=0;j<t[i]*2;j++) {
    			it--;
    			ma[it] = min(ma[it], min(1.*ma[it+1]+.5, 1.*v[i]));
    		}
    	}
    	
    	double ans = 0LL;
    	for(int i=1;i<=len;i++)
    		ans += ma[i-1] + ma[i];
    	printf("%.12lf\n", ans/4);
    	
    	return 0;
    }

Measured memory_bytes: 512
#include <iostream> 

using namespace std;


int main() {
    int m[51];
    int f[51];
    int r[51];
    int t = 0;

    for (int x = 0; x < 51 ; x++){
        cin >> m[x] >> f[x] >> r[x];
    if (m[x] == -1 &&f[x] == -1 && r[x] == -1){
        break;
    }
    }

    for (int x = 0; m[x] != -1 || f[x] != -1; x++){
        t = m[x] + f[x];
        if (t < 50){
            if (r[x] >= 50){
                t = 50;
            }
        }

        if (m[x] == -1 || f[x] == -1){
            t = 0;
        }

        if (t >= 80){
            cout << "A" << endl;
        }else if(t >= 65 && t < 80){
            cout << "B" << endl;
        }else if(t >= 50 && t < 65){
            cout << "C" << endl;
        }else if(t >= 30 && t < 50){
            cout << "D" << endl;
        }else if(t < 30){
            cout << "F" << endl;

        }
    }

    return 0;
}



Measured memory_bytes: 3096
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <bitset>
#include <climits>
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define RFOR(i,a,b) for (int i=(a)-1;i>=(b);i--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int INF = 1e9;
const ll LL_INF = 1e18;
const int MOD = 1e9 + 7;

using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a[3];
  REP(i,3) cin >> a[i];
  sort(a, a+ 3);
  bool k = (a[1] - a[0]) & 1;
  int ans = (a[1] - a[0] + 1) / 2 + (a[2] - a[1]) + k;
  cout << ans << endl;
  return 0;
}


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

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

  if((N[0]==N[1]) && (N[1]==N[2])) cout << "Yes" << endl;
  else if((N[3]==N[2]) && (N[2]==N[1])) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0; 
}

Measured memory_bytes: 256
//ABC073A
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <climits>
#include <cfloat>
#include <string>
using namespace std;

int main(){
	int n;
	cin >> n;
	int a = n/10, b = n%10;
	if(a == 9 || b == 9){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	return 0;
}

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

int main() {
  int N, sum;
  cin >> N;
  sum = 0;

  for (int i = 0; i < N; i++) {
    int l, r;
    cin >> l >> r;
    sum += r - l + 1;
  }
  
  cout << sum << endl;
  
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<unordered_map>
#define int long long
#define rep(i,a,n) for (int (i)=(a);(i)<(n);(i)++)
using namespace std;
#define hash hush
typedef long long ll;
typedef long double ld;
int c[100000], n, a, b, ma = 0;
signed  main() {
	cin >> n >> a >> b;
	for (int i = 0; i < n; i++) {
		cin >> c[i];
		ma = max(ma, c[i]);
	}
	ma = ma / b + 10;
	int s = 0, e = ma, t;
	while (e - s > 1) {
		t = (e + s) / 2;
		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += max(0.0,ceil(1.0*(c[i] - t*b) / (a - b)));
		}
		if (sum >= t) {
			s = t;
		}
		if (sum <= t) {
			e = t;
		}
	}
	int ans;
	int sum = 0;
	for (int i = 0; i < n; i++) {
		sum += max(0.0,ceil(1.0*(c[i] - e*b) / (a - b)));
	}
	if (sum <= e)
		ans = e;
	sum = 0;
	for (int i = 0; i < n; i++) {
		sum += max(0.0, ceil(1.0*(c[i] - s*b) / (a - b)));
	}
	if (sum <= s)
		ans = s;
	cout << ans << endl;
	getchar(); getchar();
}

Measured memory_bytes: 1024
x = int(input())
if x <= 599:
    print(8)
elif x <= 799:
    print(7)
elif x <= 999:
    print(6)
elif x <= 1199:
    print(5)
elif x <= 1399:
    print(4)
elif x <= 1599:
    print(3)
elif x <= 1799:
    print(2)
else:
    print(1)

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

int N,A,B,C,l[8];

int f(int n,int a,int b,int c,int mp) {
    if (n==N) {
        if (a>0&&b>0&&c>0)
            return abs(A-a)+abs(B-b)+abs(C-c)+mp;
        return 100000;
    }
    return min(f(n+1,a+l[n],b,c,mp+(a>0?10:0)),min(f(n+1,a,b+l[n],c,mp+(b>0?10:0)),min(f(n+1,a,b,c+l[n],mp+(c>0?10:0)),f(n+1,a,b,c,mp))));
}

int main() {
    cin>>N>>A>>B>>C;
    for (int i=0;i<N;i++)
        cin>>l[i];
    cout<<f(0,0,0,0,0)<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void)


{


 int a,b,c,i,n=0;


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


 for(i=a;i<=b;i++){


    if((c%i)==0){


        n++;


     }


   }


   printf("%d\n",n);


   return 0;


}

Measured memory_bytes: 596
A, B, C, D = map(int, input().split())
# A以上B以下で、CでもDでも割れない数をf(x)とすると
# f(x) = f(B) - f(A - 1)
# B以下で割り切れない数から、A未満の数を引く

# Yで割り切れる数は X // Y
bc = B // C
bd = B // D

# CでもDでも割り切れる数は CとDの最小公倍数
import fractions
# 最小公倍数
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

lcmCD = lcm(C, D)
bcd = B // lcmCD

# A - 1以下の割り切れる数
ac = (A - 1) // C
ad = (A - 1) // D

acd = (A - 1) // lcmCD

# f(B) - f(A - 1)
ans = (B - (bc + bd) + bcd) - ((A - 1) - (ac + ad) + acd)
print(ans)

Measured memory_bytes: 5076
import java.util.*;

public class Main{
	static public void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		String str=sc.next();
		int b=sc.nextInt();
		if(str.equals("+"))System.out.print(a+b);
		else System.out.print(a-b);
		sc.close();
		return;
	}
}

Measured memory_bytes: 35776
#include<stdio.h>
int main(void)
{
    int n,p[10],i,s,tmp;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d",&p[i]);
    for(i=1;i<n;i++)
        if(p[0]<p[i]){
            tmp=p[0]; p[0]=p[i]; p[i]=tmp;
        }
    s=p[0]/2;
    for(i=1;i<n;i++)
        s+=p[i];
    printf("%d\n",s);
    return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;
public class Main {
	static Scanner scan=new Scanner(System.in);
	static int gcd (int a, int b) {return b>0?gcd(b,a%b):a;}
	static long lcm (int a, int b) {return a*b/gcd(a,b);}
	static int max(int a,int b) {return a>b?a:b;}
	static int min(int a,int b) {return a<b?a:b;}
	static long factorial(int i) {return i==1?1:i*factorial(i-1);}
	static int lower_bound(int a[],int key) {
		int low=0,high=a.length;
		while(low<high) {
			int mid=((high-low)/2)+low;
			if(a[mid]<=key)low=mid+1;
			else high=mid;
		}
		return high;
		}
	static int upper_bound(int a[],int key) {
		int low=0,high=a.length;
		while(low<high) {
			int mid=((high-low)/2)+low;
			if(a[mid]<key)low=mid+1;
			else high=mid;
		}
		return high;
		}
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2)if(n%i==0){return false;}
		return true;
	}
	static int upper_division(int a,int b) {
		if(a%b==0) {
			return a/b;
		}
		else {
			return a/b+1;
		}
	}
	static long lupper_division(long a,long b) {
		if(a%b==0) {
			return a/b;
		}
		else {
			return a/b+1;
		}
	}
	static long lmax(long a,long b) {return Math.max(a, b);}
	static long lmin(long a,long b) {return Math.min(a, b);}
	static int[] setArray(int a) {
		int b[]=new int[a];
		for(int i=0;i<a;i++) {
			b[i]=scan.nextInt();
		}
		return b;
	}
	static String reverce(String str) {
		String strr="";
		for(int i=str.length()-1;i>=0;i--) {
			strr+=str.charAt(i);
		}
		return strr;
	}
	public static void main(String[] args) {
		int a=scan.nextInt();
		if(a%2==0) {
			System.out.println((a/2)*(a/2));
		}
		else {
			System.out.println((a/2)*(a/2+1));
		}
	}
}


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

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for( (i)=0 ; (i)<(n) ; (i)++ )
#define rep(i,x,n) for( (i)=(x) ; (i)<(n) ; (i)++ )
#define REV(i,n) for( (i)=(n) ; (i)>=0 ; (i)-- )
#define FORIT(it,x) for( (it)=(x).begin() ; (it)!=(x).end() ; (it)++ )
#define foreach(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define rforeach(it,c) for(__typeof((c).rbegin()) it=(c).rbegin();it!=(c).rend();++it)
#define foreach2d(i, j, v) foreach(i,v) foreach(j,*i)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define SZ(x) ((int)(x).size())
#define MMS(x,n) memset(x,n,sizeof(x))
#define mms(x,n,s) memset(x,n,sizeof(x)*s)
#define pb push_back
#define mp make_pair
#define NX next_permutation
#define UN(x) sort(all(x)),x.erase(unique(all(x)),x.end())
#define CV(x,n) count(all(x),(n))
#define FIND(x,n) find(all(x),(n))-(x).begin()
#define ACC(x) accumulate(all(x),0)
#define PPC(x) __builtin_popcountll(x)
#define LZ(x) __builtin_clz(x)
#define TZ(x) __builtin_ctz(x)
#define mxe(x) *max_element(all(x))
#define mne(x) *min_element(all(x))
#define low(x,i) lower_bound(all(x),i)
#define upp(x,i) upper_bound(all(x),i)
#define NXPOW2(x) (1ll << ((int)log2(x)+1))
#define PR(x) cout << #x << " = " << (x) << endl ;

typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef pair<int, int> pii;

const int OO = (int) 2e9;
const double eps = 1e-9;

const int N = 100005;

int n, k;
int a[N];

int main() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
//	freopen("in.txt", "rt", stdin);
//	freopen("out.txt", "wt", stdout);
#endif
	cin >> n >> k;
	bool ok = 0;
	int p0, p1;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		if (i && a[i] + a[i - 1] >= k) {
			ok = 1;
			p0 = i - 1;
			p1 = i;
		}
	}
	if (!ok) {
		cout << "Impossible\n";
		return 0;
	}
	cout << "Possible\n";
	for (int i = 0; i < p0; i++)
		cout << i + 1 << "\n";
	for (int i = n - 2; i >= p1; i--)
		cout << i + 1 << "\n";
	cout << p0 + 1 << "\n";
	return 0;
}


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

using namespace std;
using ll =long long;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int,int> PII;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
using P = pair<int,int>;
//Write From this Line

int main()
{
	ll x;
	cin >> x;
	for(int i = -200; i < 200; i++){
		for(int j = -200; j < 200; j++){
			if(pow(i,5) - pow(j,5) == x) {
				cout << i <<" " << j << endl;
				return 0;
			}
		}
	}

}


Measured memory_bytes: 4032
// Believe in yourself...
#include<bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define PF push_front
#define POB pop_back
#define POF pop_front
#define F first
#define S second
#define sz(c) (c).size()
#define REP(i,n)  for(ll i=0;i<n;i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=b;i++)
#define FORD(i,a,b) for(ll i=a;i>=b;i--)

#define bit(num,i) ((num>>i)&1)

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

const ll inf=4e18;
const ll maxn=1e5+10;
const ll mod=1e9+7;

#pragma GCC Optimize("Ofast")

int main(){
	ll n,a,b;cin>>n>>a>>b;
	if(((a+b-1)>n)||(n>(a*b))){
		cout<<-1;
		return 0;
	}
	ll x=0;
	for(x=n;x>=0;x--){
		if((x-(x/b)-(x%b!=0))==(n-a))
			break;
	}
	ll kaf=(x/b);
	FOR(i,1,kaf)
		REP(j,b)
			cout<<(i*b-j)<<" ";
	REP(i,(x-(kaf*b)))
		cout<<(x-i)<<" ";
	FOR(i,x+1,n)
		cout<<i<<" ";
}

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

#define int long long
typedef pair<int, int> P;
#define mod 1000000007
#define INF (1LL<<60)
 
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
#define YES puts("YES")
#define Yes puts("Yes")
#define NO  puts("NO")
#define No  puts("No")
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
 
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
 
 
#if 1
//-------------
// DUMPマクロ
// https://www.creativ.xyz/dump-cpp-652/
 
// vector
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    for (T& x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream& operator<<(ostream& os, set<T>& set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&& ... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}
#ifdef DEBUG
#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif
#endif


signed main() {
    string s;
    cin>>s;
   
    if(s.substr(0,4)=="YAKI") Yes;
    else No;
    return 0;
}


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

    long long int n,s;
    cin>>n;
    s=n;
    for(int i=1;i<=sqrt(n);i++)
    {
        if(n%i==0)
        {
            long long int x=n/i;
            long long int d=x+i-2;
            s=min(s,d);
        }
    }
    cout<<s;

}

Measured memory_bytes: 384
#include <stdio.h>
#include <math.h>
int main()
{
    double a, b, c;
    scanf("%lf%lf", &a, &b);
    if(b<2*a) c=b/2;
    else
    {
        c=a+(b-2*a)/4;
    }
    printf("%.0lf\n", floor(c));
    return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#define db double
#define ll long long
#define ev edge[i].v
#define INF 1000000007
#define pir pair<int,int>
#define Rep(i,l,r) for(int i=(l);i<=(r);++i)
#define RepD(i,r,l) for(int i=(r);i>=(l);--i)
#define RepG(i,x) for(int i=head[x];i;i=edge[i].next)
using namespace std;

const int N=1e5+5;

ll x[N];

int main(){
	//freopen("test.in","r",stdin);
	//freopen("test.out","w",stdout);
	ll n,l,t,w,num=0;
	scanf("%lld%lld%lld",&n,&l,&t);
    Rep(i,1,n){
        scanf("%lld%lld",&x[i],&w);
        x[i]+=w==1?t:-t;
		num+=x[i]/l-(x[i]%l<0);
        x[i]=(x[i]%l+l)%l;
    }
    sort(x+1,x+n+1);
    num=(num%n+n)%n;
    Rep(i,num+1,n) printf("%lld\n",x[i]);
    Rep(i,1,num) printf("%lld\n",x[i]);
	return 0;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int N,l[]={11,31,41,61,71,101,131,151,181,191,211,241,251,271,281,311,331,401,421,431,461,491,521,541,571,601,631,641,661,691,701,751,811,821,911,941,971,1021,1031,1051,1061,1091,1151,1171,1181,1201,1231,1291,1301,1321,1361,1381,1451,1471,1481};
    cin >> N;
    for(int i = 0; i < N; i++) {
        cout << l[i];
        if(i != N-1) {
            cout <<  ' ';
        }
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**9)

N = int(input())
G = [[] for _ in range(N)]
for i in range(N-1):
  a, b = map(int,input().split())
  a, b = a-1, b-1
  G[a].append([b, i])

ans = [None]*(N-1)
def dfs(now, color):
  cnt = 1
  for to, j in G[now]:
    if cnt == color:
      cnt += 1
    ans[j] = cnt
    dfs(to, cnt)
    cnt += 1
dfs(0, 0)
print(max(ans))
print(*ans, sep="\n")

Measured memory_bytes: 71032
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    int a[5];
    for(int i=0;i<5;i++) {
    	cin >> a[i];
    	if(a[i] != i+1){
    		cout << i+1 << endl;
    	}
    }
    return 0;
}


Measured memory_bytes: 3628