akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pl;
#define all(a) (a).begin(),(a).end()
#define overload4(_1, _2, _3, _4, name, ...) name
#define rep1(n) for(ll i = 0;i < (n);i++)
#define rep2(i,n) for(ll i = 0;i < (n);i++)
#define rep3(i,a,b) for(ll i = (a);i < (b);i++)
#define rep4(i,a,b,c) for(ll i = (a);i < (b);i += (c))
#define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep1(n) for(ll i = (n)-1;i >= 0;i--)
#define rrep2(i,n) for(ll i = (n)-1;i >= 0;i--)
#define rrep3(i,a,b) for(ll i = (a)-1;i >= (b);i--)
#define rrep4(i,a,b,c) for(ll i = (a)-1;i >= (b);i -= (c))
#define rrep(...) overload4(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define SHOW(x) cout << #x << ": " << x << endl;
template<class T> ll sumArr(const T& a){ return accumulate(all(a), 0LL);}
template<class T> auto minArr(const T& a){ return *min_element(all(a));}
template<class T> auto maxArr(const T& a){ return *max_element(all(a));}
template<class T> void DEBUG_PRINT(T tmp){cout<<tmp<<endl;}
template<class T1,class... T2> void DEBUG_PRINT(T1 tmp,T2... tmp2){cout<<tmp<<" ";DEBUG_PRINT(tmp2...);}
ll gcd(ll a, ll b){ while(b){ ll c = b; b = a % b; a = c; } return a; }
const ll INF=1e18,MOD = 1e9+7;
const int iINF = 1e9;

ll ans,arr[11],a[51],b[51],c[51],d[51],n,m,q;

void solve(int rank,int num){
    if(rank == n+1){
        ll tmp = 0;
        rep(i,q){
            if(arr[b[i]]-arr[a[i]] == c[i])tmp += d[i];
        }
        ans = max(ans,tmp);
    }
    else{
        rep(i,num,m + 1){
            arr[rank] = i;
            solve(rank+1,i);
        }
    }
}

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

    cin>>n>>m>>q;
    rep(i,q)cin>>a[i]>>b[i]>>c[i]>>d[i];
    solve(0,1);
    
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3652
N = int(input())

count = 0
for i in range(N):
    D1,D2 = map(int,input().split())
    if D1==D2:
        count += 1
        if count == 3:
            break
    else:
        count= 0

if count == 3:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 62252
#include<cstdio>
#include<cstring>
int f[200005],s[200005],g[(1<<26)+5]; 
char str[200005];
int min(int x,int y) {return x<y?x:y;}
int main()
{
	scanf("%s",str);memset(g,0x3f,sizeof(g));
	int n=strlen(str);
	for(int i=1;i<=n;i++) s[i]=s[i-1]^(1<<(str[i-1]-'a'));
	g[0]=0;
	for(int i=1;i<=n;i++)
	{
		f[i]=g[s[i]]+1;
		for(int j=0;j<26;j++)
		f[i]=min(f[i],g[s[i]^(1<<j)]+1);
		g[s[i]]=min(g[s[i]],f[i]);
	}
	printf("%d\n",f[n]);
	return 0;
}

Measured memory_bytes: 264064
#include<stdio.h>

int main(void)
{
   int n, k, x[100], i, s=0;

   scanf("%d%d",&n,&k);
   for(i=0;i<n;i++){
      scanf("%d",&x[i]);
      if(k/2<x[i])
         s+=2*(k-x[i]);
      else
         s+=2*x[i];
   }
   printf("%d\n",s);
   return 0;
}

Measured memory_bytes: 1712
#include<iostream>
#include<string>
#include<map>
using namespace std;
bool vars[11];
pair<string, string> equation(string str){
  int i=0;
  for(i=0;i<(int)str.length();i++){
    if(str[i]=='=')break;
  }
  return make_pair(str.substr(0, i),str.substr(i+1));
}
bool formula(string str){
  //cout<<str<<endl;
  bool ret;
  if(str == "T"){
    ret= true;
  }else if(str == "F"){
    ret= false;
  }else if('a'<= str[0] && str[0] <= 'k'){
    ret= vars[str[0]-'a'];
  }else if(str[0] == '-'){
    ret= !formula(str.substr(1));
  }else if(str[0]=='('){
    int tcur=1;
    int opc=-1;
    int op=-1;
    int depth=0;
    while(tcur<(int)str.length()){
      if(str[tcur]=='('){
        depth++;
      } else if(str[tcur]==')'){
        depth--;
      }else if(depth==0){
        if(str[tcur]=='+'){
          op=1;opc=tcur;
          break;
        }else if(str[tcur]=='*'){
          op=2;opc=tcur;
          break;
        }else if(str[tcur]=='-'
                 &&tcur+1<(int)str.length()
                 &&str[tcur+1]=='>'){
          tcur++;
          op=3;opc=tcur;
          break;
        }
        
      }
        tcur++;
    }
    switch(op){
    case -1:
      return formula(str.substr(1,str.length()-2));
    case 1:
      return formula(str.substr(1,opc-1))
        ||formula(str.substr(opc+1, str.length()-1 - (opc+1)));
    case 2:
      return formula(str.substr(1,opc-1))
        &&formula(str.substr(opc+1, str.length()-1 - (opc+1)));
    case 3:
      return !(formula(str.substr(1,opc-2))
               &&!formula(str.substr(opc+1, str.length()-1 - (opc+1))));
    default:
      cout<<"ERROR!"<<endl;
      return false;
    }
  }else {
    cout<<"ERROR"<<" "<<str<<endl;
    return false;
  }
  return ret;
}
bool dfs(int depth, string a, string b){
  if(depth==11){
    if(formula(a)==formula(b))return true;
    return false;
  }else{
    vars[depth]=true;
    if(!dfs(depth+1, a, b))return false;
    vars[depth]=false;
    if(!dfs(depth+1, a, b))return false;
    return true;
  }
}
int main(){
  string str;
  pair<string, string> eq;
  while(cin>>str&&str!="#"){
    eq=equation(str);
    if(dfs(0, eq.first, eq.second)){
      cout<<"YES"<<endl;
    }else {
      cout<<"NO"<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1900
import java.util.*;

public class Main{
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    String s=sc.next();
    String t=sc.next();
    int a=sc.nextInt();
    int b=sc.nextInt();
    String u=sc.next();
    if(u.equals(s)) a-=1;
    if(u.equals(t)) b-=1;
    System.out.print(a);
    System.out.println(" "+b);
  }
}


Measured memory_bytes: 23124
//Author: AnandRaj doubleux
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll; 

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define test() int t;cin>>t;while(t--)
#define forn(f,n) for(int i=f;i<f+n;i++)
#define rforn(l,n) for(int i=l;i>l-n;i--)
#define all(v) v.begin(),v.end()
#define prin(V) for(auto v:V) cout<<v<<" ";cout<<endl
#define take(V,f,n) for(int i=f;i<f+n;i++) cin>>V[i];
#define what(x) cerr<<#x<<" = "<<x<<endl
#define KStest() int t,t1;cin>>t;t1=t;while(t--)
#define KScout cout<<"Case #"<<t1-t<<": "

const int MOD = 1e9+7,MAX = 1005;
/////////////////FastExp///////////////////
ll powN(ll a,ll p)
{
	if(p==0) return 1;
	ll z=powN(a,p/2);
	z=(z*z)%MOD;
	if(p%2) z=(z*a)%MOD;
	return z;
}
/////////////////FastExp///////////////////
//////////////////Sieve////////////////////
vector<bool> is_prime(MAX+1, true);
void Sieve()
{
	is_prime[0] = is_prime[1] = false;
	int i,j;
	for (i = 2; i*i <= MAX; i++) 
	{
    	if (is_prime[i]) 
    	{
        	for (j = i * i; j <= MAX; j += i)
            	is_prime[j] = false;
    	}
	}
}
//////////////////Sieve////////////////////



int main()
{
	int n;
	cin>>n;
	vi A(n);
	take(A,0,n);
	bool ans=true;
	for(int i=0;i<n;i++)
	{
		if(A[i]%2==0)
		{
			if(A[i]%3!=0&&A[i]%5!=0) ans=false;
		}
	}
	if(!ans) cout<<"DENIED"<<endl;
	else cout<<"APPROVED"<<endl;
}		

Measured memory_bytes: 256
import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}
void readA(T)(size_t n,ref T[]t){t=new T[](n);auto r=rdsp;foreach(ref v;t)pick(r,v);}

void main()
{
  int n; readV(n);
  int[] h; readA(n, h);

  writeln(1 + iota(1, n).count!(i => h[0..i].all!(hi => hi <= h[i])));
}


Measured memory_bytes: 256
package main

import "fmt"

type station struct {
	c int
	s int
	f int
}

func main() {
	var N int
	fmt.Scan(&N)
	stations := make([]station, N)
	for i := 0; i < N-1; i++ {
		var x, y, z int
		fmt.Scan(&x, &y, &z)
		stations[i] = station{c: x, s: y, f: z}
	}
	for i := 0; i < N-1; i++ {
		t := 0
		for j := i; j < N-1; j++ {
			switch {
			case t < stations[j].s:
				t = stations[j].s + stations[j].c
			case t%stations[j].f == 0:
				t = t + stations[j].c
			default:
				t = t + (stations[j].f - t%stations[j].f) + stations[j].c
			}
		}
		fmt.Println(t)
	}
	fmt.Println(0)
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define F(i,a,b) for(int i=(int)a;i<=(int)b;i++)
#define FD(i,a,b) for(int i=(int)a;i>=(int)b;i--)
#define pii pair<int,int>
#define reset(x,y) memset(x, y,sizeof(x))
#define MIN(x,y) if (x > (y)) x = (y)
#define MAX(x,y) if (x < (y)) x = (y)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define EL putchar('\n');
#define mod 1000000007
#define oo 200005
int read()
{
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9') {if (c == '-') f = -1; c = getchar();}
    while (c >= '0' && c <= '9') {x = x * 10 + c - '0'; c = getchar();}
    return x * f;
}
void write(int x)
{
    if (x > 9) write(x / 10);
    putchar(x % 10 + '0');
}
int n;
int a[oo];
int h[oo];
int f[oo],res[oo];
void ReadInPut()
{
    n=read();
    F(i,1,n)a[i]=read();
    F(i,1,n)h[i]=read();
}
void ud(int i,int v)
{
    while(i<=n)
    {
        MAX(f[i],v);
        i=i+(i&(-i));
    }
}
int get(int i)
{
    int ans=0;
    while(i>=1)
    {
        MAX(ans,f[i]);
        i=i-(i&(-i));
    }
    return ans;
}
void Solve()
{
    int kq=0;
    F(i,1,n)
    {
        res[i]=h[i]+get(a[i]);
        ud(a[i],res[i]);
        MAX(kq,res[i]);
     //   cout<<res[i]<<" ";
    }
    cout<<kq;
}
main()
{
//    freopen("t.INP","r",stdin);
  //  freopen(".OUT","w",stdout);
    int sotest=1;
    //cin>>sotest;
    for(int i=1;i<=sotest;i++)
    {
        ReadInPut();
        Solve();
    }
}


Measured memory_bytes: 6528
#include<iostream>
#include<algorithm>
#include<vector>
#include<string.h>
#include<cstdlib>
#include<map>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<random>
#include<set>
#include<queue>

using namespace std;

long long dp[3][100100] = {};
const long long INF = 1LL << 60;
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define dump(a) cout << a << endl; 

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

/**
* @fn
* 最大値を取ります.Vector<int>を渡すこと.
*/
long long int imax(vector<int> a) {
	int MAX = -10000000;
	for (int i = 0; i < a.size(); i++) {
		if (MAX < a.at(i)) MAX = a.at(i);
	}
	return MAX;
}

/**
* @fn
* 最小値を取ります.Vector<int>を渡すこと.
*/
long long int imin(vector<int> a) {
	int MIN = 1000000000;
	for (int i = 0; i < a.size(); i++) {
		if (MIN > a.at(i)) MIN = a.at(i);
	}
	return MIN;
}

/**
* @fn
* 自然数について、桁数を求める
*/
Int getDigit(Int num) {
	return (Int)(log10(num)) + 1;
}


int get2Digit(Int num) {
	int cnt = 0;
	while (num > 0) {
		if (num % 2 != 0) {
			return cnt;
		}
		cnt++;
		num /= 2;
	}
}

long long int absmin(vector<int> a, long long int b) {
	int mini = 100000000;
	int d = 0;
	for (int i = 0; i < a.size(); i++) {
		if (mini > abs(a.at(i) - b)) {
			mini = abs(a.at(i) - b);
			d = i;
		}
	}
	return d;
}


long long int absmax(vector<int> a, long long int b) {
	int max = -100000000;
	int d = 0;
	for (int i = 0; i < a.size(); i++) {
		if (max < abs(a.at(i) - b)) {
			max = abs(a.at(i) - b);
			d = i;
		}
	}
	return d;
}

int gcd(int a, int b)
{
	if (a < b) swap(a, b);
	if (b < 1) return -1;
	if (a % b == 0) return b;
	return gcd(b, a % b);
}

void haerobatya(int start, int end, char level) {
	if (start > end) swap(start, end);
	for (int i = start; i <= end; i++) {
		if (i < 100) {
			cout << "https://atcoder.jp/contests/abc0" << i << "/tasks/abc0" << i << "_" << level << endl;
		}
		else {
			cout << "https://atcoder.jp/contests/abc" << i << "/tasks/abc" << i << "_" << level << endl;
		}
	}
}

long long int cntmod(long long int warareru, long long int mod) {
	long long int i = 0;
	for (i = 0; true; i++) {
		if (warareru % mod == 0 && warareru >= mod) {
			warareru /= mod;
		}
		else {
			return i;
		}
	}
}

void ansYes(bool a) {
	if (a == true) cout << "Yes" << endl;
	else cout << "No" << endl;
}

void ansYES(bool a) {
	if (a == true) cout << "YES" << endl;
	else cout << "NO" << endl;
}


Int euclidean_gcd(Int a, Int b) {
	while (true) {
		if (a < b) swap(a, b);
		if (!b) break;
		a %= b;
	}
	return a;
}

typedef pair<int, int> pai;


//ここまでライブラリ
//ここから本文

int main() {
	string s;
	cin >> s;
	s.at(3) = '8';
	dump(s);
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#define MAX 10000
#define true 1
#define false 0
int sosu(int);
int main()
{
  int i,j,k[MAX],l=0;
  scanf("%d",&j);
  for(i = 0; i < j; i++){
    scanf("%d",&k[i]);
    if(sosu(k[i])==1)l++;
    }
     printf("%d\n",l);
    return 0;
  }
int sosu(int x)
{
  int i=3;
  if(x == 2){
    return true;
  }
  if(x<2 || x%2==0){
    return false;
  }
  while(i <= sqrt(x)){
    if(x%i==0){
      return false;
    }
    i += 2;
    
  }
  return true;
}



Measured memory_bytes: 2044
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int n,a,b,c;
string ans;
vector<string> s;
map<pair<pair<int,int>,pair<int,int>>,int> mp;
using P = pair<int,int>;
void dfs(int now,int A,int B,int C)
{
	if(mp[pair<P,P>(P(now,A),P(B,C))]==0)
	{
		mp[pair<P,P>(P(now,A),P(B,C))]=1;
	}
	else
	{
		return;
	}
	
	if(A==-1||B==-1||C==-1)
	{
		return;
	}
	if(now==n)
	{
		cout<<"Yes"<<endl;
		for(auto c:ans)
		{
			cout<<c<<endl;
		}
		exit(0);
	}

	if(s[now]=="AB")
	{
		ans[now]='B';
		dfs(now+1,A-1,B+1,C);
		ans[now]='A';
		dfs(now+1,A+1,B-1,C);
	}
	if(s[now]=="BC")
	{
		ans[now]='B';
		dfs(now+1,A,B+1,C-1);
		ans[now]='C';
		dfs(now+1,A,B-1,C+1);
	}
	if(s[now]=="AC")
	{
		ans[now]='A';
		dfs(now+1,A+1,B,C-1);
		ans[now]='C';
		dfs(now+1,A-1,B,C+1);
	}
}

int main()
{
	cin >> n >> a >>b >> c;
	for(int i = 0;i<n;i++)
	{
		string t;
		cin >> t;
		s.push_back(t);
	}
	ans = string(n,0);
	dfs(0,a,b,c);
	cout<<"No"<<endl;
}

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

using namespace std;

int x, y, z, k;
long long a[1005], b[1005], c[1005];
vector <long long> tmp;

int main() {
	scanf("%d%d%d%d", &x, &y, &z, &k);
	
	for (int i = 0; i < x; i++) scanf("%lld", &a[i]);
	for (int i = 0; i < y; i++) scanf("%lld", &b[i]);
	for (int i = 0; i < z; i++) scanf("%lld", &c[i]);
	
	for (int i = 0; i < x; i++) {
		for (int j = 0; j < y; j++) tmp.push_back(a[i] + b[j]);
	}
	
	sort(tmp.begin(), tmp.end());
	reverse(tmp.begin(), tmp.end());
	
	vector <long long> res;
	
	for (int i = 0; i < min(k, (int)tmp.size()); i++) {
		for (int j = 0; j < z; j++) res.push_back(tmp[i] + c[j]);
	}
	
	sort(res.begin(), res.end());
	reverse(res.begin(), res.end());
	
	for (int i = 0; i < k; i++) printf("%lld\n", res[i]);
}


Measured memory_bytes: 43236
#include <bits/stdc++.h>
#define upd(x,y) x=(x+y>=mu?x+y-mu:x+y)
int n,m,mu,dp[305][305][305];
int main(){
	scanf("%d%d%d",&n,&m,&mu);
	dp[0][1][0]=1;
	for (int i=0;i<=n;i++)
		for (int j=1;j<=m;j++)
			for (int k=i;k>=0;k--){
				if (k) upd(dp[i][j][k-1],dp[i][j][k]);
				else upd(dp[i][j+1][i],dp[i][j][k]);
				upd(dp[i+1][j][k],1ll*dp[i][j][k]*(k+1)%mu);
			} 
	printf("%d",dp[n][m][0]);
}

Measured memory_bytes: 110848
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int cnt;
  long long int ans=100000;
  for(int i=0;i<n;++i){
    ans*=105;
    ans/=100;
    cnt=ans%1000;
    ans=ans-cnt;
    if(cnt>=1)
      ans+=1000;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3048
package main

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

const (
	initialBufSize = 100000
	maxBufSize     = 10000000
)

var (
	sc = bufio.NewScanner(os.Stdin)
	wt = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, initialBufSize), maxBufSize)
	defer wt.Flush()

	n, m := nextInt(), nextInt()

	// ans := 1
	gMax := m / n
	for g := gMax; g >= 1; g-- {
		if m%g != 0 {
			continue
		}
		puts(g)
		break
	}

	// puts(ans)
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;


int main() {
    int N, ans = 0;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++){
        cin >> A.at(i);
        A.at(i)--;
    }
    for (int i = 0; i < N; i++){
        if (A.at(A.at(i)) == i){
            ans++;
        }
    }
    cout << ans / 2 << endl;

}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(long long i = 0; i < (n); ++i)
#define ll long long
#define P pair<ll,ll>
#define all(v) (v).begin(),(v).end()

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1.0);

int main(void)
{
    string s;
    cin >> s;
    string ans;
    rep(i,s.size()){
        if(s[i] == '0') ans+="0";
        else if(s[i] == '1') ans+="1";
        else if(ans!="") ans.pop_back();
    }
    cout<<ans<<endl;
    return 0;
}

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

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,x,n) for(int i=x; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back

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

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 (a>b) { a=b; return 1; } return 0; }

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

const ll INF = 1e9+7;


int main(){
	//ios_base::sync_with_stdio(false);
	int N, ans=0;
	int A[2][105];

	cin >> N;
	rep(k,2) rep(i,N) cin >> A[k][i];

	int dp[3][105]={};
	rep(k,2) rep(i,N){
		dp[k][i] += A[k][i];
		chmax(dp[k+1][i], dp[k][i]);
		chmax(dp[k][i+1], dp[k][i]);
	}

	cout << dp[1][N] << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
using vch=vector<char>;
using vvch=vector<vector<char>>;
using vbo=vector<bool>;
using vvbo=vector<vector<bool>>;
using vpii=vector<pair<int,int>>;
using pqsin=priority_queue<int,vector<int>,greater<int>>;
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define decp(n) cout<<fixed<<setprecision((int)n)
#define _GLIBCXX_DEBUG
const int inf=1e9+7;

int main(){
    int s,w;
    cin>>s>>w;
    if(s<=w)cout<<"unsafe"<<endl;
    else cout<<"safe"<<endl;
}

Measured memory_bytes: 3632
/*
**    Peace begins with a smile.
**    -- Mother Teresa
**
**    Author : Dhiraj Govindvira
**      Date : 06-Sep-2020 ~ Sunday
**      Time : 11:51:03 AM
*/

#ifdef Dhiraj
    #include "D:/dhiraj/Programming/debug.h"
#else
    #include <bits/stdc++.h>
    using namespace std;
    #define d(...) 11
    #define cerr if(0) cerr
#endif

// Macro --------------------------------------------------------------------

#define ll                  long long int
#define FOR(i, a, b, s)     for(ll i = (a); ((s) > 0 ? i < (b) : i > (b)); i += (s))
#define FOR1(b)             FOR(i, 0, b, 1)
#define FOR2(i, b)          FOR(i, 0, b, 1)
#define FOR3(i, a, b)       FOR(i, a, b, (a) <= (b) ? 1 :-1)
#define FOR4(i, a, b, s)    FOR(i, a, b, s)
#define GET5(a, b, c, d, e, ...) e
#define FORC(...)           GET5(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)
#define loop(...)           FORC(__VA_ARGS__)(__VA_ARGS__)
#define all(x)              x.begin(), x.end()
#define rall(x)             x.rbegin(), x.rend()
#define endl                '\n'

// Template -----------------------------------------------------------------

// multiple input
template <typename... T> 
inline void inp(T&... args) {
    ((cin >> args), ...);
}
// scan vector
template <typename T> 
inline istream& operator >>(istream &in, vector<T> &a) {
    for(auto &x : a) in >> x;
    return in;
}
// scan pair
template <typename T, typename U> 
inline istream& operator >>(istream &in, pair<T, U> &a) {
    in >> a.first >> a.second; 
    return in;
}

// Solve --------------------------------------------------------------------

void solve(int &T)
{
    ll n, k;
    cin >> n >> k;
    
    vector<ll> a(n);
    cin >> a;

    sort(all(a));

    ll ans = 0;
    loop(k) ans += a[i];
    cout << ans << endl;
}

// Main ---------------------------------------------------------------------

int main()
{
    #ifdef Dhiraj
        freopen("D:/dhiraj/Programming/i1.txt", "r", stdin);
        freopen("D:/dhiraj/Programming/o1.txt", "w", stdout);
        // freopen("D:/dhiraj/Programming/e1.txt", "w", stderr);
    #endif

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

    int t = 1;
    for(int i = 1; i <= t; i++) {
        cerr << "Case #" << i << "\n";
        solve(i);
    }
    return 0;
}

Measured memory_bytes: 3584
#include<stdio.h>
#define SIZE 101

int main(void)
{
    int i, j;
    int r, c; scanf("%d %d", &r, &c);
    int table[SIZE][SIZE];
    
    for ( i=0; i<r; ++i)
        for ( j=0; j<c; ++j)
            scanf("%d", &table[i][j]);
    
    /* 行の計算 */
    for ( i=0; i<r; ++i){
        table[i][c] = 0;
        for ( j=0; j<c; ++j)
            table[i][c] += table[i][j];
    }
    /* 列の計算 */
    for ( j=0; j<=c; ++j){
        table[r][j] = 0;
        for ( i=0; i<r; ++i)
            table[r][j] += table[i][j];
    }
    
    /* 書き出し */
    for ( i=0; i<=r; ++i)
        for ( j=0; j<=c; ++j) {
            printf("%d", table[i][j]);
            if ( j < c)
                putchar(' ');
            else
                putchar('\n');
        }
    return 0;
}


Measured memory_bytes: 2112
#include<stdio.h>

int main(){
  int A,B;
  int ANS;
  scanf("%d %d",&A,&B);
  if(A<=5){
    ANS=0;
  }else if(A<=12){
    ANS=B/2;
  }
  else{
    ANS=B;
  }
  printf("%d",ANS);
  return 0;
}


Measured memory_bytes: 128
using System;
using System.Linq;

public class Test
{
	public static void Main()
	{
		// your code goes here
		
		var b = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
		int n = b[0];
		int m = b[1];
		
		bool[] isBroken = new bool[n+10];
		for(int i = 0; i < m; i++){
			int input = int.Parse(Console.ReadLine());
			isBroken[input] = true;
		}
		
		long[] dp = new long[n+10];
		dp[0] = 1;
        long mod = 1000000007;

		for(int i = 1; i <= n; i++) {
			if(isBroken[i]){
				dp[i] = 0;
			}else{
				if(i==1){
					dp[i] = dp[i-1];
                    dp[i] = dp[i] % mod;
				}else{
					dp[i] = dp[i-1] + dp[i-2];	
                    dp[i] = dp[i] % mod;
				}
			}
		}
		Console.WriteLine(dp[n]);
	}
}


Measured memory_bytes: 15840
#include<cstdio>


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

    int d = a / b;
    int r = a % b;
    double f = (double)a / b;
    printf("%d %d %.5f\n", d, r, f);
    return 0;
}


Measured memory_bytes: 2748
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
  
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
  
using namespace std;
  
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
  
const int INF=1<<29;
const double EPS=1e-9;
  
const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};


int main() {
  int N;
  cin >> N;
  vector<ll> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  vector<ll> acc(N + 1);
  for (int i = 0; i < N; i++) {
    acc[i + 1] = acc[i] + A[i];
  }

  ll mi = 1LL << 61;
  for(int j = 2; j <= N - 1; j++) {
    int i1 = lower_bound(acc.begin(), acc.end(), acc[j] / 2) - acc.begin();
    int k1 = lower_bound(acc.begin(), acc.end(), (acc[N] - acc[j]) / 2 + acc[j]) - acc.begin();
    vector<int> I = {i1};
    vector<int> K = {k1};
    if (i1 > 0) I.push_back(i1 - 1);
    if (k1 - 1 > j) K.push_back(k1 - 1);

    for (int u = 0; u < I.size(); u++) {
      for (int v = 0; v < K.size(); v++) {
        int i = I[u], k = K[v];
        ll area = max({acc[i], acc[j] - acc[i], acc[k] - acc[j], acc[N] - acc[k]}) - min({acc[i], acc[j] - acc[i], acc[k] - acc[j], acc[N] - acc[k]});
        mi = min(mi, area);
      }
    }
  }
  cout << mi << endl;
  return 0;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool dfs(int st,int par,vector<vector<int> >&adj,vector<int>&p,vector<int>&h,vector<int>&g,vector<int>&b){
    bool ans=true;
    int flag=0;
    int x,y;
    for(int j=0;j<adj[st].size();j++){
        if(adj[st][j]!=par){
        //cout<<adj[st][j]<<" "<<par<<" "<<st<<endl;
            flag=1;
            ans=ans&dfs(adj[st][j],st,adj,p,h,g,b);
            g[st]+=g[adj[st][j]];
            b[st]+=b[adj[st][j]];
            p[st]+=p[adj[st][j]];
        }
    }
    if(flag==0){
        if(abs(h[st])>p[st]){
        	//cout<<st<<endl;
        	return false;
		}
        else {
            g[st]=(p[st]+h[st])/2;
            b[st]=(p[st]-h[st])/2;
            //cout<<st<<" "<<p[st]<<" "<<h[st]<<" "<<g[st]<<" "<<b[st]<<endl;
            if(g[st]+b[st]==p[st])
            return true;
            else return false;
        }
    }
    else{
        int x=(p[st]+h[st])/2;
        int y=(p[st]-h[st])/2;
        //cout<<st<<" "<<p[st]<<" "<<h[st]<<" "<<g[st]<<" "<<b[st]<<" "<<ans<<endl;
        if(x<0||y<0||(x+y)!=p[st]||(x-y)!=h[st]||abs(h[st])>p[st]||x<g[st])return ans&false;
        else {
        	g[st]=x;
        	b[st]=y;
        	return ans&true;
		}
    }
}

int main()
{
    int x;cin>>x;
    if(x>=30)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


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

using namespace std;
typedef long long ll;

int main() {
	int N;
	cin >> N;
	string p;
	cin >> p;
	if (N%2!= 0){
		cout << "No" << endl;
	} else {
		if (p.substr(0,N/2) == p.substr(N/2)){
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()		//sort(all(vi S)) sort(all(string S))
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }

using P = pair<int, int>;		//P.first, P.second
typedef long long ll;
typedef vector<int> vi;
typedef set<int> seti;
typedef vector<string> vs;

const int MOD = 1e9+7;
const int INF = 1e9;

int main() {
	int N;
	cin>>N;
	vector<int> a(N);
	rep(i,N)cin>>a[i];
	sort(all(a));
	int maxa = a[N-1];
	int mid = maxa/2;
	int d =  INF;
	int xx = 0;
	rep(i,N){
		if(abs(mid - abs(maxa-a[i]))<d){
			xx = a[i];
			d = abs(mid-abs(maxa-a[i]));
		}
		cerr<<d<<endl;
	}
	print(a);
	cout<<maxa<<" "<<xx<<endl;
}

Measured memory_bytes: 640
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define int ll
using pint = pair<int,int>;
using Graph = vector<vector<int>>;
void YN(bool flg) {cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg) {cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg) {cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#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 out(n) cout << n << '\n'
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 1e10; //10^10
const double PI = acos(-1.0L);
/*mod逆元*/long long modinv(long long a, long long m) {long long b = m, u = 1, v = 0;while (b) {long long t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}
template< typename T >T mod_pow(T x, T n, T p=MOD) {T ret = 1;while(n > 0) {if(n & 1) (ret *= x) %= p;(x *= x) %= p;n >>= 1;}return ret;}
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>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n >>= 1; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}

//----------------ライブラリとか----------------

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);

    string s; cin >> s;
    if(s=="Sunny") out("Cloudy");
    if(s=="Cloudy") out("Rainy");
    if(s=="Rainy") out("Sunny");

    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast",3,"inline")
#include<bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
#define m_p make_pair
#define y1 ygftgfgcdtfgxffgx
#define y2 yfdsesgvtyghftfvv
#define x1 xvyr6cf6fgcfgf676
#define x2 xcr6rfc5r66y6r6fr
#define up_bound upper_bound
#define low_bound lower_bound
#define next_per next_permutation
#define pb push_back
#define i_to_s to_string
typedef priority_queue<int> p_queue;
typedef priority_queue<int, vector<int>, greater<int> > min_p_queue;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int mon[20]={31,28,31,30,31,30,31,31,30,31,30,31};
ll gcd(ll x,ll y){return ((y==0)?x:gcd(y,x%y));}
inline int read(){
	int x=0;char ch=getchar();
	while(ch<'0'||ch>'9')ch=getchar();
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	int x;cin>>x;
	if(x>=30)cout<<"Yes";
	else cout<<"No";
	return 0;
}



Measured memory_bytes: 3632
#include <bits/stdc++.h>
#include <numeric>
#include <limits>
#include <numeric>
#include <type_traits>
using namespace std;
typedef pair<int, int> P;

typedef long long ll;
const int MOD = 1000000007;

int main(){  
    string s;
    cin >> s;
    int count[26] ={};
    for(int i=0;i<4;i++){
        count[s[i]-'A']++; 
    }
    for(int i=0;i<26;i++){
        if(!(count[i]==2||count[i]==0)) {
            cout << "No";
            return 0;
        }
    }
    cout << "Yes";
}



Measured memory_bytes: 256
import os
import sys
from collections import defaultdict

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


# MOD = 998244353

def div_mod(a, b, mod):
    return a * pow(b, mod - 2, mod) % mod


N = int(sys.stdin.buffer.readline())
AB = [list(map(int, sys.stdin.buffer.readline().split())) for _ in range(N - 1)]

graph = [[] for _ in range(N)]
for a, b in AB:
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)

# 頂点ごとに穴あきになる確率を調べる
# 全パターン数 2^N を掛けて合計すればいい
# 自分をrootにしたときに黒をもつ子が2つ以上ある

children_counts = [defaultdict(int) for _ in range(N)]
hist = []
root = 0
stack = [(root, None)]
while stack:
    v, parent = stack.pop()
    hist.append((v, parent))
    for u in graph[v]:
        if u == parent:
            continue
        stack.append((u, v))
hist.reverse()
dfs = [0] * N
for v, parent in hist:
    ret = 0
    for u in graph[v]:
        if u == parent:
            continue
        cnt = dfs[u]
        children_counts[v][cnt] += 1
        ret += cnt
    ret += 1
    if v != root:
        children_counts[v][N - ret] += 1
    dfs[v] = ret
# print(dfs)

pow2 = [1]
p = 1
for _ in range(N):
    p = (p * 2) % MOD
    pow2.append(p)

# 穴あきにならない期待値
E = [0] * N
for v, counts in enumerate(children_counts):
    if len(graph[v]) == 1:
        # 端っこ
        E[v] = pow2[N]
        continue
    # 黒のときはどう選んでもダメ
    e = pow2[N - 1]
    # 1つだけ黒が含まれる確率は
    for children, cnt in counts.items():
        # ほかが全部白なのは1パターン
        # 1つ以上黒が含まれるのは
        curo = pow2[children] - 1
        e += (curo * cnt) % MOD
    # 自分の色は白
    # 全部白のパターン加算
    E[v] = (e + 1) % MOD
# 穴あきになる期待値
E = [(pow2[N] - e) % MOD for e in E]
ans = div_mod(sum(E), pow2[N], MOD)
print(ans)


Measured memory_bytes: 165600
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>

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

using namespace std;


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

	const long long int mod = 1e9+7;
	long long int ans=1, n, x;
	stack<long long int> st;
	
	cin >> n;
	
	while(n--){
		cin >> x;
		st.push(x);
		if(x >= 2*st.size() - 1){
		}
		else{
			ans = ans * st.size() % mod;
			st.pop();
		}
	}
	
	rep(i,st.size())
		ans = ans * (i+1) % mod;
	
	cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1152
import sys

rl = sys.stdin.readline


def solve():
    N, A = map(int, rl().split())
    x = list(map(int, rl().split()))
    
    y = [xi - A for xi in x]
    dp = [[0] * 5001 for _ in range(N + 1)]
    dp[0][2500] = 1
    
    for i in range(N):
        for j in range(5001):
            if 0 <= j - y[i] < 5001:
                dp[i + 1][j] = dp[i][j] + dp[i][j - y[i]]
            else:
                dp[i + 1][j] = dp[i][j]
    print(dp[N][2500] - 1)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 5620
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
using namespace __gnu_pbds;
using namespace std;

#define pb                push_back
#define all(x)            (x).begin(),(x).end()
#define int               long long
#define INF               1e18
#define ff                first
#define ss                second
#define vi                vector<int>
#define pii               pair<int,int>
#define mii               map<int,int>
#define endl              "\n"
#define GCD(x,y)          (__gcd((x), (y)))
#define LCM(x,y)          (((x)/__gcd((x), (y)))*(y))
#define debug(x)          cout<<#x<<" is "<<(x)<<endl
#define mem(a,x)          memset(a,x,sizeof(a))
#define rep(i,a,b)        for(long long i=a;i<b;i++)
#define sp(ans,p)         fixed <<setprecision(p)<<ans;
#define IOS ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);

typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;



constexpr int N = 3005;

int r, c, k;
int arr[N][N];
int dp[N][N][4];
int recur(int r, int c, int cnt)
{
    if (r < 0 || c < 0)
        return 0;
    int &res = dp[r][c][cnt];
    if (res == -1)
    {
        res = max(recur(r - 1, c, 0), recur(r, c - 1, cnt));
        if (cnt < 3 && arr[r][c])
            res = max(res, arr[r][c] + max(recur(r - 1, c, 0), recur(r, c - 1, cnt + 1)));
    }
    return res;
}

/*int recur(int r, int c, int pick)
{
    if (r < 0 || c < 0 || pick < 0)
    {
        return 0;
    }

    int ans = 0;

    // max(a[i-1][j][3]+g[i][j],max(a[i][j-1][k-1]+g[i][j],a[i][j-1][k]));
    int a = recur(r - 1, c, pick) + arr[r][c];
    int b = recur(r, c - 1, pick - 1) + arr[r][c];
    int cc = recur(r, c - 1, pick);
    int z = max(a, max(b, cc));
    cout << r << " " << c << " " << pick << " " << z << endl;
    return z;
}*/
void solve()
{
    mem(dp, -1);
    cin >> r >> c >> k;
    rep(i, 0, k)
    {
        int a, b, v;
        cin >> a >> b >> v;
        a--, b--;
        arr[a][b] = v;
    }
    cout << recur(r - 1, c - 1, 0) << endl;
    return;
}

signed main()
{
    IOS;
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    // sieve();
    int t = 1;
    // cin >> t;
    while (t--)   solve();
    return 0;
}

Measured memory_bytes: 356700
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <queue>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)

int main() {
    int n,a,b;
    cin>>a>>n;
    rep(i,n){
      cin>>b;
      a-=b;
    }
  	if(a>0)cout<<"No";
  	else cout<<"Yes";
	return 0;
}


Measured memory_bytes: 504
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	const double eps=1e-11;
	static void Main(){
		Sc sc=new Sc();
		var n=sc.I;
		var a=sc.Ia;
		a.Bs(100,false);
		var h=new int[2];
		for(int i = 0;i<n;i++) {h[i&1]+=a[i];}
		Console.WriteLine("{0}",h[0]-h[1]);
	}
}
static class Ex1{
	public static void Bs(this int[] a,int n,bool b){
		var h=new int[n+1];
		for(int i=0;i<a.Length;i++) {h[a[i]]++;}
		if(b){for(int i=0,j=0;i<=n;i++) {while(h[i]>0){a[j++]=i;h[i]--;}}}
		else{for(int i=n,j=0;i>=0;i--) {while(h[i]>0){a[j++]=i;h[i]--;}}}
	}
}
public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public double[] Da2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),double.Parse);}}
	public double[] Da3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),double.Parse);}
	public double[] Da3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),double.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}

Measured memory_bytes: 13268
n=int(input())
h=list(map(int,input().split()))
ans=0
j=0
cnt=0
a=[0]
while j<n-1:
	if h[j]>=h[j+1]:
		cnt+=1
	else:
		a.append(cnt)
		cnt=0
	j+=1
a.append(cnt)
print(max(a))



Measured memory_bytes: 14224
#include <bits/stdc++.h>
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define FSP(x) fixed << setprecision(x)
using namespace std;
using ll = long long;
constexpr ll INF = LLONG_MAX;
constexpr long double PI = acosl(-1);
void Yes() {cout << "Yes\n";}
void No() {cout << "No\n";}
void YES() {cout << "YES\n";}
void NO() {cout << "NO\n";}

#include <map>

/*	verified : 2020/07/18
		AOJ, Prime Factorize
		http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=NTL_1_A
*/

std::map<long long, long long> prime_fact(long long n) {
	std::map<long long, long long> ret;
	for (long long i = 2; i * i <= n; i++) {
		if (n % i) continue;
		long long cnt = 0;
		while (n % i == 0) {
			n /= i;
			cnt++;
		}
		ret[i] = cnt;
	}
	if (n > 1) ret[n] = 1;
	return ret;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	//constexpr ll P = 1e9 + 7;
	//constexpr ll P = 998244353;

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

	ll x = a[0];
	for (ll i = 1; i < n; i++) x = __gcd(x, a[i]);
	if (x > 1) {
		cout << "not coprime" << endl;
		return 0;
	}

	vector<ll> seen(1e6, false);
	for (ll i = 0; i < n; i++) {
		map<ll, ll> mp = prime_fact(a[i]);
		for (auto j : mp) {
			if (seen[j.first]) {
				cout << "setwise coprime" << endl;
				return 0;
			} else seen[j.first] = true;
		}
	}
	cout << "pairwise coprime" << endl;
}

Measured memory_bytes: 18708
#include <iostream>
#include <string>   
using namespace std;
 
int main(){
int a[2],b,c = 1;
;

while(cin >> a[0] >> a[1]){
b = a[0] + a[1];	
while(b >= 10){
	b = b/10;
	c++;
}
cout<<c<<endl;
c = 1;
}

}

Measured memory_bytes: 1160
#include <iostream> 
#include <string> 
#include <vector> 
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
using namespace std;

int main() {
	int R, G;
	cin >> R >> G;
	cout << G + (G - R) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
	int w[10],k[10];
	for(int i=0;i<10;i++)
		cin>>w[i];
	for(int i=0;i<10;i++)
		cin>>k[i];
	for(int i=0;i<9;i++){
		for(int j=9;j>i;j--){
			if(w[j]>w[j-1]){
				int tmp=w[j];
				w[j]=w[j-1];
				w[j-1]=tmp;
			}
		}
	}
	for(int i=0;i<9;i++){
		for(int j=9;j>i;j--){
			if(k[j]>k[j-1]){
				int tmp=k[j];
				k[j]=k[j-1];
				k[j-1]=tmp;
			}
		}
	}
	cout<<w[0]+w[1]+w[2]<<" "<<k[0]+k[1]+k[2]<<endl;
	return 0;
}

Measured memory_bytes: 1164
//verma_ankit484

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define pb push_back
const int mod = (int) 1e9+7;

using namespace std;
//using namespace __gnu_pbds;

//#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>


int32_t main() {
  IOS
  #ifdef AV
  freopen("input.txt", "r", stdin);
  #endif
  int k;
  cin >> k;
  int sum = 0;
  for (int i = 1; i <= k; i++) {
    for (int j = 1; j <= k; j++) {
      for (int p = 1; p <= k; p++) {
        int gcd = __gcd(i, j);
        gcd = __gcd(gcd, p);
        sum += gcd;
      }
    }
  }
  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 3648
#include "bits/stdc++.h"
using namespace std;
using ll = long long; using ull = unsigned long long;
//#define int ll
using vb = vector<bool>; using vvb = vector<vb>;
using vi = vector<int>; using vvi = vector<vi>;
using vl = vector<ll>; using vvl = vector<vl>;
template<class T> using V = vector<T>;
template<class T> using VV = vector<V<T>>;
#define fi first
#define se second
#define maxs(x,y) (x=max(x,y))
#define mins(x,y) (x=min(x,y))
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(ll i = (ll)(b)-1;i >= a;--i)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1), EPS = 1e-10;
const ll MOD = 1e9+7;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
signed main(){
  int n;
  cin >> n;
  vi a(n);
  int c = 0;
  REP(i,n) cin >> a[i];
  REP(i,n){
    if(a[i]<0) c++;
  }
  vi b(n);
  REP(i,n){
    b[i] = abs(a[i]);
  }
  ll sum = 0;
  sort(ALL(b));
  sum = accumulate(ALL(b),0LL);
  if(c&1) sum -= b[0]*2;
  cout << sum << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define lli long long int

using namespace std;

int main() {
    
    lli n,k,q;
    cin>>n>>k>>q;
    lli x,sum=0;
    map<lli,lli>mp;
    for(lli i=0;i<q;i++)
    {
        cin>>x;
        mp[x]++;
        
    }
    //cout<<sum<<endl;
    
    for(lli i=1;i<=n;i++)
    {
        sum+=mp[i];
    }
    
    for(lli i=1;i<=n;i++)
    {
        if((sum-mp[i])>=k)
        {
            cout<<"No"<<endl;
        }
        else
        {
            cout<<"Yes"<<endl;
        }
    }
    
}

Measured memory_bytes: 6912
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  string s;
  vector<int> a(4);
  int N;
  cin >> N;
  for(int i=0;i<N;i++){
    cin >> s;
    if(s=="AC"){
      a.at(0)++;
    }else if(s=="WA"){
      a.at(1)++;
    }else if(s=="TLE"){
      a.at(2)++;
    }else if(s=="RE"){
      a.at(3)++;
    }
  }
  cout << "AC" << " "<< "x" << " " << a.at(0) << endl;
  cout << "WA" << " "<< "x" << " " << a.at(1) << endl;
  cout << "TLE" << " "<< "x" << " " << a.at(2) << endl;
  cout << "RE" << " " << "x" << " " << a.at(3) << endl;
}

Measured memory_bytes: 3636
#include<cstdio>

int main(){
	int n;
	int a[] = {1,4,10,20,35,56,84,120,165,220,282,348,415,480,540,592,633,660,670,660,633,592,540,480,415,348,282,220,165,120,84,56,35,20,10,4,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
	while(scanf("%d", &n) + 1){
		printf("%d\n", a[n]);
	}
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
    int n;
    int a[200005], b[200005];
    scanf("%d", &n);
    int i;
    for (i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
        b[i] = a[i];
    }
    sort(b, b + n);
    for (i = 0; i < n; i++)
    {
        if (b[n - 1] != a[i])
            printf("%d\n", b[n - 1]);
        else
            printf("%d\n", b[n - 2]);
    }
    return 0;
}


Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
#define cin(a) scanf("%d",&a)
#define pii pair<int,int>
#define ll long long
#define gcd __gcd
const int inf = 0x3f3f3f3f;
const int maxn = 1110;
const int M = 1e9+7;

int a[maxn];
int b[maxn];

int dp[20010];

int main()
{
	int h,n;
	cin>>h>>n;
	for(int i = 1; i <= n; i++) 
	{
		cin>>a[i]>>b[i];
	}
	mem(dp,inf);
	dp[0] = 0;
	int ans = inf;
	for(int i = 1; i <= n; i++) 
	{
		for(int j = a[i]; j <= h+a[i]; j++)
		{	
			dp[j] = min(dp[j],dp[j-a[i]]+b[i]);
			if(j >= h) ans = min(ans,dp[j]);
		}
	}
	cout<<ans<<endl;
	return 0;
}

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

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

    for(int i = 1; i <= N+10; ++i){
        if(floor((double)i*1.08) == N){
            cout << i << endl;
            return 0;
        }
    }

    cout << ":(" << endl;
}

Measured memory_bytes: 256