akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5 + 5;
const int INF = 1e8;
const double PI = acos(-1.0);
 
int b[N];
 
inline void umax(int& a, int b)
{
	if (b > a) a = b;
}
 
struct Node{
	int x, y;
	bool operator<(const Node& o) const
	{
		if (x == o.x) return y < o.y;
		return x < o.x;
	}
}a[N];
 
struct BIT{
	int dp[N];
	int n;
	void init(int _n)
	{
		n = _n;
		memset(dp, 0, sizeof dp);
	}
	void modify(int i, int val)
	{
		for (; i <= n; i += i & -i) umax(dp[i], val);
	}
	int query(int i)
	{
		int ret = 0;
		for (; i; i -= i & -i) umax(ret, dp[i]);
		return ret;
	}
}bit;
 
int main()
{
	int x1, y1, x2, y2; scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
	if (x1 > x2) swap(x1, x2), swap(y1, y2);
	int flag = 0;
	if (y1 > y2)
	{
		y1 = INF - y1, y2 = INF - y2;
		flag = 1;
	}
	int n, cnt = 0; scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		int x, y; scanf("%d%d", &x, &y);
		if (flag) y = INF - y;
		if (x >= x1 && x <= x2 && y >= y1 && y <= y2)
		{
			a[cnt] = Node{x, y};
			b[cnt++] = y;
		}
	}
	sort(a, a + cnt);
	sort(b, b + cnt);
	bit.init(cnt);
	for (int i = 0; i < cnt; i++)
	{
		int k = lower_bound(b, b + cnt, a[i].y) - b;
		bit.modify(k + 1, bit.query(k) + 1);
	}
	int maxv = bit.query(cnt);
	double ans = (x2 - x1 + y2 - y1) * 100.0 + maxv * (5 * PI - 20);
	if (maxv == min(x2 - x1, y2 - y1) + 1) ans += 5 * PI;
	printf("%.15f\n", ans);
	return 0;
}

Measured memory_bytes: 3456
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] array = new int[n];
		int count = 0;

		for(int i = 0; i < n; i++) {

			array[i] = sc.nextInt();

		}

		for(int i = 1; i < n; i++) {

			for(int j = n - 1; j >= i; j--) {

				if(array[j - 1] > array[j]) {

					int temp = array[j];
					array[j] = array[j - 1];
					array[j - 1] = temp;
					count++;
				}

			}

		}

		printArray(array);
		System.out.println(count);

	}

	static void printArray(int[] array) {

		for(int i = 0; i < array.length - 1; i++) {
			System.out.print(array[i] + " ");
		}

		System.out.println(array[array.length - 1]);
	}

}


Measured memory_bytes: 26192
#include <iostream>
using namespace std;
int main(void){
    int a;
    
    for(int i=1; i<=10000; i++){
        cin >> a;
        
        if(a==0){
            break;
        }
        
        cout << "Case " << i << ": "<< a << endl;
        
        
        
        }
    }


Measured memory_bytes: 2996
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

use std::cmp::min;

fn main() {
    let n: usize = read();
    let s: Vec<char> = read::<String>().chars().collect();
    let mut minv = std::i64::MAX;

    let mut wcnt = vec![0; n];
    let mut cnt = 0;

    for i in 0..n {
        if s[i] == 'E' {
            cnt += 1;
        }
        wcnt[i] = cnt;
    }

    let mut ecnt = vec![0; n];
    let mut cnt = 0;
    for i in (0..n).rev() {
        if s[i] == 'W' {
            cnt += 1;
        }
        ecnt[i] = cnt;
    }

    for i in 0..n {
        minv = min(minv, n as i64 - wcnt[i] - ecnt[i]);
    }
    println!("{}", minv);
}


Measured memory_bytes: 14588
#include <bits/stdc++.h>
using namespace std;
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=998244353;

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

const char cs[] = {'R','G','B'};

signed main(){
	int n,cnt[8] = {},ans = 1;
	string s;
	cin >> n >> s;
	cnt[0] = n;
	for(int i = 0;i < 3 * n;i++){
		for(int j = 0;j < 3;j++){
			if(s[i] == cs[j]){
				if(cnt[7 & ~(1 << j)]){
					(ans *= cnt[7 & ~(1 << j)]) %= MOD;
					cnt[7 & ~(1 << j)]--;
				}else{
					if(cnt[1 << ((j + 1) % 3)]){
						(ans *= cnt[1 << ((j + 1) % 3)]) %= MOD;
						cnt[1 << ((j + 1) % 3)]--;
						cnt[(1 << ((j + 1) % 3)) | (1 << j)]++;
					}else if(cnt[1 << ((j + 2) % 3)]){
						(ans *= cnt[1 << ((j + 2) % 3)]) %= MOD;
						cnt[1 << ((j + 2) % 3)]--;
						cnt[(1 << ((j + 2) % 3)) | (1 << j)]++;
					}else{
						(ans *= cnt[0]) %= MOD;
						cnt[0]--;
						cnt[1 << j]++;
					}
				}
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 900
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<algorithm>
#include<numeric>
#include<math.h>

#define reps(i, j, k) for (int i = (j); i < (k); i++)
#define rep(i, j) reps(i, 0, j)
#define fs first
#define sc second
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;

const int mod = 1e9 + 7;
const long double pi = 3.141592653589793238462643383279502884197;
const long double eps = 1e-7;

bool f[100001];
int c[100002];
int N, L, R;

int main() {
	// 素数であるかどうか
	//   false: 素数である
	//   true : 素数でない
	for (int i = 2; i <= 100000; i++) {
		if (!f[i]) {
			for (int j = i + i; j <= 100000; j += i) {
				f[j] = true;
			}
		}
	}

	// 2017-like numberであるかどうか
	for (int i = 3; i <= 100000; i += 2) {
		if (!f[i] && !f[(i + 1) / 2]) c[i]++;
	}

	// 累積和
	for (int i = 3; i <= 100000; i++) {
		c[i] += c[i - 1];
	}

	scanf("%d", &N);
	vi result;
	while (N--) {
		scanf("%d %d", &L, &R);
		printf("%d\n", c[R] - c[L - 1]);
	}

	return 0;
}


Measured memory_bytes: 1528
list1 = list(input())
maxlen = 0
count = 0
for i in range(len(list1)):
    if list1[i] == "A" or \
    list1[i] == "T" or \
    list1[i] == "C" or \
    list1[i] == "G":
        count += 1
    else:
        maxlen = max(maxlen,count)
        count = 0
maxlen = max(maxlen,count)
print(maxlen)

Measured memory_bytes: 38384
/********************************************
 *Author*        :ZZZZone
 *Created Time*  : 日  3/11 21:07:02 2018
 * Ended  Time*  : 五  3/23 15:31:02 2018
*********************************************/

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <stack>
using namespace std;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;
const int MAXN = 3e5;

inline void OPEN(string s){
	freopen((s + ".in").c_str(), "r", stdin);
	freopen((s + ".out").c_str(), "w", stdout);
}

LL n, a, b;

void solve()
{
    if(a+b>n+1||a*b<n)///第一个条件很容易知道 第二个条件就写写找找看吧。。
    {
        cout<<-1;
        return ;
    }
    while(n>0)///每轮都是构造一个递增的子序列
    {
        LL x=min(a,n-b+1);///每一轮都取递增数和递减数中较小的那个
        //cout<<"x="<<x<<endl;
        for(LL i=n-x+1;i<=n;i++)
            cout<<i<<" ";
        n-=x;///x 为这一轮构造的递增子序列的个数
        b--;///递减的值 b 每一轮 -1
    }
}
int main()
{
    while(cin>>n>>a>>b)
    {
        solve();
        cout<<endl;
    }
    return 0;
}




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

int n;
string s;

int main(void){
  cin >> n;
  cin >> s;
  int x = 0;
  int xmax = 0;
  for(int i = 0; i < n; i++){
    if(s[i] == 'I'){
      x++;
    }
    else{
      x--;
    }
    xmax = max(xmax, x);
  }
  cout << xmax << endl;
}


Measured memory_bytes: 256
# Dinic's algorithm
from collections import deque
class Dinic:
    def __init__(self, N):
        self.N = N
        self.G = [[] for i in range(N)]

    def add_edge(self, fr, to, cap):
        forward = [to, cap, None]
        forward[2] = backward = [fr, 0, forward]
        self.G[fr].append(forward)
        self.G[to].append(backward)

    def add_multi_edge(self, v1, v2, cap1, cap2):
        edge1 = [v2, cap1, None]
        edge1[2] = edge2 = [v1, cap2, edge1]
        self.G[v1].append(edge1)
        self.G[v2].append(edge2)

    def bfs(self, s, t):
        self.level = level = [None]*self.N
        deq = deque([s])
        level[s] = 0
        G = self.G
        while deq:
            v = deq.popleft()
            lv = level[v] + 1
            for w, cap, _ in G[v]:
                if cap and level[w] is None:
                    level[w] = lv
                    deq.append(w)
        return level[t] is not None

    def dfs(self, v, t, f):
        if v == t:
            return f
        level = self.level
        for e in self.it[v]:
            w, cap, rev = e
            if cap and level[v] < level[w]:
                d = self.dfs(w, t, min(f, cap))
                if d:
                    e[1] -= d
                    rev[1] += d
                    return d
        return 0

    def flow(self, s, t):
        flow = 0
        INF = 10**9 + 7
        G = self.G
        while self.bfs(s, t):
            *self.it, = map(iter, self.G)
            f = INF
            while f:
                f = self.dfs(s, t, INF)
                flow += f
        return flow

n = int(input())
ab = [list(map(int,input().split())) for i in range(n)]
dinic = Dinic(n*2+2)
for i in range(n):
    c,d = map(int,input().split())
    for j in range(n):
        if ab[j][0] < c and ab[j][1] < d:
            dinic.add_edge(i+1,n+j+1,1)
    dinic.add_edge(0,i+1,1)
    dinic.add_edge(n+i+1,2*n+1,1)
ans = dinic.flow(0,2*n+1)
print(ans)

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

typedef long long ll;
const int MOD = 1000000007;

int main(){
  int N;
  cin >> N;
  ll dp[N];
  vector<int> h(N);
  for(int i = 0; i < N; i++){
    cin >> h[i];
  }
  dp[0] = 0;
  dp[1] = abs(h[0] - h[1]);
  for(int i = 2; i < N; i++){
    dp[i] = min(dp[i-1] + abs(h[i] - h[i-1]), dp[i-2] + abs(h[i] - h[i-2]));
  }
  cout << dp[N-1] << endl;
}


Measured memory_bytes: 4516
import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B
import Debug.Trace
main :: IO ()
main = readLine >>= print . solve

solve :: [Int] -> Int
solve [n, k]
    | odd k = kc ^ 3
    | otherwise = kc ^ 3 + khc ^ 3
    where
        kc = length $ filter (\x -> x `mod` k == 0) [1..n]
        khc = length $ filter (\x -> x `mod` k /= 0 && x `mod` (k `div` 2) == 0) [1..n]


readLine :: IO [Int]
readLine = unfoldr (fmap (second (maybe B.empty snd . B.uncons)) . B.readInt) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine

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

#define all(x) (x).begin(), (x).end()
#define pb push_back

typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;

int main(){
	int n,k;
	cin>>n>>k;
	int d[10];
	for (int i = 0; i < k; ++i){
		cin>>d[i];
	}

	for (int i = n; i < 100000; ++i){
		int ans=i;
		bool flag=true;
		while(ans!=0){
			for (int j = 0; j < k; ++j){
				if(ans%10==d[j])flag=false;
			}
			ans/=10;
		}
		if(flag){
			cout<<i<<endl;
			return 0;
		}
	}


}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int n,h[25];
int main(){
    ios::sync_with_stdio(false);
    cin>>n;for(int i=1;i<=n;i++)cin>>h[i];
    int mx = h[1],ans=0;
    for(int i=1;i<=n;i++){
        if(h[i]>=mx){
            mx=h[i];ans++;
        }
    }
    cout<<ans<<endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define int long long
#define big 998244353
#define ff first
#define se second
#define pb push_back
#define pii pair<int,int>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define PSET(x,y) fixed<<setprecision(y)<<x
#define mp make_pair
#define pi 3.141592653589
int power(int x,int y){
    int r=1,z=x;
    while(y){
        if(y & 1)r*=z;
        z*=z;y=y>>1;}
    return r;}
int powerm(int x,int y,int p){
    int r=1;
    while(y){
        if(y & 1)r=(r*x)%p;
        y=y>>1;
        x=(x*x)%p;}
    return r%p;}
int modinv(int x,int m){
    return powerm(x,m-2,m);}
int logarithm(int a,int b){
    int x=0;
    while(a>1){
        x++;
        a/=b;}
    return x;}
int32_t main(){
    fast;
    int x;
    cin>>x;
    int curr=100;
    int t=0;
    while(curr<x){
        t++;
        curr=curr*1.01;
    }
    cout<<t;
    return 0;
}

Measured memory_bytes: 3612
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
#include <fstream>
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 REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

int main() {
    
    ll X,Y; cin >> X >> Y;
    
    if(abs(X-Y) <= 1) {
        cout << "Brown" << endl;
    } else {
        cout << "Alice" << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
from collections import deque
h,w=map(int,input().split())
meiro=[list('#'+input()+'#') for i in range(h)]
h+=2
w+=2
top=list('#'*w)
bot=list('#'*w)
meiro.insert(0,top)
meiro.append(bot)

def bfs(a,b):
    dist=[[-1]*w for i in range(h)]
    dist[b][a]=0
    q=deque([(a,b)])
    ans=-1
    flag=0
    while q:
        x,y=q.popleft()
        kyori=dist[y][x]
        dx=[0,1,0,-1]
        dy=[1,0,-1,0]
        for i in range(4):
            nx=x+dx[i]
            ny=y+dy[i]
            if nx==w-2 and ny==h-2 and meiro[ny][nx]=='.':
                return kyori +1
            if dist[ny][nx]==-1 and meiro[ny][nx]=='.':
                dist[ny][nx]=kyori+1
                ans=max(ans,kyori+1)
                q.append((nx,ny))
    return -1
saitan = bfs(1,1)
if saitan==-1:
    print(-1)
else:
    cnt=0
    for i in range(h):
        cnt+=str(meiro[i]).count('.')
    ans=cnt-saitan-1
    print(ans)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
using ll = long long;
using p = pair<int,int>;
int main(int argc, const char * argv[]) {



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

    string s1,s2,s3;
    cin>>s1>>s2>>s3;
    if(s1[s1.size()-1]==s2[0]&&s2[s2.size()-1]==s3[0])cout<<"YES"<<endl;
    else cout<<"NO"<<endl;

    return 0;
}


Measured memory_bytes: 3628
S = list(str(input()))
S2 = list(S)
if("A" in S2):
	S2.remove("A")
if("C" in S2):
	S2.remove("C")
s = "".join(S2)

if(S[0]!="A"):
	print("WA")
elif(S[2:-1].count("C")!=1):
	print("WA")
elif(s.islower()!=True):
	print("WA")
else:
	print("AC")

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

using namespace std;

template <class T>
using lim = numeric_limits<T>;

typedef long long ll;
typedef long double ld;

struct Coord{
	ll x;
	ll y;
	
	Coord(){
		x = y = 0;
	}
	
	Coord(ll _x, ll _y){
		x = _x;
		y = _y;
	}
};

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int N, K;
	cin >> N >> K;
	
	Coord points[N];
	ll x[N];
	ll y[N];
	
	for(int i = 0; i < N; i++){
		cin >> points[i].x >> points[i].y;
		x[i] = points[i].x;
		y[i] = points[i].y;
	}
	
	ll area = lim<ll>::max();
	
	for (int i = 0; i < N; i++){
		for (int j = i+1; j < N; j++){
			for (int k = 0; k < N; k++){
				for (int l = k+1; l < N; l++){
					
					ll leftX = min(x[i],x[j]);
					ll rightX = max(x[i],x[j]);
					ll topY = max(y[k], y[l]);
					ll botY = min(y[k], y[l]);
					
					int counter = 0;
					for (int m = 0; m < N; m++){
						if (points[m].x >= leftX && points[m].x <= rightX && points[m].y >= botY && points[m].y <= topY) counter++;
					}
					
					if (counter >= K) area = min(area, (rightX-leftX)*(topY-botY));
				}
			}
		} 
	}
	
	cout << area << endl;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

S = input()[:-1]
N = len(S)
dp = [[0]*(2*N+1) for _ in range(2*N+1)]
dp[0][0] = 1
MOD = 998244353
r, b = 0, 0

for i in range(2*N):
    if i<N:
        if S[i]=='0':
            r += 2
        elif S[i]=='1':
            r += 1
            b += 1
        else:
            b += 2
        
    for j in range(2*N+1):
        rc = r-j
        bc = b-(i-j)
        
        if rc>0:
            dp[i+1][j+1] += dp[i][j]
            dp[i+1][j+1] %= MOD
        
        if bc>0:
            dp[i+1][j] += dp[i][j]
            dp[i+1][j] %= MOD
    
print(sum(dp[2*N]))

Measured memory_bytes: 165736
#include <bits/stdc++.h>
#define int long long
#define ll long long
using ull = unsigned long long;
using namespace std;
const int INF = 1ll << 60;
const int MOD = 1e9 + 7;
#define dump(x)                             \
    if (dbg) {                              \
        cerr << #x << " = " << (x) << endl; \
    }
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
template <class T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return 1;
    } else
        return 0;
}
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    } else
        return 0;
}
void Yes(bool flag = true) {
    if (flag)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}
void No(bool flag = true) {
    Yes(!flag);
}
void YES(bool flag = true) {
    if (flag)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}
void NO(bool flag = true) {
    YES(!flag);
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T& val) {
    std::fill((T*)array, (T*)(array + N), val);
}
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vp vector<pair<int, int>>
#define vvp vector<vector<pair<int, int>>>
#define pi pair<int, int>
//#define P pair<int, int>
//#define V vector<int>
//#define S set<int>
#define itn int
#define asn ans
bool dbg = false;

int K;

void solve() {
    int asn = 0;
    FOR (i, 1, K + 1)
        FOR (j, 1, K + 1)
            FOR (k, 1, K + 1)
                ans += gcd(gcd(i, j), k);
    cout << ans << endl;
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin >> K;


    solve();
    return 0;
}


Measured memory_bytes: 3560
MOD=10**9+7
X,Y=map(int,input().split())

def powmod(a,p):
  if p==0:
    return 1
  elif p==1:
    return a
  else:
    pow2=powmod(a,p//2)
    if p%2==0:
      return (pow2**2)%MOD
    else:
      return (a*pow2**2)%MOD
def invmod(a):
  return powmod(a,MOD-2)
def comb_mod(n,r):
  nPr=1
  fact_r=1
  for i in range(r):
    nPr*=n-i
    nPr%=MOD
    fact_r*=r-i
    fact_r%=MOD  
  return (nPr*invmod(fact_r))%MOD

if (X+Y)%3!=0:
  print(0)
else:
  u=(2*X-Y)//3
  v=(-X+2*Y)//3
  if u>=0 and v>=0:    
    #print(u,v)
    print(comb_mod(u+v,v))
  else:
    print(0)

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 99999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(150) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,R) vector<vector<L>> K(N, vector<L>(M,R))
#define pint pair<lli,lli>
#define Lower(v,X) lower_bound(v.begin(),v.end(),X)-v.begin();
#define mod 1000000007
#define MAX 5100000
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main(){
  lli A,B,C,D,E,L,R,X,Y,W,H,N,M,K,sum=0,num=0,flag=0;string S,T;
  cin >> A >> B >> C >> X >> Y;
  K=(A+B)/2;
  if(C<K){
    sum+=2*C*min(X,Y);
    num=min(X,Y);
  }
  sum+=A*(X-num)+B*(Y-num);
  num=2*C*max(X,Y);
  Out(min(sum,num));
}

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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;

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



void func(long long a_I, long long a_O, long long a_T, long long a_J, long long a_L, long long a_S, long long a_Z){

    lli ans = 2*a_O;

    lli ijl = min({a_I,a_J,a_L});
    lli res = 0;

    if(ijl>0){
        res += 6+((a_I-1)/2)*4 + ((a_J-1)/2)*4 + ((a_L-1)/2)*4;
    }
    ans += max(res,(a_I/2)*4+(a_J/2)*4+(a_L/2)*4);

    cout<<ans/2<<endl;

}

int main(){
    // cout << fixed << setprecision(5);

    long long a_I;
    scanf("%lld",&a_I);
    long long a_O;
    scanf("%lld",&a_O);
    long long a_T;
    scanf("%lld",&a_T);
    long long a_J;
    scanf("%lld",&a_J);
    long long a_L;
    scanf("%lld",&a_L);
    long long a_S;
    scanf("%lld",&a_S);
    long long a_Z;
    scanf("%lld",&a_Z);
    func(a_I, a_O, a_T, a_J, a_L, a_S, a_Z);
    return 0;
}


Measured memory_bytes: 3760
#include<bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
// greater<int>()
typedef long long ll;
ll GCD(ll x, ll y) { return y ? GCD(y, x % y) : x; }
ll LCM(ll x, ll y) { return x * y / GCD(x, y); }

using namespace std;
int main() {
	int n;
	cin >> n;

	string ans = "APPROVED";
	for (int i = 0; i < n; i++)
	{
		int a;
		cin >> a;

		if (a % 2 == 0) {
			if (a % 3 != 0 && a % 5 != 0) {
				ans = "DENIED";
			}
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	int X, Y; cin >> X >> Y; 
	int ans = 0; 
	if(X == 1) ans += 300000; 
	if(X == 2) ans += 200000; 
	if(X == 3) ans += 100000; 
	if(Y == 1) ans += 300000; 
	if(Y == 2) ans += 200000; 
	if(Y == 3) ans += 100000; 
	if(X == 1 && Y == 1) ans += 400000;
	cout << ans << endl; 
}	

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define RREP(i,a,b) for(int i=(a);i>=(b);i--)
#define pq priority_queue
#define P pair<int,int>
#define P2 pair<int,P>
#define P3 pair<int,P2>
typedef long long ll; typedef long double ld;
using namespace std;
const int INF=1e9, MOD=1e9+7, around[]={0,1,1,-1,-1,0,-1,1,0,0};
const ll LINF=1e18;
const ld PI=abs(acos(-1));
ll n,m,x[200010],li[200010],a,b,cou=0;
ll c[200010];

int main(){
	cin >> n >> m;
	REP(i,0,n) cin >> x[i],li[x[i]]++;
	REP(i,1,n+1){REP(j,i-li[i],i){if(j>=0) c[j]++;}}
	REP(i,0,n) if(!c[i]) cou++;
	REP(i,0,m){
		cin >> a >> b; a--;
		
		if(x[a]-li[x[a]]>=0) c[x[a]-li[x[a]]]--;
		if(x[a]-li[x[a]]>=0 and !c[x[a]-li[x[a]]]) cou++;
		
		li[x[a]]--; li[b]++;
		if(b-li[b]>=0 and !c[b-li[b]]) cou--;
		x[a]=b;
		if(b-li[b]>=0) c[b-li[b]]++;
		cout << cou << endl;
	}
	return 0;
}


Measured memory_bytes: 6144
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int A, B, T;
    A = scanner.nextInt();
    B = scanner.nextInt();
    T = scanner.nextInt();
    System.out.println(T / A * B);
  }
}


Measured memory_bytes: 21844
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <vector>

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

using namespace std;

const int MOD=1000000007;

int main(){
	int n;
	scanf("%d",&n);
	vector<int> a(n);
	rep(i,n) scanf("%d",&a[i]);

	vector<int> b(n);
	rep(i,n) b[i]=abs(i-(n-i-1));

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

	if(a==b){
		int ans=1;
		rep(i,n/2) ans=ans*2%MOD;
		printf("%d\n",ans);
	}
	else{
		puts("0");
	}

	return 0;
}


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

int ans[200000];
int main(){
    int n,m;
    cin >> n >> m;

    memset(ans,0,sizeof(ans));

    int is1,is2;
    for(int i = 0;i < m;i++){
        cin >> is1 >> is2;

        if(is1==1) ans[is2]++;
        else if(is2==1) ans[is1]++;
        else if(is1==n) ans[is2]++;
        else if(is2==n) ans[is1]++;
    }
    for(int i = 1;i < n;i++){
        if(ans[i]==2){
            cout << "POSSIBLE";
            return 0;
        }
    }
    cout << "IMPOSSIBLE";
}


Measured memory_bytes: 1024
#include<cstdio> 
#include<cmath>。 
using namespace std;
long long n,ans;
int main(){
    int s;
    scanf("%lld",&n);
    for(int i=sqrt(n);i>0;--i) 
        if(n%i==0){
            ans=n/i;
            break;
        }
    while(ans>0){
        ++s;
        ans/=10;
    }
    printf("%d\n",s);
    return 0;
}

Measured memory_bytes: 128
// -*- coding:utf-8 -*-
#include<iostream>


void print_list(int* a, int n){
  for(int i = 0; i < n - 1; i++){
    std::cout << a[i] << " ";
  }
  std::cout << a[n - 1] << std::endl;
}

int cnt = 0;
void insertionSort(int* a, int n, int g){
  for(int i = g; i < n; i++){
    int v = a[i];
    int j = i - g;
    while(j >= 0 && a[j] > v){
      a[j + g] = a[j];
      j -= g;
      cnt++;
    }
    a[j + g] = v;
  }
}

void shellSort(int* a, int n){
  int m = 13;
  int g[] = {797161, 265720, 88573, 29524, 9841,
  	     3280, 1093, 364, 121, 40, 13, 4, 1, };
  int t;
  for(int i = 0; i < m; i++){
    if(g[i] <= n){
      t = i;
      break;
    }
  }
  for(int i = t; i < m; i++){
    insertionSort(a, n, g[i]);
  }

  std::cout << (m - t) << std::endl;
  for(int i = t; i < m - 1; i++){
    std::cout << g[i] << " ";
  }
  std::cout << g[m - 1] << std::endl;
  
  std::cout << cnt << std::endl;
  for(int i = 0; i < n; i++){
    std::cout << a[i] << std::endl;
  }
}

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

  int a[n];
  for(int i = 0; i < n; i++){
    std::cin >> a[i];
  }
  
  shellSort(a, n);
 
  return 0;
}



Measured memory_bytes: 6996
// https://atcoder.jp/contests/abc070/tasks/abc070_a

#include <iostream>
using namespace std;

int main()
{
  /* Magic word */
  cin.tie(0);
  ios::sync_with_stdio(false);
  /* ---------- */

  string n, inv_n = "", r;

  cin >> n;

  inv_n += n[2];
  inv_n += n[1];
  inv_n += n[0];

  r = n == inv_n ? "Yes" : "No";

  cout << r << '\n';

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <random>
#include <queue>
using namespace std;
typedef long long int ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int h[2],w[2],sum[2];
	for(int i=0;i<2;i++){
		cin >> h[i] >> w[i];
		sum[i]=0;
	}
	int a,b,c,d; cin >> a >> b >> c >> d;
	for(int i=0;i<2;i++){
		sum[i]+=a*h[i]+b*w[i]+h[i]/10*c+w[i]/20*d;
	}
	if(sum[0]>sum[1]){
		cout << "hiroshi" << endl;
	}
	else if(sum[0]==sum[1]){
		cout << "even" << endl;
	}
	else{
		cout << "kenjiro" << endl;
	}
}


Measured memory_bytes: 3144
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <complex>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define E18 1000000000000000000LL //2e18
#define SIZE 100010

vector<pair<int,int> > way[SIZE];
ll ans[SIZE];
ll s[SIZE];
int a[SIZE], b[SIZE];
int n;
int key = -1, keycc = 0;
ll sum = 0;

int dfs(int now, int back){
  int res = 0;
  
  for(int i=0;i<way[now].size();i++){
    if(way[now][i].first == back) continue;

    int p = dfs(way[now][i].first, now);

    if(p == n-p){
      key = way[now][i].second;
      keycc = p;
    }else{
      int q = way[now][i].second;
      ans[q] = abs(s[a[q]] - s[b[q]]) / abs(p - (n-p));
      sum += ans[q] * p;
    }

    res += p;
  }

  return res + 1;
}

int main(){
  
  scanf("%d",&n);

  for(int i=0;i<n-1;i++){
    scanf("%d%d",a+i,b+i);
    a[i]--; b[i]--;
    way[a[i]].push_back({b[i],i});
    way[b[i]].push_back({a[i],i});
  }

  for(int i=0;i<n;i++){
    scanf("%lld",s+i);
  }

  dfs(0, -1);

  if(key != -1){
    ans[key] = (s[0] - sum) / keycc;
  }

  for(int i=0;i<n-1;i++)
    printf("%lld\n",ans[i]);
  
  return 0;
}



Measured memory_bytes: 16512
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

int s;

void solve() {
    unordered_map<int, int> mp;
    int c = 0;
    while (true) {
        c++;
        if (mp[s] == 0) mp[s]++;
        else {
            cout << c << endl;
            return;
        }
        if (s % 2 == 0) s /= 2;
        else s = 3 * s + 1;
    }
}

int main() {
    cin >> s;
    solve();
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int rem=n%4;
	int del=n/4;
	if (rem==0){
		printf ("Yes\n");
		return 0;
	}
	while (del){
		if ((rem+4*del)%7==0){
			printf ("Yes\n");
			return 0;
		}
		del--;
	}
	printf ("No\n");
	return 0;
}

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

class Restaurant{
public:
	int n;
	string name;
	int p; 
	Restaurant(){}
	Restaurant(int n, string name, int p){
		this->n=n;
		this->name=name;
		this->p=p;
	}	
};

int main(){
	/*input*/
	int n;	cin >> n;
	Restaurant* res = new Restaurant[n];
	for(int i = 0; i < n; i++){
		string name;
		int p;
		cin >> name >> p;
		res[i] = Restaurant(i + 1, name, p);
	}
	/*calculation*/
	/*name*/
	int namenumber = 0;	//同じnameの数
	for(int i = 0; i < n; i++){
		for(int j = n - 1; j > i;j--){
			if(res[j].name<res[j - 1].name){
				Restaurant temp = res[j - 1];
				res[j - 1] = res[j];
				res[j] = temp;
			}else if(res[j].name==res[j - 1].name){
				if(res[j].p>res[j - 1].p){ 
						Restaurant temp = res[j - 1];
						res[j - 1] = res[j];
						res[j] = temp;
				}
			}
		} 
	}

	/*output*/
	for(int i = 0; i < n; i++){
		cout << res[i].n <<  endl;
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long  
#define pb push_back
#define mk make_pair
#define mod 998244353
#define lb lower_bound
#define ub upper_bound
#define endl "\n"
#define all(x) x.begin(),x.end()
int main()
{
    ios::sync_with_stdio(0) ;
    cin.tie(0); 
    ll n,k;
    cin>>n>>k;
    n%=k;
   ll ans=n;
    ans=min(ans,abs(n-k));
    cout<<ans;
    return 0;
}
//make all values ll


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

int n, k, a[100001];
long long pf[100001], zpf[100001];

int main(){
	scanf("%d %d", &n, &k);
	for(int i=1; i<=n; i++){
		scanf("%d", &a[i]);
		pf[i]=pf[i-1]+a[i];
		zpf[i]=zpf[i-1]+max(a[i], 0);
	}

	long long ans=0;
	for(int i=1, j=k; j<=n; i++, j++)
		ans=max(ans, zpf[i-1]+zpf[n]-zpf[j]+max(pf[j]-pf[i-1], 0ll));

	printf("%lld", ans);
	return 0;
}


Measured memory_bytes: 2176
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		//入力値取得
		long X = scan.nextLong();
		long K = scan.nextLong();
		long D = scan.nextLong();

		//演算
		long result = 0L;

		if (Math.abs(X) / D >= K) {
			result = Math.min(Math.abs(X - K * D), Math.abs(X + K * D));
		} else if ((K - Math.abs(X) / D) % 2 == 0){
			result = Math.abs(X) % D;
		} else {
			result = D - Math.abs(X) % D;
		}

		//結果出力
			System.out.println(result);
	}
}


Measured memory_bytes: 35584
w,h,x,y,r=gets.split(" ").map(&:to_i)
puts (
  (0..w).cover?(x-r) &&
  (0..w).cover?(x+r) &&
  (0..h).cover?(y-r) &&
  (0..h).cover?(y+r)
) ? 'Yes' : 'No'

Measured memory_bytes: 8708
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------

map<ll, ll> prime_factor(ll n)
{
    map<ll, ll> res;
    for (ll i = 2; i * i <= n; i++)
    {
        while (n % i == 0)
        {
            res[i]++;
            n /= i;
        }
    }
    if (n != 1)
    {
        res[n]++;
    }
    return res;
}

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;

    return gcd(b, a % b);
}

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

ll N, M;
ll b[101010], c[101010];

int main()
{
    cin >> N >> M;
    rep(i, 0, N)
    {
        int a;
        cin >> a;
        b[i] = a / 2;
        c[i] = a / 2;
    }

    bool same = true;
    while (b[0] % 2 == 0)
    {
        for (int i = 0; i < N; i++)
        {
            if (b[i] % 2 != 0)
            {
                cout << 0 << endl;
                return 0;
            }

            b[i] /= 2;
        }
        M /= 2;
    }
    for (int i = 0; i < N; i++)
    {
        if (b[i] % 2 == 0)
        {
            cout << 0 << endl;
            return 0;
        }
    }

    ll L = 1;
    for (int i = 0; i < N; i++)
    {
        ll g = gcd(L, b[i]);
        L = L / g * b[i];
        if (L > M)
        {
            cout << 0 << endl;
            return 0;
        }
    }
    cout << (M / L + 1) / 2 << endl;
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define REP(i, a, b) for (int i = a; i <= b; ++i)
#define PER(i, a, b) for (int i = a; i >= b; --i)
#define RVC(i, S) for (int i = 0; i < S.size(); ++i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define debug(...) fprintf(stderr, __VA_ARGS__)
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> pii;

inline int read(){
	int x = 0, ch = getchar(), f = 1;
	while (!isdigit(ch)){if (ch == '-') f = -1; ch = getchar();}
	while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
	return x * f;
}

int n, c, k, st[100005];
int main(){
	cin >> n >> c >> k;
	REP(i, 1, n) cin >> st[i];
	sort(st + 1, st + n + 1);
	int cur = 0, cnt = 0, ans = 0;
	REP(i, 1, n){
		if (cur < st[i] || cnt == 0){
			cur = st[i] + k;
			++ans;
			cnt = c - 1;
		}
		else --cnt;
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 640
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#include<math.h>

int main(void){
    int A,B,C;
    scanf("%d%d%d",&A,&B,&C);

    int result = A<B ? (B<C ? C*10 + A + B : B*10 + A + C) : (A<C ? C *10 + A + B : A *10 + C + B);

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

    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<set>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;

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


template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 100005
const ll INF = 1e9;
const ll MOD = 1e9 + 7;

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




/******************************************************************************************/

template<typename T>
T LIS(vector<T>& a) {/*長さに対する最小の最終要素*/

	T siz = a.size();
	vector<T> dp(a.size() + 10, INF);

	for (T i = 0; i < siz; i++) {
		*lower_bound(dp.begin(), dp.begin() + siz, a[i]) = a[i];
	}
	return lower_bound(dp.begin(), dp.begin() + siz, INF) - dp.begin();
}

int main() {

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


	int cnt = 0;
	int maxi = 0;

	for (int i = 0; i < n-1; i++)
	{
		if (a[i] >= a[i+1]) {
			cnt++;
			//cout << "i = " << i << endl;
		}
		else
		{
			//cout << "b" << endl;
			maxi = max(maxi, cnt);
			cnt = 0;
		}
		//cout << "cnt= " << cnt << endl;
	}
	maxi = max(maxi, cnt);
	cout << maxi << endl;
	


	

	return 0;
}


Measured memory_bytes: 640
#include <stdio.h>
#include <algorithm>
using namespace std;
int arr[101];
int main(){
	int SW = 0;
	if(SW==0){
		int X,Y,Z;
		scanf("%d %d %d",&X,&Y,&Z);
		printf("%d %d %d",Z,X,Y);
	}
	else if(SW==1){
		int N,M;
		scanf("%d %d",&N,&M);
		int sum=0,cnt=0;
		for(int i=0;i<N;i++){
			scanf("%d",arr+i);
			sum+=arr[i];
		}
		for(int i=0;i<N;i++)cnt+=4*M*arr[i]>=sum;
		printf("%s",cnt>=M?"Yes":"No");
	}
	else{
		long long N,K;
		scanf("%lld %lld",&N,&K);
		printf("%lld",min(N%K,K-(N%K)));
	}
}

Measured memory_bytes: 128
a, b, c, x, y = map(int, input().split())
min_val = 2**30
if x < y:
    tmp = x
    x = y
    y = tmp
    tmp = a
    a = b
    b = tmp

for i in range(x + 1):
    k = (x - i) * 2
    k = 0 if k < 0 else k
    j = y - (k // 2)
    j = 0 if j < 0 else j
    val = i * a + j * b + k * c
    if val < min_val:
        min_val = val
print(min_val)



Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef pair<int, int> P;
const int inf = 1e9;

int main() {
  int N; cin >> N;
  vector<int> X(N), L(N);
  for(int i = 0; i < N; i++) cin >> X[i] >> L[i];
  vector<P> ps(N);
  for(int i = 0; i < N; i++) {
    ps[i] = P(X[i]+L[i], X[i]-L[i]);
  }
  sort(ps.begin(), ps.end());
  int cur = -inf;
  int ans = 0;
  for(int i = 0; i < N; i++) {
    if(cur <= ps[i].second) {
      ans++;
      cur = ps[i].first;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1792
A = [[0]*3]*3

for i in range(0,3):
  A[i] = list(map(int, input().split()))

N = int(input())
b = [0] * (N)
for i in range(N):
  b[i] = int(input())

for i in b:
  for k in range(0,3):
    for l in range(0,3):
      if A[k][l] == i:
        A[k][l] = 0

if sum(A[0]) == 0:
  print('Yes')
  exit()
if sum(A[1]) == 0:
  print('Yes')
  exit()
if sum(A[2]) == 0:
  print('Yes')
  exit()

sum = 0
for i in range(0,3):
    sum+= A[i][0]
if sum == 0:
  print('Yes')
  exit()

sum = 0
for i in range(0,3):
    sum+= A[i][1]
if sum == 0:
  print('Yes')
  exit()

sum = 0
for i in range(0,3):
    sum+= A[i][2]
if sum == 0:
  print('Yes')
  exit()

if (A[0][0] + A[1][1] + A[2][2]) == 0:
  print('Yes')
  exit()
  
if (A[0][2] + A[1][1] + A[2][0]) == 0:
  print('Yes')
  exit()

print('No')

Measured memory_bytes: 38256
#include <bits/stdc++.h>
 
using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;
 
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
 
template<typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

template<typename T> vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts) { 
    return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type
fill_v(T &t, const V &v) { t=v; }
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t, const V &v ) { for(auto &e:t) fill_v(e,v); }

template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.first<<','<<a.second<<')'; return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
    out<<'['; for(T i: a) {out<<i<<',';} out<<']'; return out;
}

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; // DRUL
const int INF = 1<<30;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;

template <typename S>
struct sparseTable {
    using T = typename S::T;
    int n;
    vector<int> log2;
    vector<vector<T>> t;

    sparseTable(int nn) {
        n = nn;
        log2.assign(n+1, 0);
        for(int i=2; i<=n; ++i) log2[i] = log2[i >> 1] + 1;
        t = vector<vector<T>>(log2[n]+1, vector<T>(n));
    }
    void init(vector<T> v) {
        for(int i=0; i<n; ++i) t[0][i] = v[i];
        for(int j=1; j<=log2[n]; ++j) {
            int w = 1LL<<(j-1);
            for (int i = 0; i+(w<<1) <= n; ++i) {
                t[j][i] = S::op(t[j-1][i], t[j-1][i+w]);
            }
        }
    }
    // [l, r]
    T query(int l, int r) {
        int j = log2[r - l];
        return S::op(t[j][l], t[j][r-(1 << j)+1]);
    }
};

// 集合T、結合則・可換・冪等律が成り立つ二項演算op
struct minnimum {
    using T = ll;
    static T op(const T& a, const T& b) { return min(a, b); }
};
struct maximum {
    using T = ll;
    static T op(const T& a, const T& b) { return max(a, b); }
};
struct gcd_op {
    using T = ll;
    static T op(const T& a, const T& b) { return __gcd(a, b); }
};

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

    ll n, l;
    cin >> n >> l;
    vector<ll> a(n);
    REP(i, n) cin >> a[i];

    sparseTable<minnimum> st(n);
    st.init(a);
    FOR(i, l-1, n) cout << st.query(i-l+1, i) << (i==n-1?'\n':' ');

    return 0;
}



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

template <typename T>
class Board {
 public:
  Board(int h, int w) : w_{w}, h_{h}, s_(h * w) {}

  auto& operator()(int i, int j) noexcept { return s_[w_ * i + j]; }
  const auto& operator()(int i, int j) const noexcept { return s_[w_ * i + j]; }

  auto max() const {
    auto it = std::max_element(s_.begin(), s_.end());
    return *it;
  }

 private:
  int w_;
  int h_;
  std::vector<T> s_;
};

int main() {
  int h, w;
  std::cin >> h >> w;

  Board<char> s(h, w);
  for (int i = 0; i < h; ++i) {
    std::string si;
    std::cin >> si;
    for (int j = 0; j < w; ++j) s(i, j) = si[j];
  }

  Board<int> l(h, w);
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      if (s(i, j) == '#')
        l(i, j) = 0;
      else if (j == 0)
        l(i, j) = 1;
      else
        l(i, j) = l(i, j - 1) + 1;
    }
  }

  Board<int> r(h, w);
  for (int i = 0; i < h; ++i) {
    for (int j = w - 1; j >= 0; --j) {
      if (s(i, j) == '#')
        r(i, j) = 0;
      else if (j == w - 1)
        r(i, j) = 1;
      else
        r(i, j) = r(i, j + 1) + 1;
    }
  }

  Board<int> u(h, w);
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      if (s(i, j) == '#')
        u(i, j) = 0;
      else if (i == 0)
        u(i, j) = 1;
      else
        u(i, j) = u(i - 1, j) + 1;
    }
  }

  Board<int> d(h, w);
  for (int i = h - 1; i >= 0; --i) {
    for (int j = 0; j < w; ++j) {
      if (s(i, j) == '#')
        d(i, j) = 0;
      else if (i == h - 1)
        d(i, j) = 1;
      else
        d(i, j) = d(i + 1, j) + 1;
    }
  }

  Board<int> count(h, w);
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j)
      count(i, j) = l(i, j) + r(i, j) + u(i, j) + d(i, j) - 3;
  }

  std::cout << count.max() << std::endl;
}


Measured memory_bytes: 82304
import Foundation

main()

func main() {
    let abc = readLine()!.split(separator: " ").map { Double($0)! }
    let k = Double(readLine()!)!
    let sorted = abc.sorted()
    let ans = sorted.dropLast().reduce(sorted.last! * pow(2.0, k), +)
    print(Int(ans))
}


Measured memory_bytes: 13616
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**10
mod = 10**9 + 7


def f():
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    a.reverse()
    i = j = 0
    while i+1 < n and a[i+1] > j+1:
        i += 1
        j += 1
    if (a[i] - j - 1) % 2 == 1:
        return 'First'
    k = 0
    while i+1 < n and a[i+1] > j:
        i += 1
        k += 1
    if k % 2 == 1:
        return 'First'
    return 'Second'

print(f())


Measured memory_bytes: 17320
from collections import deque
N,x=map(int,input().split())
if x==1 or x==2*N-1:
    print("No")
    exit()
if N==2:
    print('Yes')
    print(*[1,2,3],sep='\n')
    exit()
    
d=deque(list(range(1,x))+list(range(x+1,2*N)))
ans=[0]*(2*N-1)
ans[N-1]=x
ans[N-2],ans[N]=[d.popleft(),d.pop()] if x>2 else [d.pop(),d.popleft()]
ans[N+1]=d.popleft() if N>2 else d.pop()

for i in range(2*N-1):
    if ans[i]==0:
        ans[i]=d.pop()
print("Yes")
print(*ans,sep='\n')

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

using namespace std;

int a, b;

int main() {
	
	scanf("%d %d", &a, &b);
	
	if (a>=13) {
		printf("%d\n", b);
	}
	else if (a>=6 && a <=12) {
		printf("%d\n", b/2);
	}
	else  {
		puts("0");
	}
	
	return 0;
}

Measured memory_bytes: 256