akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define eee(a) (cerr << (#a) << ": " << (a) << endl);


using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using mint = map<int, int>;

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

const char sp = ' ';
const char cmm = ',';
const int MOD = 1e9+7;
const int INF = 1e9;
const ll LINF = 1e18;

ll mod(ll a, ll b){
    return (a%b+b)%b;
}
ll gcd(ll a, ll b){
    return b ? gcd(b, a%b) : a;
}
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}
void Yes(){
    cout << "Yes" << endl;
}
void No(){
    cout << "No" << endl;
}
void Judge(bool b){
    b ? Yes() : No();
}
void YES(){
    cout << "YES" << endl;
}
void NO(){
    cout << "NO" << endl;
}
void JUDGE(bool b){
    b ? YES() : NO();
}
ll powmod(ll b, ll e){
    ll r = 1; while(e > 0) {if(e&1) r = (r%MOD)*(b%MOD)%MOD; b = (b%MOD)*(b%MOD)%MOD; e >>= 1;} return r;
}
double distance(ll x1, ll y1, ll x2, ll y2){
    return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
}

template<class T>bool chmax(T &a, const T &b) {
    if(a < b) { a = b; return 1; } return 0;
}
template<class T>bool chmin(T &a, const T &b) {
    if(b < a) { a = b; return 1; } return 0;
}
template<typename T>
void ppp(T n){
    cout << n << endl;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {
    return s << "(" << p.first << ", " << p.second << ")";
}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
    int len = v.size();
    s << '[';
    for(int i = 0; i < len; ++i) {
        s << v[i]; if(i < len-1) s << ", ";
    }
    s << ']';
    return s;
}

struct aaa {
    aaa(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);
    }
} fastio;

int main(){

    int a, b;
    cin >> a >> b;
    ppp((a+b)%24);

    return 0;
}


Measured memory_bytes: 256
#[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)*}
    };
}

#[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, usize1) => {
        read_value!($next, usize) - 1
    };

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

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
      n: usize,
      aa: [i64; n],
    }

    let mut ans1 = 0;
    {
        let mut sum = 0;
        for i in 0..n {
            let sign = i % 2 == 0;
            sum += aa[i];
            if sign {
                if sum <= 0 {
                    ans1 += -sum + 1;
                    sum = 1;
                }
            } else {
                if sum >= 0 {
                    ans1 += sum + 1;
                    sum = -1;
                }
            }
        }
    }

    let mut ans2 = 0;
    {
        let mut sum = 0;
        for i in 0..n {
            let sign = i % 2 == 1;
            sum += aa[i];
            if sign {
                if sum <= 0 {
                    ans2 += -sum + 1;
                    sum = 1;
                }
            } else {
                if sum >= 0 {
                    ans2 += sum + 1;
                    sum = -1;
                }
            }
        }
    }
    println!("{}", min(ans1, ans2));
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin >> s;
    if(s[0]=='a'||s[0]=='i'||s[0]=='u'||s[0]=='e'||s[0]=='o') puts("vowel");
    else puts("consonant");
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<unordered_set>
#include<unordered_map>
using namespace std;
typedef long long ll;
#define chmax(a,b) a=max(a,b)
#define chmin(a,b) a=min(a,b)
#define all(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
#define mad(a,b) a=(a+b)%mod
#define N 200010

int main(){
    ll a,b;
    cin>>a>>b;
    if(a>b)swap(a,b);
    rep(i,b)cout<<a; cout<<endl;
}




Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;


public class C
{
	public static void Main()
	{
		string[] args = Console.ReadLine().Split(' ');
		long X = Int64.Parse(args[0]);
		long Y = Int64.Parse(args[1]);

		int n = 0;
		long A = X;
		do
		{
			n++;
			A <<= 1;
		}while(A <= Y);

		Console.WriteLine(n);
	}	
}





Measured memory_bytes: 13140
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define PI acos(-1)
typedef  long long ll;
ll gcd(ll x,ll y){
   if(y==0) return x;
   else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
   return x/gcd(x,y)*y;
}
using namespace std;

int main(){
 ll n;
 cin>>n;
 vector<ll> a(n);
 vector<ll> co(1000000,0);
 ll ans=0;

 rep(i,n){
    cin>>a[i];
   
    ans+=a[i];
    co[a[i]-1]++;
 }

 ll q;
 cin>>q;

 rep(i,q){
    ll b,c;
    cin>>b>>c;

    ll x=co[b-1];
    ans+=(c-b)*x;
    co[b-1]=0;

    co[c-1]+=x;
    cout<<ans<<endl;

 }
 
  


  
 

return 0;
}


Measured memory_bytes: 11948
#include<stdio.h>
#include<math.h>
#include <stdlib.h>

int main()
{
	int pattern[24][7] = {
	{ 0,1,2,3,4,5,6 },{ 0,1,3,5,2,4,6 },{ 0,1,4,2,5,3,6 },{ 0,1,5,4,3,2,6 },
	{ 0,2,6,3,4,1,5 },{ 0,2,3,1,6,4,5 },{ 0,2,1,4,3,6,5 },{ 0,2,4,6,1,3,5 },
	{ 0,3,1,2,5,6,4 },{ 0,3,2,6,1,5,4 },{ 0,3,5,1,6,2,4 },{ 0,3,6,5,2,1,4 },
	{ 0,4,1,5,2,6,3 },{ 0,4,2,1,6,5,3 },{ 0,4,5,6,1,2,3 },{ 0,4,6,2,5,1,3 },
	{ 0,5,1,3,4,6,2 },{ 0,5,3,6,1,4,2 },{ 0,5,4,1,6,3,2 },{ 0,5,6,4,3,1,2 },
	{ 0,6,2,4,3,5,1 },{ 0,6,3,2,5,4,1 },{ 0,6,5,3,4,2,1 },{ 0,6,4,5,2,3,1 } };
	int diceA[7];
	int i, j, break_flag;
	int a[7], b[7], diceB[7];
	
	break_flag = 0;

	for (i = 1; i < 7; i++) 
	{
		scanf("%d", &diceA[i]);
	}
	
	for (i = 1; i < 7; i++) 
	{
		scanf("%d", &a[i]);
	}
	
	for (j = 0; j < 24; j++) 
	{
		for (i = 1; i < 7; i++) 
		{
			diceB[i] = pattern[j][i];
		}
		for (i = 1; i < 7; i++) 
		{
			b[i] = diceA[diceB[i]];
		}
		
		for (i = 1; ; i++)
		{
			if (i > 6)
			{
				printf("Yes\n");
				return 0;
			}
			if (a[i] != b[i])
			{
				break;
			}
		}
	}
	
	//printf("%d %d %d %d %d %d\n",a[1],a[2],a[3],a[4],a[5],a[6]);
	//printf("%d %d %d %d %d %d\n",b[1],b[2],b[3],b[4],b[5],b[6]);
	
	printf("No\n");
	
	return 0;
}


Measured memory_bytes: 2100
ABC = list(map(int, input().split()))
ABC = sorted(ABC)[::-1]

diff1 = ABC[0]-ABC[1]
diff2 = ABC[1]-ABC[2]

cnt2 = 0

if diff2 % 2 ==0:
  cnt2 = diff2 /2
else:
  cnt2 = 2 + diff2 /2

ans = int(diff1 + cnt2)
print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<queue>
#include<string.h>
using namespace std;
char map[1005][1005];
char map1[1005][1005];
int a[1005][1005];
int m,n,q,num=0;
int main()
{
	int x,y;
	cin>>m>>n>>q;
	for(int i=0;i<m;i++)
	{
		for(int j=0;j<n;j++)
		{
			cin>>map[i][j];
			if(map[i][j]=='S')
				{
					x=i;
					y=j;
				 map[x][y]='0';
				}
		}
	}
	for(int i=0;i<m;i++)
		{
			for(int j=0;j<n;j++)
			{
				map1[i][j]=map[i][j];

			}
		}

	for(int k=1;k<=q;k++)
	{
			queue<int> ac;
			queue<int> ak;

		for(int i=0;i<m;i++)
		{
			for(int j=0;j<n;j++)
			{
				map[i][j]=map1[i][j];
				if(map1[i][j]-'0'==k-1)
				{
					x=i;
					y=j;
					map[x][y]='X';
				}
			}
		}
		memset(a,0,sizeof(a));
		ac.push(x);
		ak.push(y);
		while(!ac.empty())
		{
			x=ac.front();
			y=ak.front();
			ac.pop();
			ak.pop();
			if(x+1<m)
			{
				if(map[x+1][y]!='X')
				{
					if(map[x+1][y]-'0'==k)
					{
						num+=a[x][y];
						num+=1;
						break;
					}
						map[x+1][y]='X';
						ac.push(x+1);
						ak.push(y);
						a[x+1][y]=a[x][y]+1;
				}
			}
				if(x-1>=0)
				{
					if(map[x-1][y]!='X')
					{

						if(map[x-1][y]-'0'==k)
						{
							num+=a[x][y]+1;
							break;
						}
						map[x-1][y]='X';
						ac.push(x-1);
						ak.push(y);
						a[x-1][y]=a[x][y]+1;
					}
				}
			if(y+1<n)
			{
				if(map[x][y+1]!='X')
				{

					if(map[x][y+1]-'0'==k)
					{
						num+=a[x][y]+1;
						break;
					}

						map[x][y+1]='X';
						ac.push(x);
						ak.push(y+1);
						a[x][y+1]=a[x][y]+1;
				}
			}
			if(y-1>=0)
			{
				if(map[x][y-1]!='X')
				{

					if(map[x][y-1]-'0'==k)
					{
						num+=a[x][y]+1;
						break;
					}

						map[x][y-1]='X';
						ac.push(x);
						ak.push(y-1);
						a[x][y-1]=a[x][y]+1;
				}
			}
		}
	}
	cout<<num<<endl;
	return 0;
}



Measured memory_bytes: 9076
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fast() ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")

int main()
{
	int N, ans = 0;
	cin >> N;
	vector<int> h(N);
	for (int i = 0; i < N; i++)
	{
		cin >> h[i];
	}

	ans = h[0];

	for (int i = 1; i < N; i++)
	{
		if (h[i - 1] < h[i])
			ans += h[i] - h[i - 1];
	}

	cout << ans << "\n";
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
//bool c[22][22] = {};
int cnt,w, h, p[22][22] = {};

int main() {
	int j, f,cx,cy;
	char in[21];
	while (1) {
		for (int i = 0; i < 484; i++) {
			p[i / 22][i % 22] = 0;
		}
		cnt = 0;
		f = 1;
		scanf("%d %d", &w, &h);
		if (w ==0&& h == 0)
			break;
		scanf("\n", &j);
		for (int i = 0; i < h; i++) {
			scanf("%s", &in);
			for (j = 0; j < w; j++) {
				switch (in[j]) {
				case '#':
//					c[j+1][i+1] = 0;
					p[j+1][i+1] = -1;
					break;
				case '@':
					cx = j;
					cy = i;
					p[j+1][i+1] = 1;
//				case '.':
//					c[j+1][i+1] = 1;
				}
			}
		}

		/*for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++)
				printf("%3d", c[j][i]);
			printf("\n");
		}*/

		while (f == 1) {
			f = 0;
		/*	for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++)
					printf("%3d", p[j+1][i+1]);
				printf("\n");
			}
			printf("\n");
*/			//if (w != 1 && h != 1) {
				for (int i = 0; i < w*h; i++) {
					if (p[i / h+1][i%h+1] == 0 && (p[i / h + 2][i % h+1] == 1 || p[i / h][i % h+1] == 1 || p[i / h+1][i % h + 2] == 1 || p[i / h+1][i % h] == 1)) {
						p[i / h+1][i%h+1] = 1;
						f = 1;
					}
				}
			//}
			/*if (w == 1 && h != 1) {
				for (int i = 0; i < h; i++) {
					if (p[1][i+1] == 0 && (p[1][i + 2] == 1 || p[0][i] == 1)) {
						p[1][i+1] = 1;
						f = 1;
						printf("a");
					}
				}
			}

			if (w != 1 && h == 1) {
				for (int i = 0; i < w; i++) {
					if (p[i+1][1] == 0 && (p[i + 2][1] == 1 || p[i][1] == 1)) {
						p[i+1][1] = 1;
						f = 1;
					}
				}
			}*/
		}

		for (int i = 0; i < w*h; i++) {
			if (p[i / h+1][i%h+1] == 1)
				cnt++;
		}
		printf("%d\n", cnt);
	}
	return 0;
}



Measured memory_bytes: 2576
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
#include <cmath>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define int long long
#define P pair<int,int>
#define all(vec) vec.begin(),vec.end()

int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}

int t, a, b, c, d;

signed main() {
	cin >> t;
	for (int i = 0; i < t; i++) {
		cin >> a >> b >> c >> d;
		if (a < b || d < b) {
			cout << "No" << endl;
			continue;
		}
		if (b <= c + 1) {
			cout << "Yes" << endl;
			continue;
		}
		if (c < a%b) {
			cout << "No" << endl;
			continue;
		}
		int x = gcd(b, d);
		int s = b - x + a % x;
		if (c < s)cout << "No" << endl;
		else cout << "Yes" << endl;
	}
}

Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

fn main() {
    input! {
        s: chars
    }
    let c0 = s.iter().filter(|x| **x == '0').count();
    let c1 = s.iter().filter(|x| **x == '1').count();
    println!("{}", 2 * std::cmp::min(c0,c1));
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
const int MOD = 1e18;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
const int N=1e5+3;
int a[555];
int n,k;
bool chk(int mid)
{
            int cnt=0;
            int an=0;
            for(int i=0;i<n;i++)
            {
                  int o=a[i]/mid;
                  cnt+=-(a[i]-o*mid);
            }
            if(abs(cnt)%mid==0)
            {
                  int ff=abs(cnt)/mid;
                  vector<int> ooo;
                  for(int i=0;i<n;i++)
                  {
                        ooo.pb(((a[i]/mid+1)*mid-a[i]));
                  }
                  sort(all(ooo));
                  for(int i=0;i<n&&ff;i++)
                  {
                        an+=ooo[i];
                        ff--;
                  }
                        if(an<=k)
                        {
                              return true;
                        }
                        else return false;
            }
            else{
                  return false;
            }
}
int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);

      cin>>n>>k;
      int s=0;
      for(int i=0;i<n;i++) cin>>a[i],s+=a[i];
      int lo=1,high=1e18;
      int ans=-1;
      for(int i=1;i*i<=s;i++)
      {
            if(s%i) continue;
            if(chk(i)) ans=max(ans,i);
            if(chk(s/i)) ans=max(ans,s/i);
      }
      cout<<ans;
}
// I never lose. I either win or I learn


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>

using namespace std;

template <typename T>
static inline void ArrayInput(vector<T>& A) {
  for (auto itr = A.begin(); itr < A.end(); ++itr) cin >> *itr;
}

template <typename T>
static inline void ArrayPut(const vector<T>& A) {
  for (auto itr = A.begin(); itr < A.end(); ++itr) cout << *itr << " ";
  cout << endl;
}

int main() {
  uint64_t N;
  cin >> N;
  uint64_t res = (N * (N - 1) * (N - 2) / 6);
  vector<uint32_t> L(N), SumL(N * (N - 1) / 2);
  ArrayInput(L);
  sort(L.begin(), L.end());
  uint32_t cnt = 0;
  for (uint32_t i = 0; i < N - 1; ++i) {
    for (uint32_t j = i + 1; j < N; ++j) {
      SumL[cnt] = L[i] + L[j];
      ++cnt;
    }
  }
  sort(SumL.begin(), SumL.end());
  for (uint32_t i = 0; i < N; ++i) {
    cnt = 0;
    for (auto itr = SumL.begin(); itr != SumL.end(); ++itr) {
      if (*itr <= L[i]) {
        ++cnt;
      } else {
        res -= cnt;
        break;
      }
    }
  }

  cout << res;

  return 0;
}


Measured memory_bytes: 8064
#include <bits/stdc++.h>
#define _CRT_SECURE_NO_WARNINGS
#define ll long long
#define BUF 50
using namespace std;
ll MOD = 1e9 + 7;
ll A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S;
ll ans = 0;
int main() {
	cin >> N;
	vector<int>a(N);
	for (int i = 0; i < N; i++) {
		cin >> a[i];
	}
	sort(a.rbegin(), a.rend());
	for (int i = 0; i < N; i++) {
		if (i & 1)B += a[i];
		else A += a[i];
	}
	cout << A - B << endl;
}

Measured memory_bytes: 256
class UnionFind():
    # 作りたい要素数nで初期化
    # 使用するインスタンス変数の初期化
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
    # ノードxのrootノードを見つける
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def unite(self, x, y):
    # 木の併合、入力は併合したい各ノード⇒(a,b)
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
    # ノードxが属する木のサイズを返す
        return -self.parents[self.find(x)]

    def same(self, x, y):
    # 入力ノード(x,y)が同じグループに属するかを返す
        return self.find(x) == self.find(y)

    def members(self, x):
    #ノードxが属するメンバーをリスト形式で返す
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
    #親全てをリスト形式で返す
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
    #グループ数の合計を返す
        return len(self.roots())

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

n,m=map(int,input().split())
u=UnionFind(n)
for i in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    u.unite(a,b)
print(u.group_count()-1)

Measured memory_bytes: 12928
use std::io::*;
use std::str::FromStr;
 
pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}
 
use std::collections::BinaryHeap;

fn main() {
    let n = read::<usize>();
    let m = read::<usize>();
    let mut a = BinaryHeap::new();
    let mut sum = 0;
 
    for i in 0..n {
        let tmp = read::<usize>();
        a.push(tmp);
        sum += tmp;
    }
 
    for _i in 0..m {
        let tmp = a.pop().unwrap();
        sum -= (tmp-tmp/2);
        a.push(tmp/2);
    }
 
    println!("{}",  sum);
}

Measured memory_bytes: 4352
import numpy as np

# 盤面の受け取り
H,W = map(int,input().split())
board = [[] for _ in range(H)]
for i in range(H):
    board[i] = list(input())

board = np.array(board)

minnum = W
maxnum = 0
for row in board[::-1]:
    S = "".join(row)
    left = S.find("#")
    right = len(S) - 1 - S[::-1].find("#")
    if right > minnum:
        print("Impossible")
        exit()
    minnum = left
    maxnum = right

board = board.T

minnum = H
maxnum = 0
for row in board[::-1]:
    S = "".join(row)
    left = S.find("#")
    right = len(S) - 1 - S[::-1].find("#")
    if right > minnum:
        print("Impossible")
        exit()
    minnum = left
    maxnum = right

print("Possible")


Measured memory_bytes: 12512
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("3");
            WillReturn.Add("acornistnt");
            WillReturn.Add("peanutbomb");
            WillReturn.Add("constraint");
            //1
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("2");
            WillReturn.Add("oneplustwo");
            WillReturn.Add("ninemodsix");
            //0
        }
        else if (InputPattern == "Input3") {
            WillReturn.Add("5");
            WillReturn.Add("abaaaaaaaa");
            WillReturn.Add("oneplustwo");
            WillReturn.Add("aaaaaaaaba");
            WillReturn.Add("twoplusone");
            WillReturn.Add("aaaabaaaaa");
            //4
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();

        var SDict = new Dictionary<string, int>();
        for (int I = 1; I <= InputList.Count - 1; I++) {
            char[] wkArr = InputList[I].ToCharArray();
            Array.Sort(wkArr);
            string SortedStr = new string(wkArr);

            if (SDict.ContainsKey(SortedStr)) {
                SDict[SortedStr]++;
            }
            else {
                SDict[SortedStr] = 1;
            }
        }
        int MaxCnt = SDict.Values.Max();

        //三角数の値を求める
        var SankakuDict = new Dictionary<int, long>();
        long SankakuSum = 0;
        for (int I = 1; I <= MaxCnt; I++) {
            SankakuSum += I;
            SankakuDict[I] = SankakuSum;
        }

        long Answer = 0;
        foreach (var EachPair in SDict) {
            if (EachPair.Value == 1) continue;
            Answer += SankakuDict[EachPair.Value - 1];
        }
        Console.WriteLine(Answer);
    }
}


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

int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  vector<ll> times(n,0);
  
  for(ll i=n-2;i>=0;i--){
    if(a[i]>=a[i+1]){
      times[i] = times[i+1]+1;
    }else{
      times[i] = 0;
    }
  }
  
  ll ans=-1;
  rep(i,n){
    ans = max(ans,times[i]);
  }
  
  cout << ans << endl;
  
  return(0);
}

Measured memory_bytes: 4840
#include <bits/stdc++.h>
#define rep3(i, s, n, a) for (int i = (s); i < (int)(n); i += a)
#define rep2(i, s, n) rep3(i, s, n, 1)
#define rep(i, n) rep2(i, 0, n)

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

int main(){
    int n;
    cin >> n;
    vector<ll> a;
    rep(i, n){
        ll num;
        cin >> num;
        a.push_back(num);
    }
    sort(a.begin(), a.end());
    ll sum=0;
    sum += a[n-1];
    for(int i=2;i<n;i+=2){
        if(i+1<n){
            sum+=a[n-1-i/2] * 2LL;
        }else{
            sum += a[n-1-i/2];
        }
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 5308
from sys import stdin
n,m = map(int,stdin.readline().rstrip().split())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
li = make_divisors(m)
point = m
for i in range(1,len(li)):
    if m//li[i] < n:
        point = li[i-1]
        break
print(point)

Measured memory_bytes: 3064
import java.io.*;
import java.util.*;
public class Main {
  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String line = br.readLine();
    int len = line.length();
    System.out.println(line.substring(0, 1) + (len - 2) + line.substring(len - 1));
  }
}

Measured memory_bytes: 22612
#include <bits/stdc++.h>
using namespace std;
using lint     = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    if (s.size() % 2 == 0) {
        string t = "hi";
        string u = "hi";
        while (u.size() != s.size())
            u += t;
        if (s == u) {
            cout << "Yes"
                 << "\n";
            return 0;
        }
    }
    cout << "No"
         << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define rep(i, n) for(int i=0; i<(int)(n); i++)

int N, K, T, U, V, L, D[500];

int main() {
    scanf("%d%d%d%d%d%d", &N, &K, &T, &U, &V, &L);
    rep(i, N) scanf("%d", D+i);
    D[N++] = L;
    const int Z = T*V;
    int uL=0, vL=0, h=0, e=0, p=0;
    rep(i, N) {
        if(e>=D[i]) vL += D[i]-p;
        else {
            vL += e-p;
            uL += D[i]-e;
        }
        p = D[i];
        if(i==N-1) break;
        if(h<K) h++;
        else e = D[i]+Z;
        if(e<D[i]) e = D[i];
        while(h && e<D[i+1]) {
            e += Z;
            h--;
        }
    }
    printf("%.9f\n", (double)uL/U+(double)vL/V);
    return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long x,y,a,b,c;
    cin>>x>>y;
    for(int a=0;a<=x;a++){
        for(int b=0;(a+b)<=x;b++){
            c=x-a-b;
            if(10000*a + 5000*b + c*1000==y)
            {
                cout<<a<<" "<<b<<" "<<c<<endl;
                return 0;
            }
        }
    }
    cout<<"-1 -1 -1"<<endl;

   return 0;
}


Measured memory_bytes: 256
let () = Scanf.scanf "%d %d\n" @@ fun x n ->
  let forbidden = Array.make 110 false in
  let ans = ref 0 in
  for i=1 to n do
    Scanf.scanf " %d" @@ fun p -> forbidden.(p) <- true
  done;
  for i=1 to 101 do
    if forbidden.(i) = false && abs (x - i) < abs (x - !ans) then ans := i
  done;
  Printf.printf "%d\n" !ans

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

int main(void) {
  int n, m;
  cin >> n >> m;
  pair<int, int> ab[n];
  rep (i, n) cin >> ab[i].first >> ab[i].second;

  sort(ab, ab + n);

  priority_queue<int> Q;
  int nowId = 0;

  ll ans = 0;
  for (int i = 1; i <= m; i++) {
    if (nowId < n) {
      while (ab[nowId].first <= i) {
        Q.push(ab[nowId++].second);
        if (nowId >= n) break;
      }
    }
    if (!Q.empty()) {ans += Q.top(); Q.pop();}
  }
  
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1660
# n = int(input())
# s = input()
n,k = map(int,input().split())
# da = list(map(int,input().split()))
# a = [int(input()) for i in range(n)]
# da = [list(map(int,input().split())) for i in range(m)]

print(min(n%k, k-n%k))


Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <queue>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;
const int iINF = 1001001001;
const long long llINF = 1LL << 60;
int main()
{
	// 全国統一プログラミング王決定戦予選-C, 1138, 17:18(UNSOLVED), 解説AC
	int n; cin >> n;
	vector<T> v(n);
	rep(i, n) {
		int a, b;
		cin >> a >> b;
		v[i] = T(a + b, a, b);
	}
	sort(v.rbegin(), v.rend());
	ll ans = 0;
	rep(i, n) {
		if (i % 2 == 0) ans += ll(get<1>(v[i]));
		else ans -= ll(get<2>(v[i]));
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 4260
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
 
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
 
#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)

int main() {
    ll n;
    cin >> n;
    ll V[n], C[n];
    rep(i,0,n) cin >> V[i];
    rep(i,0,n) cin >> C[i];
    ll eval[n];
    rep(i,0,n) eval[i] = V[i] - C[i];
    sort(eval, eval+n, greater<ll>());
    ll ans = 0;
    rep(i,0,n) {
        if (eval[i] > 0) {
            ans += eval[i];
        }else{
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
using namespace std;
typedef long long ll;
ll INF=1<<29;

int main(){
	ios::sync_with_stdio(false);
	int H,W,tab[10][10],ans=0;
	cin>>H>>W;
	int dj[H][W];
	for(int i=0;i<10;i++){
		for(int j=0;j<10;j++){
			cin>>tab[i][j];
		}
	}

	vector<int> A={0,1,2,3,4,5,6,7,8,9};
	vector<int> B(10);
	for(int i=0;i<10;i++) B[i]=INT_MAX;
	B[1]=0;
	do{
		int tmp=0;
		if(A[0]==1) continue;
		for(int i=0;i<10;i++){
			tmp+=tab[A[i]][A[i+1]];
			if(A[i+1]==1) break;
		}
		B[A[0]]=min(tmp,B[A[0]]);
	}while(next_permutation(A.begin(),A.end()));

	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			cin>>dj[i][j];
			if(dj[i][j]==-1) continue;
			else ans+=B[dj[i][j]];
		}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int s;
  cin >> s;

  // n%2==0 -> n/2
  // n%2==1 -> 3n+1

  vector<int> visited(1000000, 0);
  visited[s] = 1;
  int i = 2;

  while (true) {
    if (s % 2 == 0) {
      s = s / 2;
    } else {
      s = 3 * s + 1;
    }

    if (visited[s] == 1) {
      break;
    } else {
      visited[s] = 1;
    }
    i++;
  }

  cout << i << endl;
}

Measured memory_bytes: 4096
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(void){
  int i,j;
  int w,h;
  char s[60][60];
  int a[60][60];
  for(i=0;i<60;i++){
    for(j=0;j<60;j++){
      a[i][j]=0;
    }
  }
  scanf("%d %d",&h,&w);
  for(i=0;i<h;i++){
    scanf("%s",s[i]);
  }
  for(i=0;i<h;i++){
    for(j=0;j<w;j++){
      if(s[i][j]=='#')
	a[i+1][j+1]=1;
      else
	a[i+1][j+1]=0;
    }
  }
  for(i=1;i<=h;i++){
    for(j=1;j<=w;j++){
      if(a[i][j]==1){
	if(a[i-1][j]==0 && a[i+1][j]==0 && a[i][j+1]==0 && a[i][j-1]==0){
	  printf("No\n");
	  return 0;
	}
      }
    }
  }
  printf("Yes\n");
  return 0;
}


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

typedef long lint;
typedef long long llint;
typedef pair<int, int> pint;
typedef pair<long long, long long> pllint;

// static const int MAX = 1e6;
// static const int NIL = -1;
static const int INF = 1e9;
// static const llint MOD = 1e9 + 7;

bool compPair(const pint& arg1, const pint& arg2) { return arg1.first > arg2.first; }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }

int main(void) {
    int n, m, r;
    cin >> n >> m >> r;
    
    vector<int> reg(r);
    for(int ir=0;ir<r;ir++) {
        cin >> reg.at(ir); reg.at(ir)--;
    }

    int a, b, c;
    vector<vector<int>> adjmat(n, vector<int>(n, INF));
    for(int im=0;im<m;im++) {
        cin >> a >> b >> c; a--; b--;
        if(adjmat.at(a).at(b)>c) {
            adjmat.at(a).at(b) = c;
            adjmat.at(b).at(a) = c;
        }
    }

    for(int kn=0;kn<n;kn++) {
        for(int in=0;in<n;in++) {
            for(int jn=0;jn<n;jn++) {
                if(adjmat.at(in).at(jn)>adjmat.at(in).at(kn)+adjmat.at(kn).at(jn)) {
                    adjmat.at(in).at(jn)=adjmat.at(in).at(kn)+adjmat.at(kn).at(jn);
                }
            }
        }
    }

    vector<int> V;
    for(int ir=0;ir<r;ir++) {
        V.push_back(ir);
    }

    int ans = INF, anstmp;
    do {
        int pre, next;
        anstmp = 0;
        for(int ir=0;ir<r-1;ir++) {
            pre = reg.at(V.at(ir));
            next = reg.at(V.at(ir+1));
            anstmp += adjmat.at(pre).at(next);
        }
        chmin(ans, anstmp);
    } while(next_permutation(V.begin(), V.end()));
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 384
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

def pow_r_mod(x, n, mod=10**9+7):
    """
    O(log n)
    """
    if n == 0:
        return 1

    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        x %= mod
        n //= 2

    return (K * x) % mod

m, a, b = mi()

P = 10**9+7
N = 2*(10**5)+1
inv_t = [0]+[1]
for i in range(2,N):
  inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

mca = mcb = 1

for i in range(1, a+1):
    mca *= (m-i+1) * inv_t[i]
    mca %= P

for i in range(1, b+1):
    mcb *= (m-i+1) * inv_t[i]
    mcb %= P

print((pow_r_mod(2, m)-1-mca-mcb) % P)

Measured memory_bytes: 11052
#include <stdio.h>


int h, w;
int is_wall[2001][2001];
int x_sight[2001][2001];
int y_sight[2001][2001];
int TRUE = 0;
int FALSE = 1;


int main(int argc, char const *argv[])
{
  scanf("%d %d", &h, &w);
  for (int i = 0; i < h; i++) {
    char buf[2000];
    scanf("%s", buf);
    for (int j = 0; j < w; j++) {
      is_wall[i][j] = buf[j] == '#' ? TRUE : FALSE;
    }
  }

  for (int y = 0; y < h + 1; y++) {
    int sight = 0;
    int start = 9999;
    for (int x = 0; x < w + 1; x++) {
      if (is_wall[y][x] == TRUE) {
        for (int s = start; s < start + sight; s++) {
          x_sight[y][s] = sight;
        }
        x_sight[y][x] = 0;
        sight = 0;
        start = 9999;
      } else {
        if (x < start) start = x;
        sight++;
      }
    }
  }

  for (int x = 0; x < w + 1; x++) {
    int sight = 0;
    int start = 9999;
      for (int y = 0; y < h + 1; y++) {
      if (is_wall[y][x] == TRUE) {
        for (int s = start; s < start + sight; s++) {
          y_sight[s][x] = sight;
        }
        y_sight[y][x] = 0;
        sight = 0;
        start = 9999;
      } else {
        if (y < start) start = y;
        sight++;
      }
    }
  }

  int ans = 0;
  for (int x = 0; x < w; x++) {
    for (int y = 0; y < h; y++) {
      int temp = x_sight[y][x] + y_sight[y][x] - 1;
      if (temp > ans)
        ans = temp;
    }
  }

  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 47104
#include <stdio.h>
#define N 100

int main(){
  int M[N][N];
  int n,u,k,v,i,j;

  scanf("%d",&n);

  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      M[i][j]=0;
    }
  }
  
  for(i=0;i<n;i++){
    scanf("%d%d",&u,&k);
    u--;
    for(j=0;j<k;j++){
      scanf("%d",&v);
      v--;
      M[u][v]=1;
    }
  }

  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
	printf("%d",M[i][j]);
	if(j!=n-1)printf(" ");
    }
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 636
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
/////////////////////////////////
int main()
{
    string s;
    cin >> s;
    if (s[0] == s[1] && s[2] == s[3] && s[0] != s[3])
        cout << "Yes" << endl;
    else if (s[0] == s[2] && s[1] == s[3] && s[0] != s[1])
        cout << "Yes" << endl;
    else if (s[0] == s[3] && s[1] == s[2] && s[0] != s[1])
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

Measured memory_bytes: 3548
#include<stdio.h>
int main(){
  int n,m,i,j,k,mi,c[110],d[110][110],f[110]={0};
  while(scanf("%d",&n),n){
    for(i=0;i<110*110;i++)d[i/110][i%110]=1e9;
    scanf("%d",&m);
    while(m--){
      scanf("%d,%d,%d",&i,&j,&k);
      d[i][j]=d[j][i]=k/100-1;
    }
    for(i=0;i<110;i++)f[i]=0;
    for(i=mi=k=0;i<110;i++)c[i]=1e9;
    for(i=c[0]=0;i<n;i++){
      f[mi]=1;
      k+=c[mi];
      for(j=0;j<n;j++){
	if(c[j]>d[mi][j])c[j]=d[mi][j];
      }
      for(mi=0;f[mi];mi++);
      for(j=0;j<n;j++){
	if(f[j]==0&&c[mi]>c[j])mi=j;
      }
    }
    printf("%d\n",k);
  }
  return 0;
}

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


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(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//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 EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())


//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {

	vector<int> a(4);

	for (int i = 0; i < 4; i++) {
		cin >> a[i];
	}

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

	if (a[0] == 1 && a[1] == 4 && a[2] == 7 && a[3] == 9) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
    // Your code here!
    int N,n;
    scanf("%d",&N);
    int A[N+5];
    for(int i=0;i<=N;i++){
        A[i]=1;
    }
    for(int i=1;i<=N;i++){
        n=i;
        for(int j=2;j<=N;j++){
            while(n%j==0){
                if(n%j==0){
                    A[j]+=1;
                    n=n/j;
                }
            }
        }
        
    }
    long long int ans=1;
    for(int i=1;i<=N;i++){
        ans*=A[i];
        ans=ans%1000000007;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
w, h = [int(i) for i in input().split()]
p = [(int(input()),0) for _ in range(w)]
q = [(int(input()),1) for _ in range(h)]
pq = sorted(p + q)
hh = 0
ww = 0
ans = 0
for i in pq:
    if i[1] == 0:
        ans += i[0] * (h+1 - hh)
        ww += 1
    else:
        ans += i[0] * (w+1- ww)
        hh += 1
print(ans)


Measured memory_bytes: 27740
import java.util.*;

public class Main {
    public static void main(String[] args) {

        solve_152_B();

        return;
    }

    private static void solve_152_B() {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        long number_a = 0;
        long number_b = 0;

        if(a>b){
            for(int i=0; i<a; i++) {
                number_b = number_b*10 + b;
            }
            String number_B = Long.toString(number_b);
            System.out.println(number_B);
        }else{
            for(int i=0; i<b; i++) {
                number_a = number_a*10 + a;
            }
            String number_A = Long.toString(number_a);
            System.out.println(number_A);
        }
    }
}

Measured memory_bytes: 21844
#include <iostream>

using namespace std;

int main()
{
    int A,B,C,D,S;
    cin>>A>>B>>C>>D;

    if(A>=B)
    {
        S=B;
    }
    else{S=A;}

    if(C>=D)
    {
        S=S+D;
    }
    else{S=S+C;}
    
    cout<<S;

    return 0;
}


Measured memory_bytes: 256
import java.util.*;
class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		
		if(N <= K) {
			System.out.println(N * X);
		}else {
			System.out.println(K * X + (N - K) * Y);
		}
	}
}


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

#define FLASH ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long int
#define MAX 1e9
#define MIN -1e9
#define mod 1000000007
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define debug(x) cerr<<#x<<'='<<(x)<<endl;
#define mxn 300005
using namespace std;

int main()
{
    FLASH
    ll n;
    ll d;
    cin >> n >> d;
    int cnt =0 ;
    while(n-- > 0){
        long double x,y;
        cin >> x >> y;
        ll dist = (x * x) + (y * y);
        if(dist <= (d * d) )cnt++;
    }
    cout << cnt << '\n' ;
    return 0;
}


Measured memory_bytes: 3736
#include <bits/stdc++.h>
using intl = long long;
using itnl = long long;
using itn = int;
using ld = long double;
using namespace std;
#define rep(i, n) for(intl i = 0; i < (intl)(n); i++)
#define rrep(i, n) for(intl i = (intl)(n) - 1; i >= 0; i--)
#define repi(i, a, b) for(intl i = (intl)(a); i < (intl)(b); i++)
#define rrepi(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 itn int
#define double ld
#define pb push_back
#define mp make_pair
#define pii pair<intl,intl>
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){
    intl b = 0;
    do{
        a /= 10;
        b++;
    }while(a);
    return b;
}
signed main(){
    cout << fixed << setprecision(10);
    ld n,m;
    cin >> n >> m;
    cout << n / m << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pb push_back
#define ll long long
#define pi pair<int,int>
#define pii pair<pi,int>
#define go ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int n,m,a[100100],dp[100100],mod=1e9+7;
int Solve(int i)
{
    if(i>n)
        return 0;
    if(a[i])
        return 0;
    if(i==n)
        return 1;
    int &ret=dp[i];
    if(ret+1 )return ret;
    ret=Solve(i+1)%mod;
    ret+=Solve(i+2)%mod;
    ret%=mod;
    return ret;
}
int main()
{
    go;
    cin>>n>>m;
    memset(dp,-1,sizeof dp);
    for(int i=0;i<m;i++)
    {
        int x;
        cin>>x;
        a[x]=1;
    }
    cout<<Solve(0);
    return 0;
}


Measured memory_bytes: 4096
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		ArrayList<String> s = nextCharArray();
		s.add(4, " ");
		myout(myconv(s, 0));
	}
	//Method addition frame start



	//Method addition frame end
}


Measured memory_bytes: 33244
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for(ll i = (ll)a; i <= (ll)b; i++)
#define DEC(i, a, b) for(ll i = (ll)a; i >= (ll)b; i--)

ll n, k, a, b, ans = 1, m = 1e9+7;
vector <int> adj[100050];

void mul(ll &a, ll b) {
	a *= b;
	a %= m;
}

void dfs(int x, int p, int coun) {
	if (coun >= k) {cout << 0; exit(0);}
	mul(ans, k - coun);
	int c = 1 + (p != -1);
	for(auto it:adj[x]) {
		if (it == p) continue;
		dfs(it, x, c);
		c++;
	}
}

int main() {
	cin >> n >> k;
	FOR(i, 1, n-1) {
		cin >> a >> b;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	dfs(1, -1, 0);
	cout << ans;
}


Measured memory_bytes: 9216
#include<bits/stdc++.h>
#define rgt register
#define rint rgt int
#define LL long long
#define rll rgt LL
#define inf 0x7f7f7f7f
using namespace std;
template<class K>inline bool cmax(K&a,const K&b){return (a<b)?a=b,1:0;}
template<class K>inline bool cmin(K&a,const K&b){return (a>b)?a=b,1:0;}
double a,b,x,Pi=acos(-1);
int main()
{
	rint i,j;
	scanf("%lf%lf%lf",&a,&b,&x);
	x/=a;
	if(a*b/2<x) x=2*b-x*2/a,printf("%.10lf",90-atan(a/x)/Pi*180);
	else x=x/b*2,printf("%.10lf",atan(b/x)/Pi*180);
	return 0;
}

Measured memory_bytes: 256