akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#if __cplusplus >= 201103L
#include <chrono>
using namespace std::chrono;
#endif
using namespace std;
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pb push_back
#define fi first
#define se second
#ifdef LOCAL
#define prln(x) (cout << #x << ' ' << x << endl)
#define pr(x) (cout << #x << ' ' << x << ' ' )
#define prv(x) (cout << x << ' ')
#else
#define prln(x) 
#define pr(x)
#define prv(x)
#endif
#define clr(x) memset((x), 0, sizeof((x)))
#define clr1(x) memset((x), -1, sizeof((x)))
#define endl "\n"
#define pi acos(-1)
#define rep(i, st, ed) for (int i = (st); i <= (ed); ++i)
#define rep0(i, st, ed) for (int i = (st); i < (ed); ++i)
#define per0(i, st, ed) for (int i = (st); i > ed; --i)
#define per(i, st, ed) for (int i = (st); i >= ed; --i)
#define chmin(a, b) (a = a > b ? b : a)
#define chmax(a, b) (a = a < b ? b : a)
template<class T> void _sf(T &x) {cin >> x;}
void _sf(int &x) {scanf("%d", &x);}
void _sf(ll &x) {scanf("%lld", &x);}
void _sf(double &x) {scanf("%lf", &x);}
void _sf(char &x) {scanf(" %c", &x);}
void _sf(char *x) {scanf("%s", x);}
void sf() {}
template <class T, class...U> void sf(T & head, U&... tail) { _sf(head); sf(tail...);}
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;

int read() {
    int x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {
        if (ch == '-') f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9') {
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    return x * f;
}
const int maxn = 1e5 + 5;
char a[maxn];

int main(){
    #ifdef LOCAL
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
        #if __cplusplus >= 201103L
        auto start = steady_clock::now();
        #endif
    #endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    cin >> a;
    // cout << a << endl;
    int ans = 1;
    for (int i = 1; i < n; ++i) {
        pr(a[i]);prln(a[i - 1]);
        if (a[i] != a[i - 1]) ++ans;
    }
    cout << ans << endl;
    #ifdef LOCAL
        #if __cplusplus >= 201103L
        auto end = steady_clock::now();
        duration<double> time_span = duration_cast<duration<double>>(end - start);;
        printf("Total time: %.6fs\n", time_span.count());
        #endif
    #endif
    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,i,p=1;
	cin>>n;
	int a[n];
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(i=0;i<n;i++)
	{
		if(a[i]%2==0)
		{
			if(a[i]%3==0 || a[i]%5==0)
			continue;
			else
			{
				cout<<"DENIED\n";
				p=0;
				break;
			}
		}
	}
	if(p==1)
	cout<<"APPROVED\n";
	return 0;
	
}

Measured memory_bytes: 256
from itertools import product

s = input()

ans = 0
for i in product([1,0], repeat=len(s)-1):
    p = ""
    for j, x in enumerate(i):
        p += s[j]
        if x == 1:
            p += "+"

    p += s[-1]
    ans += eval(p)

print(ans)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){
long long n,i,j,k,x,count=0;
cin>>n;

for(i=1;i<=n;i++){
for(j=1;j<=n;j++){
for(k=1;k<=n;k++){

x=__gcd(i,j);
x=__gcd(x,k);
count=count+x;}}}
cout<<count;
}

Measured memory_bytes: 3588
#include<iostream>
#include<string>
using namespace std;
int main(){
  string s;
  int n,cou=0;
  cin>>n>>s;
  for(int i=0;i<n-2;++i)
    if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C')
      ++cou;
  cout<<cou<<endl;
}

Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <vector>
#include <map>
#include<cstdio>
#include<functional>
#include <bitset>
#include <iomanip>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define ll long long
using namespace std;
template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }
template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
const ll INF = 1000000000000000000;
const ll MOD = 1e9 + 7;

int gcd(int a, int b)
{
	if (a%b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a%b));
	}
}

int lcm(int a, int b)
{
	return a * b / gcd(a, b);
}

int main()
{
	int n, k;
	cin >> n >> k;
	vector<int> al(n);
	rep(i, n) {
		cin >> al[i];
	}
	int min = *min_element(al.begin(), al.end());
	int count = 0;
	int minc = 0;
	rep(i, n) {
		if (min != al[i])
		{
			count++;
		}
	}
	int ans = count / (k - 1);
	if (count % (k - 1) != 0) {
		ans++;
	}
	cout << ans << endl;
	//cout << fixed << setprecision(10) << ans << endl;
	system("pause");
}



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

using namespace std;
const int N = 3e5 + 5;
int n, a[N];
long long get(int b) {
	long long ret = 0;
	for (int i = 0; i < n; ++i) {
		++b;
		ret += abs(a[i] - b);
	}
	return ret;
}
int main() {
#ifndef ONLINE_JUDGE
//	freopen("input.in", "r", stdin);
#endif
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
		scanf("%d", a + i);
	int lo = -2e5, hi = 1e9;
	long long res = 2e18;
	while (lo <= hi) {
		int mid = lo + (hi - lo) / 2;
		int mid_1 = mid - 1;
		long long d = get(mid), d1 = get(mid_1);
		if (d > d1) {
			hi = mid - 1;
			res = min(res, d1);
		} else {
			lo = mid + 1;
			res = min(res, d);
		}
	}
	printf("%lld\n", res);
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <random>
#include <utility>
#include <string.h>
#include <iomanip>
#include <stdlib.h>
#include <algorithm>
using namespace std;
typedef pair<int,int> P;
int INF = 1<<29;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする
 
long long int i,j;

int main(){
	int n,a;
	cin>>n>>a;
	int x[54];
	for(i=0;i<n;i++){
		cin>>x[i];
	}
	for(i=0;i<n;i++){
		x[i] -= a;
	}
	long long int dp[55][5002];
	// dp[i][j] = i+1番目まででj-2500を作る方法は何通り？
	for(i=0;i<n;i++){
		for(j=0;j<5001;j++){
			dp[i][j]=0;
		}
	}
	dp[0][2500] += 1;
	dp[0][2500 + x[0]] += 1;
	for(i=0;i<n-1;i++){
		for(j=0;j<5001;j++){
			if(j-x[i+1]>=0)dp[i+1][j]= dp[i][j] + dp[i][j-x[i+1]];
			else dp[i+1][j]=dp[i][j];
		}
	}
	cout<<dp[n-1][2500]-1<<endl;

	return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
#define int long long
int MAX=1000000007;



signed main() {
  string l;
  cin>>l;
  
  int q=1,ans=1;
  for(int i=l.size()-1;i>=0;i--){
      if(l[i]=='1'){
          ans=(2*ans+q)%MAX;
      }
      q=(q*3)%MAX;
  }
  cout<<ans;
 
   

      return 0;

}


Measured memory_bytes: 512
inn=int(input())
o=0
i=0
s=[]
sc=0
ba=[]

while i<inn:
  b=input()
  if b == "OUT":
    o+=1
    if o%3 == 0 and o>0:
      s.append(sc)
      sc=0
      i+=1
      o=0
      ba=[]
  elif b == "HIT":
    ba.append(1)
    if len(ba)>=4:
      sc+=1
      ba=[1,1,1]      
  elif b == "HOMERUN":
    ba.append(1)
    sc+=len(ba)
    ba=[]
[print(i) for i in s]


Measured memory_bytes: 5596
use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
  let mut line: String = String::new();
  io::stdin().read_line(&mut line);
  line.trim().parse().ok().unwrap()
}

fn input_int_vec() -> Vec<i32> {
  let mut line: String = String::new();
  io::stdin().read_line(&mut line);
  line.split_whitespace().map(|s| s.parse().unwrap()).collect()
}

fn main() {
  let n: u32 = input();
  let a = input_int_vec();
  let mut sum = 0.0;
  for i in a {
    sum += 1.0 / (i as f64);
  }
  println!("{}", 1.0 / sum);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
string solve(bool a) { return ((a) ? "Yes" : "No"); }
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
template <class T, class U>ostream& operator<<(ostream& os, const pair<T, U>& p) {
	os << "(" << p.first << "," << p.second << ")";
	return os;
}
template <class T>ostream& operator<<(ostream& os, const vector<T>& v) {
	os << "{";
	rep(i, v.size()) {
		if (i) os << ",";
		os << v[i];
	}
	os << "}";
	return os;
}
template <class T, class U>istream& operator>>(istream& is, pair<T, U>& p) {
	is >> p.first >>p.second ;
	return is;
}
template <class T>istream& operator>>(istream& is,  vector<T>& v) {
	rep(i, v.size()) {
		is >> v[i];
	}
	return is;
}
ll mod                = 998244353LL;
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int n,k;
	cin >>n>>k;
	VPi data(k);
	cin >> data;
	V dp(n + 2, 0LL);
	dp[0] = 1LL;
	dp[1] = -1LL;
	rep(i,n){
//		clog << dp << " ";
		rep(j,k){
			if(data[j].F+i<n+2){
				dp[data[j].F + i] += dp[i];
				dp[data[j].F + i] %= mod;
				
				if (data[j].S + i + 1 < n + 2) {
					dp[data[j].S + i + 1] -= dp[i];
					dp[data[j].S + i + 1] %= mod;
				}
			}
		}
		//clog << dp << endl;
		dp[i + 1] += dp[i];
		dp[i + 1] %= mod;
		//dp[i + 2] -= dp[i + 1];
	}

//	clog << dp << endl;

	cout << (dp[n - 1]%mod+mod)%mod << endl;
}

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

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;

#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) (x).begin(),(x).end()
constexpr auto INF = 4000000000; //4*10^9
constexpr auto MOD = 1000000007; //10^9+7


int n, m;
bool bri[100][100];
bool visit[100];
bool all;
int ans = 0;

void dfs(int x) {
	visit[x] = true;
	rep(i, n) if (bri[x][i] == true&&visit[i]==false) dfs(i);
	return;
}

int main() {


	cin >> n >> m;
	rep(i, n)rep(j, n)bri[i][j] = false;
	rep(i, m) {
		int a, b;
		cin >> a >> b;
		a--;b--;
		bri[a][b] = true;
		bri[b][a] = true;
	}
	
	rep(i, n)rep(j, i) {

		if (bri[i][j] == false)continue;

		bri[i][j] = false;
		bri[j][i] = false;
		rep(i, n)visit[i] = false;

		dfs(0);

		all = true;
		rep(i, n)if (visit[i] == false)all = false;
		if (all == false)ans++;
		bri[i][j] = true;
		bri[j][i] = true;
	}

		cout <<ans<<endl;
}

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


int main() {
  double r;
  cin>>r;
  
  
  cout << fixed << setprecision(8);
   cout<<r*r*M_PI<<" "<<2*r*M_PI<<endl;
   
      
    
  
  
}


Measured memory_bytes: 3268
<?php
fscanf(STDIN, "%d %d", $n, $l);
$r = $n * ($n + 1) / 2 + $n * $l - $n;
echo 1 <= 1 - $l && 1 - $l <= $n ? $r : (0 > $l + $n - 1 ? $r - ($l + $n - 1) : $r - $l);
?>


Measured memory_bytes: 3576
import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;

alias sread = () => readln.chomp();
alias Point2 = Tuple!(long, "y", long, "x");

T lread(T = long)()
{
    return readln.chomp.to!T();
}

T[] aryread(T = long)()
{
    return readln.split.to!(T[])();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}

void minAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) min(dst, src);
}

void maxAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) max(dst, src);
}

void main()
{
    long A, B;
    scan(A, B);
    if (A == B)
    {
        writeln("Draw");
        return;
    }
    if (A == 1 || (B != 1 && B < A))
    {
        writeln("Alice");
    }
    else
    {
        writeln("Bob");
    }
}


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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    ll H, W;
    vector<vector<ll>> a;
    vector<tuple<ll, ll, ll, ll>> b;
    cin >> H >> W;
    a.resize(H, vector<ll>(W));
    rep(i, H) rep(j, W) cin >> a[i][j];
    rep(i, H) {
        if(i % 2) {
            per(j, W) {
                if(a[i][j] % 2) {
                    if(!(i == H - 1 && j == 0)) {
                        ll y, x;
                        if(j == 0) {
                            a[i + 1][j] += 1;
                            y = i + 1;
                            x = j;
                        } else {
                            a[i][j - 1] += 1;
                            y = i;
                            x = j - 1;
                        }
                        b.emplace_back(i + 1, j + 1, y + 1, x + 1);
                    }
                }
            }
        } else {
            rep(j, W) {
                if(a[i][j] % 2) {
                    if(!(i == H - 1 && j == W - 1)) {
                        ll y, x;
                        if(j == W - 1) {
                            a[i + 1][j] += 1;
                            y = i + 1;
                            x = j;
                        } else {
                            a[i][j + 1] += 1;
                            y = i;
                            x = j + 1;
                        }
                        b.emplace_back(i + 1, j + 1, y + 1, x + 1);
                    }
                }
            }
        }
    }
    cout << b.size() << endl;
    iter(i, b) cout << get<0>(i) << ' ' << get<1>(i) << ' ' << get<2>(i) << ' ' << get<3>(i) << endl;
    return 0;
}


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

#ifdef LOCAL
#include "../../dump.hpp"
#else
#define dump(...)
#endif

#define int ll
#define rep(i,n) for(int i=0,i##_cond=(n);i<i##_cond;++i)
#define FOR(i,a,b) for(int i=(a),i##_cond=(b);i<i##_cond;++i)
#define ROF(i,a,b) for(int i=(a)-1,i##_cond=(b);i>=i##_cond;--i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで大きい順
#define sz(x) ((int)(x).size())
#define pb push_back
#define fst first
#define snd second
#define mp make_pair
using ll  = long long;
using vi  = vector<int>;
using vvi = vector<vi>;
using vs  = vector<string>;
using pii = pair<int,int>;
constexpr ll inf = 1ll<<61;
constexpr ll mod = 1e9+7;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>void add(T &a, const T &b){a += b; a %= mod;}

signed main(){
  int n, a, b, c, d; cin >> n >> a >> b >> c >> d;
  a--; b--; c--; d--;
  string s; cin >> s;
  if(c < d){ // b -> a
    string t = s;
    t[b] = 'o';
    FOR(i,b+1,d+1){
      if(t[i] == '#') continue;
      if(t[i-1] == 'o') t[i] = 'o';
      if(i-2 >= b and t[i-2] == 'o') t[i] = 'o';
    }
    dump(t);
    if(t[d] != 'o'){
      cout << "No\n";
      return 0;
    }
    t = s;
    t[a] = 'o';
    FOR(i,a+1,c+1){
      if(t[i] == '#') continue;
      if(t[i-1] == 'o') t[i] = 'o';
      if(i-2 >= a and t[i-2] == 'o') t[i] = 'o';
    }
    dump(t);
    if(t[c] != 'o'){
      cout << "No\n";
      return 0;
    }else{
      cout << "Yes\n";
    }
  }else{
    string t = s;
    t[b] = 'o';
    FOR(i,b+1,d+1){
      if(t[i] == '#') continue;
      if(t[i-1] == 'o') t[i] = 'o';
      if(i-2 >= b and t[i-2] == 'o') t[i] = 'o';
    }
    if(t[d] != 'o'){
      cout << "No\n";
      return 0;
    }
    dump(s,t);
    // oのうち1箇所を#にかえて##が連続するか
    bool f = false;
    rep(i,n){
      if(t[i] != 'o') continue;
      dump(i);
      if((i > 0 and t[i-1] != '#') and (i < n-1 and t[i+1] != '#')){
	f = true;
      }
    }
    if(not f){
      cout << "No\n";
      return 0;
    }
    t = s;
    t[a] = 'o';
    FOR(i,a+1,c+1){
      if(t[i] == '#') continue;
      if(t[i-1] == 'o') t[i] = 'o';
      if(i-2 >= a and t[i-2] == 'o') t[i] = 'o';
    }
    dump(t);
    if(t[c] != 'o'){
      cout << "No\n";
      return 0;
    }else{
      cout << "Yes\n";
    }
  }
}


Measured memory_bytes: 772
#include<iostream>

using namespace std;

int main(){
  int n,i;
  int g=0,w=0,y=0,p=0;
  char c[101];
  
  cin>>n;
  for(i=0;i<n;i++)
    cin>>c[i];
  
  for(i=0;i<n;i++){
    if(c[i]=='G')
      g++;
    else if(c[i]=='W')
            w++;
    else if(c[i]=='Y')
            y++;
    else
      p++;
  }
  if(g>0&&w>0&&y>0&&p>0)
    cout<<"Four"<<endl;
  else
    cout<<"Three"<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
static const int MAXN = 54;
static const int ALPHABET = 26;

int n;
char s[MAXN];
int ct[ALPHABET], min[ALPHABET];

int main()
{
    scanf("%d", &n); getchar();
    for (int i = 0; i < ALPHABET; ++i) min[i] = MAXN;
    for (int i = 0; i < n; ++i) {
        scanf("%s", s);
        int len = strlen(s);
        for (int i = 0; i < ALPHABET; ++i) ct[i] = 0;
        for (int j = 0; j < len; ++j) ++ct[s[j] - 'a'];
        for (int j = 0; j < ALPHABET; ++j) min[j] = std::min(min[j], ct[j]);
    }

    for (int i = 0; i < ALPHABET; ++i)
        for (int j = 0; j < min[i]; ++j) putchar('a' + i);
    putchar('\n');

    return 0;
}


Measured memory_bytes: 128
import java.util.*;

public class Main implements Runnable {

    private static int MOD = 1_000_000_007;

    public static void main(String[] args) {
        // Run with 32MB stack
        Thread thread = new Thread(null, new Main(), "", 32 * 1024 * 1024);
        thread.start();
    }

    @Override
    public void run() {
        final Scanner scanner = new Scanner(System.in);
        solve(scanner);
    }

    static void solve(Scanner scanner) {
        int N = Integer.parseInt(scanner.next());
        Set<Integer> set = new HashSet<>();
        set.add(N);
        int cnt = 1;
        while (true) {
            if (N % 2 == 0) {
                N >>= 1;
            } else {
                N *= 3;
                N++;
            }
            if (!set.add(N)) {
                break;
            }
            cnt++;
        }
        System.out.println(cnt + 1);
    }
}



Measured memory_bytes: 23892
import java.util.Scanner;

class Main{
	static int mod = 1000000000 + 7;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()) {
			int H = sc.nextInt(), W = sc.nextInt();
			int[][] dp = new int[H + 1][W + 1];
			for(int i = 0; i < H; i++) {
				String s = sc.next();
				for(int j = 0; j < W; j++) {
					if(s.charAt(j) == '#') dp[i][j] = -1;
				}
			}
			dp[0][0] = 1;
			for(int i = 0; i < H; i++) {
				for(int j = 0; j < W; j++) {
					if(dp[i][j] == -1) continue;
					if(dp[i + 1][j] != -1) {
						dp[i + 1][j] += dp[i][j];
						dp[i + 1][j] %= mod;
					}
					if(dp[i][j + 1] != -1) {
						dp[i][j + 1] += dp[i][j];
						dp[i][j + 1] %= mod;
					}
				}
			}
			System.out.println(dp[H - 1][W - 1] % mod);
		}
	}
}

Measured memory_bytes: 33364
// warm heart, wagging tail,and a smile just for you!
//
//                            ▒█████▒▒
//                             ██████████▒
//                             ▒████████████▒
//                            ██████████████████
//                           ████████████████████▒
//                          ▒██████████████████████▒
//                          ▒███████████████████████
//                      ▒████▒▒▒▒▒▒█████████████████▒
//                    ███▒▒▒▒▒▒██████████████████████▒▒▒
//                  ▒██▒▒███████████████████████▒▒▒▒▒██████
//                 ▒█████████████████████████▒▒▒▒▒▒█████████▒
//                 ▒█████████████████████▒▒▒▒▒▒██████████████
//                  ▒████         ████▒▒▒▒▒████         ████▒
//              ▒█████▒    ████    ▒▒▒▒███████    ████    ██████▒
//            ▒██▒▒▒▒▒    ██████    █████████    ██████    ██▒▒▒██▒
//           █████████   ████████   █████████   ████████   ▒▒▒▒█████
//          ▒█████████    ██████    ████████▒    ██████    █████████
//          ▒██████████    ████    █████▒▒▒▒▒▒    ████    ██████████
//           ████████████        ▒▒▒▒▒▒▒████████        ███████████▒
//       ▒██████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒███████████████████████████████████▒
//     ███▒▒▒▒▒▒▒▒▒▒▒▒█████████████████████████████████████████▒▒████████▒
//   ▒▒▒▒▒▒▒▒▒██████████████                         ███████▒▒▒▒███████████
//   █████████████████████████                     ███████▒▒▒██████████████▒
//   █████████████████████████████             ███████▒▒▒██████████████████▒
//   ██████████████████████████████████████████████████████████████████████
//    ██████████████████████████████████████████████████████████████████▒
//      ▒█████████████████▒▒▒▒▒▒▒██████████████████████████████████▒▒▒
//
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
const double EPS = 1e-9;
#define INF (1LL<<60)
#define D double
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for(int i = (b-1);i>=(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

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

  int n,m;
  cin >> n >> m;

  int ans = 0;
  priority_queue<int> que;

  vector<P> a(n);
  REP(i,n){
    cin >> a[i].fs >> a[i].sc;
  }

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

  int id = 0;
  FOR(i,1,m+1){
    while(id < n && a[id].fs == i) que.push(a[id].sc),id++;
    if(que.size()){
      ans += que.top();
      que.pop();
      
    }//debug(ans);
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 2936
#include <stdio.h>
int main(
){
    int a,b,c,i,min=0,profit=0;
    scanf("%d",&a);
    scanf("%d",&b);
    scanf("%d",&c);
    profit = c-b;
    if(c<b){
        min=c;
    } else{
        min=b;
    }
    
    for(i=2;i<a;i++){
        scanf("%d",&b);
        if(profit < b - min){
            profit = b - min;
	}
        if(min > b){
            min = b;
	}
    } 
    printf("%d\n",profit);
    return 0;
}



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

#define DEBUG(x) cerr << #x << ": " << x << endl;
#define ll long long

int main() {
    string o, e;
    cin >> o >> e;

    int strLen = o.size() + e.size();
    int oo = 0, ee = 0;
    for (int i = 0; i < strLen; i++) {
        if (i & 1) {
            cout << e[ee++];
        } else {
            cout << o[oo++];
        }
    }
    cout << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>

int main()
{
  int n;
  int a;
  int d[120] = {0};

  std::cin >> n;
  for (int i = 0; i < n; ++i) {
    std::cin >> a;
    d[a]++;
  }
  int count = 0;
  for (int i = 0; i <= 100; ++i) {
    if (d[i] > 0) {
      count++;
    }
  }
  std::cout << count << std::endl;

  return 0;
}


Measured memory_bytes: 256
// STRIVER_79 
// Lets goto the next level 
// AIM 6* at CC and CM at CF *__* 

#include <algorithm>
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define mod (int)(1e9 + 21)
#define all(a) a.begin(),a.end()
#define for0(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define loop(i,a,b) for (int i = a; i < b; i++)
#define bloop(i,a,b) for (int i = a ; i>=b;i--)
#define tc(t) int t; cin >> t; while (t--)
#define int long long
#define ll long long 
#define pb emplace_back
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL)
#define in(x) scanf("%intd", &x)
#define rr return 0
#define prec(n) fixed<<setprecision(n)
#define maxheap priority_queue<int>
#define minheap priority_queue<int, vector<int>, greater<int> >
#define inf (int)(1e18)
#define ini(a, i) memset(a, i, sizeof(a))
#define fi first
#define se second
#define kitna se
#define endl "\n"
#define pi pair<int, int>
#define LL long long 
const int MAXN = (int)((1e5) + 10);
int gcd(int a,int b) { if (a == 0) return b; return gcd(b%a, a);}
int max(int a,int b){if(a>b) return a; else return b;}
int min(int a,int b){if(a<b) return a; else return b;}  
bool isPrime(int N){ for(int i=2;i*i<=N;++i){if(N%i==0) return false;}return true;}
int cbrt(int x){ int lo=1,hi=min(2000000ll,x);while(hi-lo>1){int mid=(lo+hi)/2;if(mid*mid*mid<x){lo=mid;}else hi=mid;}if(hi*hi*hi<=x) return hi;else return lo;} 
const int dx[4] = {-1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
const int nax =  (int)(1*1e5+10);

// int SPF[N+5];

// void SOF()
// {
//     SPF[1] = 1;
//     for (int i=2; i<N; i++)
//         SPF[i] = i;
//     for (int i=4; i<N; i+=2)
//         SPF[i] = 2;
 
//     for (int i=3; i*i<N; i++)
//         {
//         if (SPF[i] == i)
//             {
//             for (int kon=i*i; kon<N; kon+=i)
//                 if (SPF[kon]==kon)
//                    SPF[kon] = i;
//             }
//         }
// }
int a[nax];
int n; 
int dp[nax]; 
int k;
int func(int ind)
{
	if(ind==(n-1))
		return 0;
	else if(dp[ind]!=-1) return dp[ind];
	else
	{
		int ans = 1e9+5; 
		for(int i = 1;i<=k;i++)
		{
			if(ind+i<n)
				ans = min(ans,abs(a[ind+i]-a[ind]) + func(ind+i));

		}
		return dp[ind] = ans; 
	}

}





signed main(){

int t=1; 
//cin >> t;
// string s; 
// getline(cin,s);

while(t--)
{
    cin >> n >> k;
    for0(i,n) cin >> a[i]; 	
    ini(dp,-1); 
    cout << func(0); 

}

rr;
}


Measured memory_bytes: 11364
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <stdlib.h>
#include <set>
typedef long long ll;
using namespace std;

int main() {
	int a,b,c,w;
	cin>>a>>b>>c;
	w=c-(a-b);
	if(w>=0){
		cout<<w<<endl;
	}else{
		cout<<0<<endl;
	}
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
void Digvijay()
{
    int n;
    cin>>n;
    vector<int> a(n);
    int ans=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        if((i+1)&1&&a[i]&1)ans++;
    }
    cout<<ans<<"\n";
}
signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int _=1;
    //cin>>_;
    for(int __=1;__<=_;__++)
    {
        Digvijay();
    }
}



Measured memory_bytes: 3580
#[allow(unused_imports)]
use proconio::{
    fastout, input,
};

#[fastout]
fn main() {
    input! {
        arr: [i32; 5]
    }
    if let Some(ans) = arr.iter().position(|&x| x == 0) {
        println!("{}", ans + 1);
    } 
}


Measured memory_bytes: 2200
MAX=101010
is_prime=[True]*MAX
is_prime[0]=False
is_prime[1]=False
for i in range(2,MAX):
  if is_prime[i]==False:
    continue
  for j in range(i*2,MAX,i):
    is_prime[j]=False

a=[0]*MAX
for i in range(MAX):
  if i%2==0:
    continue
  if is_prime[i] and is_prime[(i+1)//2]:
    a[i]=1

s=[0]
for x in a:
  s.append(s[-1]+x)

Q=int(input())
for _ in range(Q):
  l,r=map(int,input().split())
  print(s[r+1]-s[l])


Measured memory_bytes: 13204
#include <stdio.h>

int main(void)
{
	int i;
	int a[10000], b[10000];
	int n;
	int ans_a, ans_b;
	
	while (1){
		
		ans_a = 0;
		ans_b = 0;
		
		scanf("%d", &n);
		
		if (n == 0){
			break;
		}
		
		for (i = 0; i < n; i++){
			scanf("%d %d", &a[i], &b[i]);
		}
		
		for (i = 0; i < n; i++){
			if (a[i] > b[i]){
				ans_a += (a[i] + b[i]);
			}
			else if (a[i] < b[i]){
				ans_b += (a[i] + b[i]);
			}
			else {
				ans_a += a[i];
				ans_b += b[i];
			}
		}
		printf("%d %d\n", ans_a, ans_b);
	}
	return (0);
}

Measured memory_bytes: 1104
import math

# 逆元を利用した組み合わせの計算
#############################################################
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

mod = 10**9 + 7
N = 10**6

# 元テーブル
g1 = [1, 1]
# 逆元テーブル
g2 = [1, 1]
# 逆元テーブル計算用テーブル
inverse = [0, 1]

for i in range(2, N + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)
#############################################################

# Nの素因数分解を辞書で返す
#############################################################
def prime_fact(n):
    root = int(math.sqrt(n))
    prime_dict = {}
    for i in range(2, root + 1):
        cnt = 0
        while n % i == 0:
            cnt += 1
            n = n // i
        if cnt:
            prime_dict[i] = cnt
    if n != 1:
        prime_dict[n] = 1
    return prime_dict
#############################################################

N, M = map(int, input().split())
# Mを素因数分解
prime = prime_fact(M)
ans = 1
# Mがある素数pをv個持っていたとする
# a_1, ..., a_N に ちょうどv個を分配する
# v個のボールとN-1本の仕切りの並べ方に相当し、これは (N+v-1)_C_v 通り
for v in prime.values():
    ans *= cmb(N + v - 1, v, mod)
    ans %= mod
print(ans)


Measured memory_bytes: 213232
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
typedef vector<int> vi;
#define endl '\n'
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define rf(i,a,b) for(int i=a;i>=b;i--) 
#define fast_io ios_base::sync_with_stdio(0);
#define show(x) cout<<x<<endl;
#define pret(x) cout<<x<<endl; return 0;
#define disp(x) cout<<x<<" ";
#define let(x,y) cout<<x<<" "<<y<<endl;
ll MOD=1e9+7;
const int maxn=2e5+5;

int32_t main(){
    fast_io;
    int x;
    cin>>x;
    int curr = 0;
    fo(i,1,10000){
    	curr += x;
    	if(curr % 360 == 0) {
    		show(i);
    		return 0;
    	}
    }
    return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
//#define ivorysi
using namespace std;
typedef long long int64;
template<class T>
void read(T &res) {
    res = 0;char c = getchar();T f = 1;
    while(c < '0' || c > '9') {
	if(c == '-') f = -1;
	c = getchar();
    }
    while(c >= '0' && c <= '9') {
	res = res * 10 + c - '0';
	c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
	out(x / 10);
    }
    putchar('0' + x % 10);
}
int64 A,B,C,K;
void Solve() {
    read(A);read(B);read(C);read(K);
    if(K & 1) {out(B - A);enter;}
    else {out(A - B);enter;}
}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <numeric>
using namespace std;
int main(){
int n;
  cin >> n;
  int a[n];
  for (int i=0;i<n;i++)cin >>a[i];
  int ans=a[0],tmp,r;
  for (int i=1;i<n;i++){
    if(ans<a[i]){
    	tmp = ans;
    	ans = a[i];
    	a[i]=tmp;
  	}
 	r=ans%a[i];
  	while(r!=0){
    ans = a[i];
    a[i] = r;
    r = ans % a[i];
  	}
    ans=a[i];
  }
  cout << ans <<endl;
}

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

#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y
//#define CPP_STR(x) CPP_STR_I(x)
//#define CPP_STR_I(args...) #args
//#define ASSERT(expr...) assert((expr))

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
//using f80 = __float80;

constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
constexpr char EL[] = "\n";

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(),(x).end()
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
#define UNIQUE(x) (x).erase(unique(all(x)), (x).end());
#define REPIT(x) for(auto it=(x).begin(), end=(x).end(); it!=end; ++it)
#define perm(c) sort(all(c)); for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

template<typename T = i64>
T IN() { T x; cin >> x; return (x); }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T(&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp = less<>>
bool chmax(T& xmax, const U& x, Comp comp = {}) {
	if (comp(xmax, x)) {
		xmax = x;
		return true;
	}
	return false;
}
template<typename T, typename U, typename Comp = less<>>
bool chmin(T& xmin, const U& x, Comp comp = {}) {
	if (comp(x, xmin)) {
		xmin = x;
		return true;
	}
	return false;
}

void print() {
  cout << EL;
}
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(tail) != 0) cout << " ";
  print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
  for (auto& a : vec) {
	cout << a;
	if (&a != &vec.back()) cout << " ";
  }
  cout << EL;
}
template <class T>
void print(vector<vector<T>> &df) {
  for (auto& vec : df) {
	print(vec);
  }
}

struct ProconInit {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	ProconInit() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH)
			cout << unitbuf;
	}
} PROCON_INIT;
#pragma endregion

signed solve()
{
	string sa, sb, sc;
	cin >> sa >> sb >> sc;
	char target = 'a';
	while (SIZE(sa) >= 0 && SIZE(sb) >= 0 && SIZE(sc) >= 0)
	{
		if (target == 'a')
		{
			if (SIZE(sa) == 0)
			{
				print('A');
				break;
			}
			target = sa[0];
			sa = sa.substr(1, SIZE(sa));
		}
		else if (target == 'b')
		{
			if (SIZE(sb) == 0)
			{
				print('B');
				break;
			}
			target = sb[0];
			sb = sb.substr(1, SIZE(sb));
		}
		else if (target == 'c')
		{
			if (SIZE(sc) == 0)
			{
				print('C');
				break;
			}
			target = sc[0];
			sc = sc.substr(1, SIZE(sc));
		}
	}
	return 0;
}

#ifndef LOCALCODE
signed main()
{
	return solve();
}
#endif


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());

        for (int i = 1; i <= N; i++) {
            if ((int) (i * 1.08) == N) {
                System.out.println(i);
                return;
            }
        }
        System.out.println(":(");
    }
}


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

using namespace std;

int n, q;

string sir;

char t[200001], d[200001];


int isOutLeft(int mij)
{
    if(mij == n + 1)
        return 0;

    for (int j = 0; j < q; j++)
    {
        if(t[j] == sir[mij - 1])
        {
            if(d[j] == 'R')
                mij++;
            else
                mij--;
        }

        if(mij == n + 1)
            return 0;

        if(mij == 0)
            return 1;
    }

    return 0;
}

int BinarySearchLeft(int st, int dr)
{
    int ans;
    while(dr > st + 1)
    {
        int mij = (st + dr) / 2;

        if (isOutLeft(mij) || mij == 0)
            st = mij;
        else
            dr = mij;
    }

    ans = dr;
    return ans;
}


int isOutRight(int mij)
{
    if(mij == 0)
        return 0;

    for (int j = 0; j < q; j++)
    {
        if(t[j] == sir[mij - 1])
        {
            if(d[j] == 'R')
                mij++;
            else
                mij--;
        }

        if(mij == 0)
            return 0;

        if(mij == n + 1)
            return 1;
    }

    return 0;
}

int BinarySearchRight(int st, int dr)
{
    int ans;
    while(dr > st + 1)
    {
        int mij = (st + dr) / 2;

        if (isOutRight(mij) || mij == n + 1)
            dr = mij;
        else
            st = mij;
    }

    ans = dr;
    return ans;
}

int main()
{

    cin >> n >> q;
    cin >> sir;

    for(int i = 0; i < q; i++)
        cin >> t[i] >> d[i];

    int l = BinarySearchLeft(0, n + 1);
    int r = BinarySearchRight(0, n + 1);

    cout << r - l;

    return 0;
}


Measured memory_bytes: 900
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <utility>
#include <algorithm>
using namespace std;


int main(){
    
    int n;
    cin>>n;
    vector<int> p(n);
    for(int i=0; i<n; i++){
        cin>>p[i];
    }
    
    int cnt=0;
    for(int i=1; i<n-1; i++){
        
        if(p[i-1]>p[i]&&p[i]>p[i+1])
            cnt++;
            
        if(p[i-1]<p[i]&&p[i]<p[i+1])
            cnt++;
    }
    
    cout<<cnt<<endl;
}


Measured memory_bytes: 384
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use itertools::Itertools;
use std::process::exit;
use std::cmp::*;
use num::*;
use num::integer::Roots;
use std::str::FromStr;
use std::io::stdin;

fn main(){
    input! {
    a:String,
    b:usize,
    }
    let mut v=HashSet::new();
    let mut w:Vec<String>=Vec::new();
    let mut a=a.chars().collect_vec();
    for i in 0..a.len(){
        for j in i..min(a.len(),i+5){
            let mut z=v.len();
            let mut g =Vec::new();
            for k in i..=j{
                g.push(a[k])
            }
            let h:String=g.iter().collect();
            let g=g.iter().collect();
            v.insert(h);
            if v.len()!=z{
                w.push(g);
            }
        }
    }
    w.sort();
    println!("{}",w[b-1])
}


Measured memory_bytes: 4520
#include<stdio.h>
#include<map>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<utility>
#include<string.h>
#include<string>
#define n 200000
#define loop(a, b) for(int i=a; i<=b; i++)
using namespace std;
typedef pair<int, int> P;
typedef long long lli;
typedef double llf;
bool visit[n + 50];
int arr[n + 50], a, b, c, d, e;
string str1, str2;
struct edge{
	int from, to, weight;
	bool operator < (const edge& thing) const
	{
		return thing.weight < weight;
	}
};
vector<edge> V[n + 50];
void addedge(int a, int b, int c)
{
	edge temp;
	temp.from = a;
	temp.to = b;
	temp.weight = c;
}

////////////////////////////////////////

void solve()
{
	cin >> a >> b;
	if(b == 1) cout << "0";
	else
	{
		b --;
		if(b % (a - 1) == 0)
		{
			printf("%d\n",b / (a - 1));
		}
		else
		{
			printf("%d\n",b / (a - 1) + 1);
		}
	}
	
}
int main()
{
	int times = 1;
//	cin >> times;
	loop(0, times - 1)
	{
		solve();
		printf("\n");
	}
	return 0;
}


Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
     
     
typedef long long ll;
typedef vector <int> vi;
typedef pair <int,int> pi;
typedef tuple <int,int,int> ti;

#define forn(i,a,n) for(int i = a; i < n ; i++)
#define mem(str,a) memset(str, a, sizeof(str));
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(nullptr)
const int MOD = 1e9+7, N = 1e7 + 10, E = 1e-9;
/*
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
//vector <int> show;
//for (auto x : show)
//   cout << x << " ";
getline(cin,s);


*/

int main() {
    int n;
    cin >> n;
    cout << (n*800)-(n/15*200) << endl;
    return 0;
}


Measured memory_bytes: 256
package main

import(
    "fmt"
)



func main() {
    var n,l int
    fmt.Scan(&n,&l)
    mi := 100000
    sum := 0
    for i:=0; i<n; i++{
        sum += l+i
        if abs32(l+i) < abs32(mi){
            mi = l+i
        }
    }
    fmt.Println(sum-mi)
}





func abs32(a int) int {
    if a<0{
        return -a
    }
    return a
}

func abs64(a int64) int64 {
    if a<0{
        return -a
    }
    return a
}

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

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

func min64(a, b int64) int64 {
    if a >= b {
        return b
    }
    return a
}

func max64(a, b int64) int64 {
    if a >= b {
        return a
    }
    return b
}

func gcd(a, b int64) int64 {
    if a % b == 0 {
        return b
    } else {
        return gcd(b, a%b)
    }
}

func lcm(a, b int64) int64 {
    return a / gcd(a, b) * b
}


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

int main() {
  int n, l;
  cin >> n >> l;
  int aji = 0;
  int b = 1000000;
  rep(i,n) {
    int a;
    a = l + i;
    aji += a;
    if(abs(a) <= abs(b)) b = a;
  }
  cout << aji - b << endl;
  return 0;
}


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

struct vec{
    double x,y;
    vec operator-(vec b){
        vec& a = *this;
        vec c;
        c.x=a.x-b.x;c.y=a.y-b.y;
        return c;
    }
};

const double eps = 0.0000001;

double inner_product(vec& a, vec& b){
    return a.x*b.x+a.y*b.y;
}

double outer_product(vec& a, vec& b){
    return a.x*b.y-a.y*b.x;
}

int ccw(vec& a, vec& b, vec& c){
    vec ab = b-a, ac = c-a;
    double o = outer_product(ab,ac);
    if(o>0) return 1; //CCW
    if(o<0) return -1; //CW
    if(inner_product(ab,ac)<0){
        return 2; //C-A-B
    }else{
        if(inner_product(ab,ab)<inner_product(ac,ac)){
            return -2; //A-B-C
        }else{
            return 0; //A-C-B
        }
    }
}

bool isInterSection(vec (&p)[4]){
    switch(ccw(p[0],p[1],p[2])*ccw(p[0],p[1],p[3])){
        case -1:
        case -4:
        case 0:
            break;
        default:
            return false;
    }
    switch(ccw(p[2],p[3],p[0])*ccw(p[2],p[3],p[1])){
        case -1:
        case -4:
        case 0:
            break;
        default:
            return false;
    }
   return true;
}

int main(void){
    vec p[4];
    int q;
    cin >> q;
    while(q--){
        for(auto& v : p) cin >> v.x >> v.y;
        if(isInterSection(p)) cout << 1 << endl;
        else cout << 0 << endl;
    }
    return 0;
}

Measured memory_bytes: 3176
#include "bits/stdc++.h"
using namespace std;
long long gcd(long long a, long long b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
	long long g = gcd(a, b);
	return a / g * b; //オーバーフローに注意
}

int main() {
    long long N, M;
    cin >> N >> M;

    string S, T;
    cin >> S >> T;

    long long A = lcm(N, M);
    long long S1 = A / N;
    long long T1 = A / M;
    long long B = lcm(S1, T1);
    bool flag = true;
    for (long long i = 0; i < A; i += B) {
        if (S[i / S1] != T[i / T1]) {
            flag = false;
        }
    }

    if (flag) {
        cout << A << endl;
    }
    else {
        cout << "-1" << endl;
    }
}

Measured memory_bytes: 512
import sys

#argv=sys.argv

#print(argv)

argv=input()
argv1,argv2=argv.split(" ")

argv=input()
a=argv.split(" ")

n=int(argv1)
x=int(argv2)

aa=[]
for i in a:
    aa.append(int(i))

ai=0
count=1
for i in aa:
    ai+=i
    if ai<=x:
        count+=1


print(count)


Measured memory_bytes: 3060
#include <iostream>
#include <iomanip>
#include <string>
#include <stack>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <iterator>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <regex>
using namespace std;
using pii  = pair<int,int>;
using ll=long long;
using ld=long double;
#define pb push_back
#define mp make_pair
#define sc second
#define fr first
#define stpr setprecision
#define cYES cout<<"YES"<<endl
#define cNO cout<<"NO"<<endl
#define cYes cout<<"Yes"<<endl
#define cNo cout<<"No"<<endl
#define rep(i,n) for(ll i=0;i<(n);++i)
#define Rep(i,a,b) for(ll i=(a);i<(b);++i)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define rRep(i,a,b) for(int i=a;i>=b;i--)
#define crep(i) for(char i='a';i<='z';++i)
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define ALL(x) (x).begin(),(x).end()
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define endl '\n'
int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}
ll gcd(ll a,ll b){return (b == 0 ? a : gcd(b, a%b));}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
constexpr ll MOD=1000000007;
constexpr ll INF=1000000011;
constexpr ll MOD2=998244353;
constexpr ll LINF = 1001002003004005006ll;
constexpr ld EPS=10e-8;
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> istream& operator>>(istream& is,vector<T>& v){for(auto&& x:v)is >> x;return is;}
template<typename T,typename U> istream& operator>>(istream& is, pair<T,U>& p){ is >> p.first; is >> p.second; return is;}
template<typename T,typename U> ostream& operator>>(ostream& os, const pair<T,U>& p){ os << p.first << ' ' << p.second; return os;}
template<class T> ostream& operator<<(ostream& os, vector<T>& v){
  for(auto i=begin(v); i != end(v); ++i){
    if(i !=begin(v)) os << ' ';
    os << *i;
  }
  return os;
}

ll A,B,C,D,E,F,H,K,L,M,N,P,Q,R,W,X,Y,Z;
string S,T;
ll V[100007];

int main(){
    cin >> A >>B >> C;
    cout << (A+B+C>=22 ? "bust" : "win") << endl;
}

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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		String str = input.readLine();
		String[] list = str.split(" ");
		if(list[0].equals(list[1])) {
			System.out.println(list[2]);
		}else if(list[0].equals(list[2])) {
			System.out.println(list[1]);
		}else {
			System.out.println(list[0]);
		}
	}
}


Measured memory_bytes: 23124