akhauriyash/Code-Regression huggingface dataset:
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#define _GLIBCXX_DEBUG // check []
#define DIVISOR 1000000007

using namespace std;
typedef pair<int,int> pii;
typedef pair<int64_t, int64_t> pII;

template<typename T>
void cins(vector<T>& arr) { for(T& e: arr) cin >> e; }

#ifdef DEBUG
#define debug(fmt, ...) \
    printf("[debug: %s] " fmt, __func__, __VA_ARGS__)
#define ps(arr) \
    for(auto e: arr) cout << e << " "; \
    cout << endl;
#else
#define debug(fmt, ...)
#define ps(arr)
#endif

int main(void) {
    string str;
    cin >> str;
    stack<char> stack;
    for(char ch: str) {
        if(ch == 'B') {
            if(!stack.empty()) stack.pop();
        } else {
            stack.push(ch);
        }
    }
    string ans;
    int sz = stack.size();
    for(int i = 0; i < sz; i++) {
        ans.push_back(stack.top()); stack.pop();
    }
    reverse(ans.begin(), ans.end());
    cout << ans << endl;
    return 0;
}

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

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

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

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

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

using ll = long long;

using namespace std;

int main() {
  in(int, n, T);
  int ans = 1000000;
  rep(i, n) {
    in(int, c, t);
    if (t <= T) ans = min(ans, c);
  }
  if (ans == 1000000) {
    out("TLE");
  } else {
    out(ans);
  }
}


Measured memory_bytes: 3548
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(i,a,b) for(ll i=a;i <= b;i++)
#define fast_io ios_base::sync_with_stdio(false)
#define pb push_back
#define fir first
#define sec second
#define tr(it,x) for(it = x.begin();it != x.end();it++)
#define mp make_pair
#define sz(x) (ll)x.size()
#define rep(i,n) for(ll i=0;i<n;i++)
#define double long double
#define accuracy ll precision = numeric_limits<double>::digits10
#define pll pair<ll,ll>
#define N 100005

ll n,k,dp[N],h[N];

int main() {
	// freopen("input.txt", "r", stdin); 
	// freopen("output.txt", "w", stdout);
	fast_io;	 
	accuracy;
	cin >> n >> k;
	fr(i,1,n) cin >> h[i];
	fr(i,0,N-1) dp[i] = LLONG_MAX;
	dp[1] = 0;
	fr(i,2,n) {
		fr(j,max(1ll,i-k),i-1) {
			dp[i] = min(dp[i],dp[j] + abs(h[i] - h[j]));
		}
	}
	cout << dp[n] << endl;
}

Measured memory_bytes: 1920
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner stdIn = new Scanner(System.in);
    
    int n = stdIn.nextInt();
    int m = stdIn.nextInt();
    
    if (n <= m) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
}


Measured memory_bytes: 21844
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
 
using namespace std;
 
typedef long long ll;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=(b-1);i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;
 
#define MOD 1000000007

int main(){
	ll n;
	cin>>n;
	vector<pair<ll,ll> > v;
	rep(i,0,n){
		rep(j,i+1,n){
			string s;
			rep(k,0,n){
				if(k==i||k==j)s+="1";
				else s+="0";
			}
			cout << "?" << " " << s << endl;
			ll ans;
			cin>>ans;
			if(ans == 1){
				v.pb(mp(i,j));
			}
		}
	}
	cout << "! ";
	rep(i,0,v.sz){
		cout << "(" << v[i].fi << "," << v[i].se << ")";
		if(i!=v.sz-1)cout << " ";
	}
	cout << endl;
	return 0;
}




Measured memory_bytes: 852
from sys import stdin
import math
import itertools


def makeIntMatrix(lines):
    intMatrix = []
    for a in makeStringMatrix(lines):
        intMatrix.append([int(b) for b in a])
    return intMatrix
 
 
def makeStringMatrix(lines):
    stringMatrix = [line.split() for line in lines]
    return stringMatrix
 
 
def makeInt(line):
    return int(line.rstrip())
 
 
def makeMultiInteger(line):
    return [int(x) for x in line.rstrip().split()]


def solve():
    a = makeInt(input())
    b = makeInt(input())
    c = makeInt(input())
    d = makeInt(input())
    e = makeInt(input())
    l = [a, b, c, d, e]
    k = makeInt(input())
    flag = False
    for i in range(len(l)):
        for j in range(len(l)-1):
            if abs(l[i] - l[j+1]) > k:
                flag = True
    if flag:
        return ":("
    else:
        return "Yay!"


def main():
    answer = solve()
    print(answer)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <iostream>

using namespace std;
long long scoreA,scoreB;
int main(void)
{
  int cnum;
  long long na,nb;
  cin>>cnum;
  while(cnum!=0)
  {
    scoreA=0;scoreB=0;
    na=0;nb=0;
    for(int i=0;i<cnum;i++)
    {
      cin>>na>>nb;
      if(na==nb)
      {
        scoreA+=na;
        scoreB+=nb;
      }else if(na>nb)
        scoreA+=na+nb;
      else
        scoreB+=na+nb;
    }
    cout<<scoreA<<" "<<scoreB<<endl;
    cin>>cnum;
  }
  return 0;
}

Measured memory_bytes: 1164
//
//AtCoder Beginner Contest 135
//B - 0 or 1 Swap
//

#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <functional>
#include <cassert>

using namespace std;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define SIZE(x) (int)(x).size()
#define SIZEL(x) (ll)(x).size()
#define MSG(a) cout << #a << " " << a << endl;

using ll = long long;
using ld = long double;

const double PI = 3.14159265358979323846;

ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }    //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }            //最小公倍数

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

    vector<int> p(n);
    REP(i, n) cin >> p[i];
    
    int diff=0; 
    REP(i,n) if (p[i]!=i+1) diff++;
    if(diff<=2) cout << "YES" << endl;
    else cout << "NO" << endl;

    return 0;
}


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

int main() {
    int a, b, k;
    cin >> a >> b;
    if (a % 2 == 0 && b % 2 == 0 || a % 2 == 1 && b % 2 == 1) {
        if (a > b) cout << a - abs((a - b)/2) << endl;
        else cout << b- abs((a - b)/2) << endl;
    }
    else cout << "IMPOSSIBLE" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define SIZE 200010
#define rep(i, a, b) for (int i = a; i <= b; ++i)
using namespace std;
void io() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); }
ll n, ans, a[SIZE];
map<ll, ll> MP;

int main() {
	io(); cin >> n;
	rep(i, 1, n) cin >> a[i], MP[a[i]]++;
	for (auto it : MP) ans += it.second * (it.second - 1ll) / 2ll;
	rep(i, 1, n) {
		ll res = MP[a[i]];
		cout << ans - res * (res - 1ll) / 2ll + (res - 1ll) * (res - 2ll) / 2ll << '\n';
	}
}

Measured memory_bytes: 11136
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout <<(#x)<<" is "<<(x)<<endl
#define debug cout <<"hi"<<endl
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
const int MOD=1e9+7;
const int INF32=1<<30;
const ll INF64=1LL<<60;

void solve(){
  ll a,b,ans=0; cin >>a >>b;
  if(a%2){ans=a; a++;}
  if(b%2==0){ans^=b; b--;}
  cout <<(ans^((b-a+1)%4/2));
}

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

Measured memory_bytes: 3612
N = int(input())
A = list(map(int,input().split()))
B = [0 for i in range(N)]
for n in range(N):
    step = N - n
    sm = A[step-1]
    for i in range(step-1, N ,step)[::-1]:
        sm += B[i]
    B[step-1] = (sm%2)
    #print (B)
print (sum(B))
C = " ".join([str(i+1) for i in range(len(B)) if B[i]])
print (C)


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

int main() {
	int n, x, i, sum = 0;
	cin>>n>>x;
	int a[n], count = n;
	for(i = 0; i < n; i++)
	{
	    cin>>a[i];
	}
	sort(a, a+n);
	for(i = 0; i < n; i++)
	{
	    sum += a[i];
	}
	while(1)
	{
	    if(sum > x)
	        break;
	    else
	    {
	        sum += a[0];
	        count++;
	    }
	}
	cout<<count-1;
	return 0;
}


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

int  main()
{
	string s;
	cin >> s;
	vector<string> d;
	int i = 0;
	while (i < s.size())
	{
		if (d.empty())
		{
			d.push_back(s.substr(i, 1));
		}
		else if (s.substr(i, 1) != d[d.size() - 1] )
		{
			d.push_back(s.substr(i,1));
		}
		else if (s[i + 1] != '\0')
		{
			d.push_back(s.substr(i, 2));
			i++;
		}
		i++;
	}
	cout << d.size() << endl;
	return (0);
}


Measured memory_bytes: 10996
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int n,m;
  cin >> n >> m;
  vector<int> a(n);
  int t = 0;
  rep(i,n) {
    cin >> a[i];
    t += a[i];
  }
  sort(a.rbegin(),a.rend());
  rep(i,m){
    if(a[i]*4*m<t){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 888
//https://atcoder.jp/contests/abc142/tasks/abc142_a
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n;
	cin>>n;
	double x;
	ll p;
	if(n%2==0)
	{
		x=((double)1)/((double)2);
		cout<<x<<"\n";
	}
	else
	{
		p=n/2+1;
		x=((double)p)/((double)n);
		cout<<x<<"\n";
	}
	return 0;
}

Measured memory_bytes: 3780
use proconio::input;

fn main() {
    input! {
        x: i32,
        y: i32
    }

    if y%2 == 1 {
        println!("No")
    } else if ((y/2)-x >= 0) && (2*x-(y/2) >= 0) {
        println!("Yes")
    } else {
        println!("No")
    }

}


Measured memory_bytes: 2108
#include<stdio.h>
int main(){

	int data[10000],i=0,maxix;
	while(i<=10000){
		scanf("%d",&data[i]);
		if(data[i]==0){
			maxix=i-1;
			break;
		}
		i++;
	}
	i=0;
	while(i<=maxix){
		printf("Case %d: %d\n",i+1,data[i]);
		i++;
	}
	return 0;
}

Measured memory_bytes: 1812
//#include <bits/stdc++.h>
//#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>
#include<cctype>
#include<fstream>


#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979
#define MAXI 7500000

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

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

int main(void){
    int n, k;
    string s;
    cin >> n;
    cin >> s;
    cin >> k;
    FOR(i,0,s.size()-1){
        if(s[i]!=s[k-1]){
            s[i] = '*';
        }
    }
    cout << s << endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;
int main()
{
	int N,a[30],b[30],i,j,max=-1,cnt=0;
	string S;
	cin >> N >> S;
	for(i=0; i<30; i++){
		a[i] = 0;
		b[i] = 0;
	}
	for(i=0; i<N-1; i++){
		cnt = 0;
		for(j=0; j<=i; j++){
			a[ S[j] - 'a']++;
		}
		for(j=i+1; j<N; j++){
			b[ S[j] - 'a']++;
		}
		for(j=0; j<26; j++){
			if(a[j] > 0 && b[j] > 0)
				cnt++;
		}
		for(j=0; j<30; j++){
			a[j] =0;
			b[j] =0;
		}
		if(max < cnt)
			max = cnt;
	}
	
	cout << max << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) sort(a.rbegin(), a.rend())
#define REP(i, n) for (int i = 0; i < n; ++i)
#define RREP(i, n) for (int i = n; 0 <= i; --i)
#define FOR(i, start, end) for (int i = start; i < end; ++i)
#define RFOR(i, start, end) for (int i = start; end <= i; --i)
#define ALL(a) a.begin(), a.end()
#define MOD(a) a %= 1'000'000'007
#define INF32 1'050'000'000
#define INF64 4'000'000'000'000'000'000
using ll = long long;
using namespace std;
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; }


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

    ll N; cin >> N;
    if (N%2==0) {
        cout << 0.5 << '\n';
        return 0;
    } else {
        cout << double(double(int(N/2)+1) / double(N)) << '\n';
        return 0;
    }
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(unique(all(x)), x.end());
typedef long long ll;
typedef complex<double> Complex;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
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 <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

int main() {
    int n;
    cin >> n;
    auto a = make_vec<ll>(n, n);
    rep(i, n) rep(j, n) cin >> a[i][j];

    ll ans = 0;
    rep(i, n) rep(j, n) {
        ll MIN = LINF;
        rep(k, n) {
            if (i == k || j == k) continue;
            chmin(MIN, a[i][k] + a[k][j]);
        }
        if (MIN < a[i][j]) {
            cout << -1 << endl;
            return 0;
        }
        if (MIN > a[i][j]) {
            ans += a[i][j];
        }
    }
    cout << ans / 2 << endl;
}

Measured memory_bytes: 1024
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element? {
        return self.maxElement()
    }
    func min() -> Element? {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
//    func enumerated() -> [(Int, Element)] {
//        return self.enumerate()
//    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
func exponentiate(lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/

//func gcd(x: Int, _ y: Int) -> Int {
//    if y == 0 {
//        return x
//    } else {
//        return gcd(y, x%y)
//    }
//}

/*************** メインプログラム ***************/

let N = readInt()!
var a = readIntSplit(by: " ")
var ans = 0
while a.count > 0 {
    a = a.filter{$0%2==0}.map{$0/2}
    ans += a.count
}
print(ans)


Measured memory_bytes: 4600
#include <bits/stdc++.h>
#define ll  long long int
#define pb push_back
#define ff first
#define ss second
#define vi vector<int>
#define br cout <<"\n";
#define all(x)  (x).begin(),(x).end()
#define rall(x)  (x).rbegin(),(x).rend()
#define tr(c,i) for(auto i :c)
#define pii pair< int,int >
#define Fast_IO() ios_base::sync_with_stdio(false);cin.tie(0)
#define pq priority_queue< pair<ll,pii> ,vector<pair<ll,pii>>,greater <pair<ll,pii>> >p;//container adapter makes ascending q
#define er(x) cout << x << " "
#define err(x,y) cout << x << " "<<y
const int MOD = 1000 * 1000 * 1000 + 7; // odd modulus
const int N = 100 * 1000 + 1;
using namespace std;
clock_t time_p=clock();
void dem()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}
vector<vector<int>> edge(N);
ll res , k ;
void dfs( int par ,int gpar ,  int idx  )
{
    int opt = (gpar == -1) ?  k -1  : k - 2 ;
    for ( int child : edge[par])
    {
     // cout << " par & child " <<par << " "<< child  << " " << idx;br
        if ( child == gpar )continue;
		if ( opt - idx <= 0 ) {res = 0; return ;}
		res = (res * (opt - idx) ) % MOD;
        idx++;
        dfs(  child , par ,  0) ;

    }

}
int main()
{
    Fast_IO();
    int n ;
    cin >> n >> k ;
    for ( int i = 0 ; i < n-1 ; ++i)
    {
     int u , v ;
     cin >> u >> v ;
     edge[u].pb(v);
     edge[v].pb(u);
    }
	res = k ;
	dfs(1 ,-1 , 0);
	cout << res % MOD ;

    return 0 ;
}

/*
7 6
1 2
1 3
1 4
1 8
2 5
2 6



*/


Measured memory_bytes: 10368
def cmb(n,r,mod):
  if r<0 or r>n:
    return 0
  r=min(r,n-r)
  return g1[n]*g2[r]*g2[n-r]%mod
 
r1,c1,r2,c2=map(int,input().split())
mod=10**9+7

g1=[1,1]
g2=[1,1]
inverse=[0,1]
 
for i in range(2,2*10**6+2):
  g1.append((g1[-1]*i)%mod)
  inverse.append((-inverse[mod%i]*(mod//i))%mod)
  g2.append((g2[-1]*inverse[-1])%mod)

def g(r,c):
  ans=0
  for i in range(1,c+1):
    ans+=cmb(r+i-1,i,mod)
  return ans

print((g(r2+1,c2+1)-g(r2+1,c1)-g(r1,c2+1)+g(r1,c1)+mod)%mod)

Measured memory_bytes: 133648
#include <iostream>

using namespace std;

int main() {
    int N;
    cin >> N;
    char prev = 0;
    int c = 0;
    for (int i = 0; i < N; i++){
        char s;
        cin >> s;
        if (s != prev)
            c += 1;
        prev = s;
    }
    cout << c << endl;
}

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

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

int main()
{
    ll A,B,K;
    cin >> A >> B >> K;

    if( A < K )
    {
        K -= A;
        A = 0;
    }
    else
    {
        A -= K;
        cout << A << " " << B << endl;
        return 0;
    }
    if( B < K )
    {
        cout << 0 << " " << 0 << endl;
    }
    else
    {
        cout << 0 << " " << B-K << endl;
    }
}


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

int main()
{
ll x ;
cin >> x ;
if(x>=30)ans="Yes";
cout << ans << endl;
return 0;
}

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

int main(){
  int N,M,C;
  cin>>N>>M>>C;
  vector<int> B(M);
  for(int i=0;i<M;i++){
    cin>>B.at(i);
  }
  vector<vector<int>> A(N,vector<int>(M));
  for(int i=0;i<N;i++){
    for(int j=0;j<M;j++){
      cin>>A.at(i).at(j);
    }
  }
  int ans=0;
  for(int i=0;i<N;i++){
    int sum=C;
    for(int j=0;j<M;j++){
      sum+=A.at(i).at(j)*B.at(j);
    }
    if(sum>0){
      ans++;
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
def main(): 

    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    cnt = 0

    for i in range(n):
        if a[i] < b[i]:
            cnt += a[i]
            b[i] -= a[i]
            if a[i+1] >= b[i]:
                cnt += b[i]
                a[i+1] -= b[i]
            else:
                cnt += a[i+1]
                a[i+1] = 0
        else:
            cnt += b[i]

    print(cnt)



if __name__ == "__main__":
    main() 

Measured memory_bytes: 18624
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

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

			String in = br.readLine();
			String chr[] = in.split(" ");
			int a = Integer.parseInt(chr[0]);
			int b = Integer.parseInt(chr[1]);
			int c = Integer.parseInt(chr[2]);
			int d = Integer.parseInt(chr[3]);
			System.out.println(Math.max(a*b, c*d));

		}
	}
}


Measured memory_bytes: 25212
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
 var s = lines[0];
 var length = s.length;
 var kouho = [];
 var sa = [];

for(i=0; i<length; i++){
  var a = s.substring(i,3+i)
  kouho.push(a);
  var b = Math.abs(Number(a) - 753);
  sa.push(b);
}
 var min = Math.min(...sa);  
 

 console.log(min);
});

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

template<class T>
T lcm(T a,T b){
    return a/__gcd(a,b)*b;
}

int main(){
    long n;
    cin >> n;
    vector<long> t(n);
    long sum=0;
    for(long i=0;i<n;i++){
        cin >> t[i];
        sum+=t[i];
    }
    long m;cin >> m;
    vector<pair<long,long>> pa;
    for(long i=0;i<m;i++){
        long p,x;
        cin >> p >> x;
        pa.push_back(make_pair(p-1,x));
    }
    for(auto i:pa){
        cout << sum-t[i.first]+i.second << endl;
    }
    return 0;
}

Measured memory_bytes: 256
# Rows and columns(行と列)
rac_count = 3
rac_all = [input() for a in range(rac_count)]

rac_0 = list(rac_all[0])
rac_1 = list(rac_all[1])
rac_2 = list(rac_all[2])

rac_0.extend(rac_1)
rac_0.extend(rac_2)

print(str(rac_0[0] + rac_0[4] + rac_0[8]))

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

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


int main() {
  const long long INF = 1LL << 60;

  long long dp[100010];

  rep(i,100010)dp[i] = INF;

  dp[0]=0; 

  int n;
  cin >> n;

  int h[n];
  rep(i,n)cin >> h[i];

  rep(i,n){
  chmin(dp[i], dp[i-1]+abs(h[i]-h[i-1]));
  chmin(dp[i], dp[i-2]+abs(h[i]-h[i-2]));
  }

  cout << dp[n-1] << endl;

}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  int n;
  cin>>n;
  int p[n+1];
  REP(i,n){
    cin>>p[i+1];
  }
  int ans=0;
  REPP(i,n){
    if(p[i]==i){
      if(i!=n){
        swap(p[i],p[i+1]);
        ans++;
      }else{
        ans++;
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 640
package main

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

func main() {
	fsc := NewFastScanner()
	H, _ := fsc.NextInt(), fsc.NextInt()
	for i := 0; i < H; i++ {
		T := fsc.Next()
		fmt.Println(T)
		fmt.Println(T)
	}
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1024)
	return &FastScanner{r: rdr}
}
func (s *FastScanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *FastScanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *FastScanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *FastScanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *FastScanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}

func (s *FastScanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *FastScanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *FastScanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

//Max,Min
func IntMax(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func Int64Max(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func Float64Max(a, b float64) float64 {
	if a < b {
		return b
	}
	return a
}

func IntMin(a, b int) int {
	if a > b {
		return b
	}
	return a
}

func Int64Min(a, b int64) int64 {
	if a > b {
		return b
	}
	return a
}
func Float64Min(a, b float64) float64 {
	if a > b {
		return b
	}
	return a
}

//Gcd
func IntGcd(a, b int) int {
	if a < b {
		b, a = a, b
	}
	if b == 0 {
		return a
	}
	return IntGcd(b, a%b)
}
func Int64Gcd(a, b int64) int64 {
	if a < b {
		b, a = a, b
	}
	if b == 0 {
		return a
	}
	return Int64Gcd(b, a%b)
}

func IntAbs(a int) int {
	if a < 0 {
		a *= -1
	}
	return a
}

func Int64Abs(a int64) int64 {
	if a < 0 {
		a *= -1
	}
	return a
}


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

int main() {
  int n;

  while (cin >> n, n) {
    int t[n];
    int sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> t[i];
      sum += t[i];
    }
    sort(t, t + n);
    cout << (sum - t[0] - t[n - 1]) / (n - 2) << endl;
  }
}

Measured memory_bytes: 1176
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int w = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		if(a < b) {
			System.out.println(Math.max(b - (a  + w),  0));
		} else {
			System.out.println(Math.max(a - (b + w),  0));
		}

	}

}


Measured memory_bytes: 21716
#include "bits/stdc++.h"
using namespace std;
using ll=long long;
#define print(n) cout<<n<<endl
#define rep(i,a,n) for(int i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<ll,ll>
#define vl vector<ll>
#define vi vector<int>
#define vvl vector<vector<ll>>
#define vvi vector<vector<int>>
const int M=200111;
const int inf=1000000007;
const long long INF=1e18;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
int ddx[8]={1,-1,0,0,1,-1,-1,1},ddy[8]={0,0,1,-1,1,-1,1,-1};


struct UnionFind {
	vector<int> par;
	UnionFind(int n) : par(n, -1) { }

	int root(int x) {
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool same(int x, int y) {
		return root(x) == root(y);
	}

	bool merge(int x, int y) {
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y); // merge technique
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x) {
		return -par[root(x)];
	}
};

vvl comb(int n, int r) {
	vvl v(n + 1,vl(n + 1, 0));
	for (int i = 0; i < v.size(); i++) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (int j = 1; j < v.size(); j++) {
		for (int k = 1; k < j; k++) {
			v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
		}
	}
	return v;
}

void sosu(ll x,bool f[]){
	ll y=x;
	for(ll i=2;i<=sqrt(y);i++){
		if(x%i==0){
			x/=i;
			f[i]=true;
			i--;
		}
	}
}

ll __gcd(ll x,ll y){
	if(x<y)swap(x,y);
	while(1){
		ll tmp=x%y;
		x=y;
		y=tmp;
		if(y==0)break;
	}
	return x;
}

int keta(ll a){
	int ke=1;
	while(a/=10)ke++;
	return ke;
}


int main() {
	ll n,x;
	cin>>n>>x;
	ll ans=(n-__gcd(n,x))*3;
	print(ans);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <iomanip>
using namespace std;
using P = pair<int,int>;
typedef long long ll;


#define rep(i,n) for (int i=0; i<(n); i++)
const int INF =1001001001;
const ll BIG = 1000000007;
const double PI = 3.141592653589793;

struct UnionFind {
    vector<int> d;
    UnionFind(int n) : d(n, -1) {}
    int find(int x) {
        if(d[x]<0) return x;
        return d[x] = find(d[x]);
    }
    bool unite(int x, int y) {
        x = find(x); y = find(y);
        if(x==y) return false;
        if(d[x]>d[y]) swap(x,y);
        d[x] += d[y];
        d[y] = x;
        return true;
    }
    bool same(int x, int y) { return find(x)==find(y);}
    int size(int x) { return -d[find(x)];}
};

int deg[100005];
vector<int> to[100005];

int main(){
    int n, m, k;
    cin >> n >> m >> k;
    UnionFind uf(n);
    rep(i,m){
        int a,b;
        cin >> a >> b;
        a--; b--;
        deg[a]++;
        deg[b]++;
        uf.unite(a,b);
    }
    rep(i,k){
        int a,b;
        cin >> a >> b;
        a--; b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    rep(i,n){
        int ans = uf.size(i) - 1 - deg[i];
        for(int u: to[i]) {
            if(uf.same(i,u)) ans--;
        }
        printf("%d%c", ans, i==n-1?'\n':' ');
    }
    return 0;
}

/*
int main(){
    int n, m, k;
    cin >> n >> m >> k;
    vector<int> friends[n];
    vector<int> ban[n];
    rep(i,m){
        int a,b;
        cin >> a >> b;
        a--; b--;
        friends[a].push_back(b);
        friends[b].push_back(a);
    }
    rep(i,k){
        int c,d;
        cin >> c >> d;
        c--; d--;
        ban[c].push_back(d);
        ban[d].push_back(c);
    }
    rep(i,n){
        int a;
        int ans = 0;
        queue<int> q;
        vector<int> e(n, INF);
        vector<int> f(n, INF);
        vector<int> b(n, INF);
        e[i] = 0;
        f[i] = 0;
        for(auto a: friends[i]) f[a] = 0;
        for(auto a: ban[i]) b[a] = 0;
        q.push(i);
        while(!q.empty()){
            a = q.front(); q.pop();
            for(auto s: friends[a]){
                if(e[s]!=INF) continue;
                e[s] = 0;
                q.push(s);
                if(f[s]!=INF) continue;
                if(b[s]!=INF) continue;
                ans++;
            }
        }
        cout << ans << " ";
    }
    cout << "" << endl;
    return 0;
}
*/


Measured memory_bytes: 6784
// AOJ 1369: Distribution Center
// 2017.11.3 bal4u@uu

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct { int x, y; } PP;
PP p[100002], p2[100002];
int l[200002], r[200002]; int m;

char buf[20], *bp;
int getint()
{
	int n = 0;
	while (*bp >= '0') n = (n<<3) + (n<<1) + (*bp++ & 0xf);
	return n;
}

#define VMAX 100002
int f[VMAX+1], vmax, vmin;
void distsort()
{
	int i, x;
	PP *pt, *end = p+m;

	memset(f, 0, sizeof(int)*(vmax+1));
	for (pt = p; pt < end; pt++) f[pt->x]++;
	for (i = vmin+1; i <= vmax; i++) f[i] += f[i-1];
	for (i = m-1; i >= 0; i--) x = p[i].x, p2[--f[x]] = p[i];
}

int main()
{
	int n, i, x;
	PP *pt;

	fgets(bp=buf, 20, stdin);
	n = getint(), bp++, m = getint();
	vmin = 100001, vmax = 0;
	pt = p; i = m; while (i--) {
		fgets(bp=buf, 20, stdin);
		pt->x = x = getint(), bp++, pt->y = getint(), pt++;
		if (x < vmin) vmin = x;
		if (x > vmax) vmax = x;
	}
	distsort();

	for (i = 1; i <= n; i++) l[i] = i;
	memcpy(r, l, sizeof(int)*(n+1));

	pt = p2; while (m--) {
		i = pt->y, pt++;
		l[i+1] = l[i], r[i] = r[i+1];
	}
	printf("%d", r[1]-l[1]+1);
	for (i = 2; i <= n; i++) printf(" %d", r[i]-l[i]+1);
	putchar('\n');
	return 0;
}

Measured memory_bytes: 5320
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    vector<int> a = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int k; cin>>k;
    cout<<a[k-1]<<endl;
    return 0;
}

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

int n,q;

int main(){
    cin >> n;
    int a[n];
    for (int i=0;i<n; i++) cin >> a[i];
    cin >> q;
    int b[q];
    for (int i=0;i<q; i++) cin >> b[i];

    int count = 0;
    for (int i=0;i<q;i++){
        for (int j=0;j<n;j++){
            if(b[i] == a[j]){
                count++;
                break;
            }
        }
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
vector<int> v;
int A, B;

bool can(int k) {
    int budget = k;
    ll a; 
    for(int i=0;i<N;i++) {
        ll rem = (ll)v[i] - (ll)k*B;
        if(rem > 0) {
            a = rem/(A-B) + (rem%(A-B)!=0);
            budget -= a; 
            if(budget < 0) return false;
        }
    }
    return budget >= 0;
}

int main() {
    scanf("%d", &N);
    scanf("%d %d", &A, &B);
    v.assign(N, 0);
    for(int i=0;i<N;i++) scanf("%d", &v[i]);
    sort(v.rbegin(), v.rend());
    int lo=0, hi=v[0]/B + 10, mid, ans;
    while(lo<=hi) {
        mid = (lo+hi)/2;
        if(can(mid)) {
            ans = mid;
            hi = mid-1;
        } else {
            lo = mid+1;
        }
    }
    printf("%d\n", ans);

}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;
set<int> a;
int main(){ _;
  int n,tmp;cin>>n;
  REP(i,n){
    cin>>tmp;
    a.insert(tmp);
  }
  cout<<(a.size()-1)/2*2+1<<endl;
}


Measured memory_bytes: 4992
#include<stdio.h>
int main()
{
	int n,i=0,b[4],k=0;
	scanf("%d",&n);
        for(i=0;i<4;i++)
	{
		b[i]=n%10;
		n/=10;
	}
	for(i=0;i<3;i++)
	{
		if(b[i]==b[i+1])
		{
			printf("Bad");
			break;
		}
		else
		{
			k++;
			continue;
		}
	}
	if(k==3)
		printf("Good");
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
struct Edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    Edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<Edge>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reprep(i,j,w,h) rep(j,h)rep(i,w)
#define rrep(i,m, n) for(int i = m; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define VEC(type,name,n) std::vector<type> a(n);rep(i,n)std::cin >> a[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sum accumulate
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<int>(n,a)));
typedef long long ll;
const int INF = 2000000000;
const long INF64 = 1000000000000000ll;
const ll MOD = 1000000007LL;
typedef unsigned int uint;
int main(){
  int n,c,k;
  std::cin >> n>>c>>k;
  VEC(int,a,n);
  sort(all(a));
  int s=a[0],cc=1,counter=1;
  rrep(i,1,n){
    if(a[i]-s>k||cc==c){
      counter++;
      s=a[i];
      cc=1;
    }
    else{
      cc++;
    }
  }
  std::cout << counter << std::endl;
}

Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskX solver = new TaskX();
		solver.solve(1, in, out);
		out.close();
	}

	static int INF = 1 << 30;
	static int MOD = 1000000007;
	static int[] mh4 = { 0, -1, 1, 0 };
	static int[] mw4 = { -1, 0, 0, 1 };
	static int[] mh8 = { -1, -1, -1, 0, 0, 1, 1, 1 };
	static int[] mw8 = { -1, 0, 1, -1, 1, -1, 0, 1 };

	static class TaskX {

		public void solve(int testNumber, InputReader in, PrintWriter out) {

			String s = in.nextString();
			out.println(s.replaceAll(","," "));

		}
	}

	static class InputReader {
		BufferedReader in;
		StringTokenizer tok;

		public String nextString() {
			while (!tok.hasMoreTokens()) {
				try {
					tok = new StringTokenizer(in.readLine(), " ");
				} catch (IOException e) {
					throw new InputMismatchException();
				}
			}
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(nextString());
		}

		public long nextLong() {
			return Long.parseLong(nextString());
		}

		public double nextDouble() {
			return Double.parseDouble(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public long[] nextLongArray(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong();
			}
			return res;
		}

		public InputReader(InputStream inputStream) {
			in = new BufferedReader(new InputStreamReader(inputStream));
			tok = new StringTokenizer("");
		}
	}

}


Measured memory_bytes: 21460
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Security.Policy;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const char White = '.';
    const char Black = '#';
    const long Mod = 1000000007;

    static void Main(string[] args) {
        checked {
#if DEBUG
            MyDebugger.Test(process, "../TextFile1.txt");
            //TestCaseMaker.MakeTestCase1("../TextFile2.txt");
            //MyDebugger.Test(process, "../TextFile2.txt");
#else
            object ret = process(new StreamReader(Console.OpenStandardInput()));
            Console.WriteLine(ret);
#endif
        }
    }

    static object process(TextReader input) {
        var n = int.Parse(input.ReadLine());
        var ary = ToIntArray(input.ReadLine(), 3*n);

        Array.Sort(ary, (x,y) => y.CompareTo(x));

        long sum = 0;
        for(int i=0; i<n; i++) {
            sum += ary[i*2+1];
        }

        return sum;
    }

    static long[] ToIntArray(string strs, int n) {
        var ret = new long[n];
        if(n == 0) return ret;
        var spl = strs.Split(' ');
        for (int i = 0; i < n; i++)
            ret[i] = long.Parse(spl[i]);
        return ret;
    }
}


Measured memory_bytes: 56416
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iostream>

using namespace std;
int main(void){
	int Q;
	long A,B,tmp,ans,minus=0;
	scanf("%d", &Q);
	for(int i=0;i< Q;i++){
		minus=0;
		scanf("%ld%ld",&A,&B);
		tmp = sqrt(A*B);
		if((tmp*tmp == A*B) && (A != B)){
			minus = 1;
		}
		if(tmp * (tmp+1) < A*B){
			ans = 2*tmp -1-minus;
		}else{
			ans= 2*(tmp-1)-minus;
		}
		printf("%ld\n",ans);
	}
	fflush(stdout);

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ll long long int
using namespace std;

int main(void) {
  int n, k;
  cin >> n >> k;
  
  int ans = 0;
  while ( n > 0) {
    n/=k;
    ans++;
  }
  cout << ans << endl;
  
  return 0;
}


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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long

#define MOD 1000000007
#define INF 1000000000000000000LL

using namespace std;

int main(){
  ll n,k;cin>>n>>k;
  vector<ll>a(n);
  rep(i, n)cin>>a[i];
  sort(a.begin(), a.end());

  ll l = -INF, r = INF;

  while(r-l>1){
    ll x = (l+r)/2;
    ll count = 0;
    rep(i, n){
      if(a[i]>=0){

        ll l=-1,r=n;
        while(r-l>1){
          ll m = (l+r)/2;
          // a[i]*a[m]がx以上だとNG
          if(a[i]*a[m]>=x)r=m; else l=m;
        }
        // OKライン(l以下)の中にいる要素数(0-indexなので+1)
        count += (l+1);

      }else{

        ll l=-1,r=n;
        while(r-l>1){
          ll m = (l+r)/2;
          // OK:NGの領域が反転する。
          // a[i]*a[m]<xだとOK、mから見て左の領域から境界値を探す。
          if(a[i]*a[m]<x)r=m; else l=m;
        }
        // OKライン(r以上)の中にいる要素数、rの範囲は1~nなので調整の必要はない。
        // n=5でOKが一つもない時、rは5になる。これは0-indexで考えると配列の外だが、n-rで考えると0になり正しい・
        // また、同様にOKが一だけの時、rは4になる。これは0-indexで考えると配列最終要素だがn-r=1でこれまた正しい。
        count += (n-r);

      }
      if(a[i]*a[i]<x)count--;
    }

    if(count/2>=k)r=x;
    else l=x;

  }

  // lとr、lがOK要素の最終、rがNG要素の最初という具合に境界線を挟んでいる。
  cout<<l;

  return 0;
}


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

int main()
{
    int a , b;
    cin >> a >> b;
    int total = 1;
    int ans = 0;

    while(total < b){
        total--;
        total += a ;
        ans ++;
        
            
            
        
    }
    cout << ans << endl;
}



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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

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;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    int n,l; cin >> n >> l;
    vl a(n);
    rep(i,n) a[i] = l+i;
    ll res = L_INF;
    int idx;
    rep(i,n) {
        if(res>abs(a[i])){
            idx=i;
            res = abs(a[i]);
        }
    }
    cout << accumulate(all(a),0LL) - a[idx] << endl;
}


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

template<class T> inline void chmax(T& a, T b) { if(b > a) a = b; }
template<class T> inline void chmin(T& a, T b) { if(b < a) a = b; }

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

	for(int n; cin >> n, n;) {
		int sum = 0, mx = 0, mn = INT_MAX;
		for(int i = 0; i < n; ++i) {
			int score;
			cin >> score;
			sum += score;
			chmax(mx, score);
			chmin(mn, score);
		}

		cout << (sum - mx - mn) / (n - 2) << endl;
	}

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1192
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll mod = 1e9+7;

int main(){
    for(int i = 0; i < 5; i++){
        int a;
        cin >> a;
        if(a == 0){
            cout << i+1 << endl;
            return 0;
        }
    }
    return 0;
}

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

int main() {
  int n,m,x;
  int a[m];
  cin>>n>>m>>x;
  int l,r;
  l = 0;
  r = 0;
  for(int i=0;i<m;i++){
    int t;cin>>t;
    if (t<x){
      l+=1;
    }
    else{
      r+=1;
    }
  }
  cout << min(l,r) << endl;

  return 0;
}


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

namespace SolutionCS
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');

            int[] v = new int[N];
            for (int i = 0; i < N; i++)
            {
                v[i] = int.Parse(s[i]);
            }

            Array.Sort(v);

            int ans = v[N / 2] - v[N / 2 - 1];

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 17760