akhauriyash/Code-Regression huggingface dataset:
import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;
import std.container;

alias sread = () => readln.chomp();
ulong bignum = 1_000_000_007;
alias SugarWater = Tuple!(long, "swater", long, "sugar");

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

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

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

void main()
{
    auto n = lread();
    long mini = n;
    foreach (i; iota(0, n + 1))
    {
        auto rest = n - i;
        auto nine = calmoves(i, 9);
        auto six = calmoves(rest, 6);
        mini = min(nine + six, mini);
    }
    mini.writeln();
}

auto calmoves(long n, long div)
{
    auto powers = [div];
    while (powers[$ - 1] < n)
        powers ~= powers[$ - 1] * div;
    // powers.writeln();
    long moves, current = powers.length - 1;
    while (current >= 0)
    {
        auto t = n / powers[current];
        // writefln("%stimes : %s", n, t);
        moves += t;
        n -= powers[current] * t;
        current--;
    }
    return moves + n;
}

Measured memory_bytes: 1276
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>

using namespace std;

int main()
{
    int N;
    if (scanf("%d", &N) < 1) return 0;

    char tmp[101];
    if (scanf("%s", tmp) < 1) return 0;

    int ren1 = 0;
    int ren2 = 0;
    for (int i = 0; i < N; i++)
    {
        if (0 < ren2 && tmp[i] == ')') ren2--;
        else if (tmp[i] == ')') ren1++;
        else ren2++;
    }

    for (int i = 0; i < ren1; i++) printf("%c", '(');
    printf("%s", tmp);
    for (int i = 0; i < ren2; i++) printf("%c", ')');
    printf("\n");
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) SORT(var); REVERSE(var)
#define OPTIMIZE_STDIO ios::sync_with_stdio(false);cin.tie(0);cout.precision(10);cout << fixed
#define endl '\n'

const ll MOD = 1e9 + 7;
struct mint {
    ll x;
    mint() : x(0) {}
    mint(ll x) : x((x % MOD + MOD) % MOD) {}
    mint& operator+=(const mint& r) { if ((x += r.x) >= MOD) { x -= MOD; } return *this; }
    mint& operator-=(const mint& r) { if ((x -= r.x) < 0) { x += MOD; } return *this; }
    mint& operator*=(const mint& r) { if ((x *= r.x) > MOD) { x %= MOD; } return *this; }
    mint& operator++() { if ((++x) >= MOD) { x -= MOD; } return *this; }
    mint operator++(int) { mint ret = x; if ((++x) >= MOD) { x-= MOD; } return ret; }
    mint& operator--() { if ((--x) < 0) { x += MOD; } return *this; }
    mint operator--(int) { mint ret = x; if ((--x) < 0) { x += MOD; } return ret; }
    mint operator+(const mint& r) { mint ret; return ret = x + r.x; }
    mint operator-(const mint& r) { mint ret; return ret = x - r.x; }
    mint operator*(const mint& r) { mint ret; return ret = x * r.x; }
    mint operator-() { return mint() - *this; }
    bool operator<(const mint& a) { return x < a.x; }
    bool operator>(const mint& a) { return x > a.x; }
    bool operator<=(const mint& a) { return x <= a.x; }
    bool operator>=(const mint& a) { return x >= a.x; }
    bool operator==(const mint& a) { return x == a.x; }
    bool operator!=(const mint& a) { return x != a.x; }
};
ostream& operator<<(ostream& os, const mint& r) { os << r.x; return os; }
ostream& operator>>(ostream& os, const mint& r) { os >> r.x; return os; }

void solve(istream& cin, ostream& cout) {
  int a1, a2, a3;
  cin >> a1 >> a2 >> a3;
  if (a1 + a2 + a3 <= 21) cout << "win" << endl;
  else if (a1 + a2 + a3 >= 22) cout << "bust" << endl;
}

#ifndef TEST
int main() {
  OPTIMIZE_STDIO;
  solve(cin, cout);
}
#endif


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
    class ABC
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] A = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] B = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int[] C = new int[N + 1];
            int[] D = new int[N + 1];

            for(int i = 1; i <= N; i++)
            {
                C[i] = C[i - 1] + A[i - 1];
                D[i] = D[i - 1] + B[i - 1];
            }

            int ans = 0, tmp = 0;
            for(int i = 1; i <= N; i++)
            {
                tmp = C[i] + D[N] - D[i - 1];
                ans = Math.Max(ans, tmp);
            }

            Console.WriteLine(ans);
            
            Console.ReadLine();
        }
    }
}


Measured memory_bytes: 13396
// garnab27
#include <bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define ll int64_t
#define F first
#define S second
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
ll modex(ll a,ll b,ll p){ll res=1;a%=p;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b>>=1;}return res;}
int dx[]={1,0,-1,0,1,-1,-1,1};
int dy[]={0,1,0,-1,1,1,-1,-1};
 
int a[102];
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(NULL);cout.tie(NULL);	
 
	int n,m;
	cin>>n>>m;

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

	int ans = 0;
	for(int i=0;i<n;i++) {
		if(4*m*a[i]>=s) ans++;
	}

	cout<<((ans>=m)?"Yes":"No");

 
 
	return 0;
}

Measured memory_bytes: 256
N = int(input())
a = list(map(int, input().split()))
a = sorted(a)


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


g = a[0]
for i in range(1, N):
    g = gcd(g, a[i])

print(g)


Measured memory_bytes: 14224
n = int(input())
a = list(map(int,input().split()))
color =set()
t = 0
for i in range(n):
    if a[i] <=399:
        a[i] = "gray"
    elif a[i]<= 799:
        a[i] = "brown"
    elif a[i]<=1199:
        a[i] = "green"
    elif a[i] <= 1599:
        a[i] = "water"
    elif a[i] <= 1999:
        a[i] ="blue"
    elif a[i] <=2399:
        a[i] ="yellow"
    elif a[i] <=2799:
        a[i] ="daidai"
    elif a[i] <= 3199:
        a[i] = "red"
    else:
        a[i] = "target"
        t += 1
for i in range(n):
    if a[i] != "target":
       color.add(a[i])
    else:
        continue
if len(list(color)) >=1:
    print(len(list(color)),len(list(color))+t)
else:
    print(1,t)

Measured memory_bytes: 3188
#include <stdio.h>
#include <string.h>
int main(void){
  char s[1100],t[1100];
  int a,i;
  if ( scanf("%s\n%s",s,t) == EOF) return 1;
  a=strlen(t);
  
  for (i=0;i<=strlen(s)-strlen(t);i++){
    int cnt = 0,j;
    for(j=0;j<strlen(t);j++){
      if(t[j]!=s[i+j]) cnt++;
    }
    if(cnt<a) a=cnt;
  }
  printf("%d\n",a);
  return 0;
}

Measured memory_bytes: 1704
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define Graph vector<vector<ll>>
constexpr ll INF=(1ll<<60);
constexpr ll mod=1000000007;
constexpr double pi=3.14159265358979323846;
template<typename T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template<typename T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}

ll mypow(ll a,ll b){
    ll ret=1;
    while(b!=0){
        ret*=a;
        b--;
    }
    return ret;
}

int main(){
    ll a,b,c,k;cin>>a>>b>>c>>k;
    bool ok=false;
    
    rep(i,k+1){
        if(a<mypow(2,i)*b && mypow(2,i)*b<mypow(2,k-i)*c){
            ok=true;
        }
    }

    if(ok){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
	return 0;
}

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

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	string S;
	cin >> S;
	vector<int> a(S.size() + 1);
	char fi = S[0];
	S.push_back(S[S.size() - 1]);
	//int b = 1;
	int c = 0;
	vector<int> res(S.size() + 1);
	for (int i = 0; i < a.size(); ++i) {
		if (S[i] != S[i+1]) {
			if (fi == '>') {
				res[c] = i - c + 1;
				fi = S[i + 1];
				c = i + 1;
			}
			else {
				res[i] = i - c + 1;
				fi = S[i + 1];
				c = i + 1;
			}
		}
		if (i == a.size() - 1 && fi == '<') {
			res[c] = i - c;
			fi = S[i + 1];
			c = i + 1;
		}
		else if (i == a.size() - 1 && fi == '>') {
			res[c] = i - c + 1;
			fi = S[i + 1];
			c = i + 1;
		}
	}
	/*rep(i, res.size()) cout << res[i] << ' ';
	cout << endl;*/
	ll ans = 0;
	vector<ll> res2;
	rep(i, res.size()) {
		ll k = 1;
		while (k <= res[i]) {
			ans += k;
			k++;
		}
		if (res[i] != 0) res2.push_back(res[i]);
	}
	ans -= res2[res2.size() - 1];
	/*cout << ans << endl;
	rep(i, res2.size()) cout << res2[i] << ' ';
	cout << endl;*/
	int g;
	if (S[0] == '<') g = 0;
	else g = 1;
	for (int i = g; i < res2.size() - 1; i = i + 2) {
			int k = min(res2[i], res2[i + 1]);
			ans -= k;
	}
	//if (S[S.size() - 1] == '<') ans -= res2[res2.size() - 1];
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 7192
N = int(input())
ans = ''
if N == 0:
    print(0)
    quit()
while N != 1:
    if abs(N) % 2 == 1:
        ans += '1'
        N = (N-1) // -2
    else:
        ans += '0'
        N = N // -2
ans += '1'
print(ans[::-1])

Measured memory_bytes: 3060
#[allow(dead_code)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(dead_code)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(dead_code)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

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

fn main() {
    input!{
        n: usize,
        k: usize,
        q: usize,
        aa: [usize1; q]
    }
    let mut answers = vec![k; n];
    for a in aa {
        answers[a] = answers[a] + 1;
    }

    for a in answers {
        let result = if a > q {
            "Yes"
        } else {
            "No"
        };
        println!("{}", result);
    }

}


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

int main() {
  long long int N,sum=0;
  cin >> N;
  for(int i=1;i<=N;i++){
	if(i%3==0||i%5==0){
    }else{
	sum+=i;
    }
  }cout << sum;
}


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


int main(){
	int n;
	cin>>n;
	
	long long soma=0;
	
	int l[n];
	for (int i=0; i<n; i++) cin>>l[i];
	
	for (int i=0; i<n; i++){
		for (int j=i+1; j<n; j++) soma+=l[i]*l[j];
	}
	
	cout<<soma<<endl;
}


Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>

using namespace std;

//conversion
//------------------------------------------
inline long toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline long toLong(string s) {long v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

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

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-12;
const int INF = 10000;

char mp[52][52];

int dx[]={1,0,-1,0,-1,1,1,-1};
int dy[]={0,1,0,-1,-1,-1,1,1};
bool flag[52][52];

bool bfs(int s,int t){
	if(flag[s][t])return false;
	int sum=0;
	queue<PII>pi;
	pi.push(MP(s,t));
	flag[s][t]=true;
	while(!pi.empty()){
		PII p=pi.front();pi.pop();
		sum++;
		REP(i,8){
			int y=p.first+dy[i],x=p.second+dx[i];
			if(mp[y][x]=='1'&&!flag[y][x]){
				flag[y][x]=true;
				pi.push(MP(y,x));
			}
		}
	}
	return true;
}
int main(){
	int W,H;
	while(cin>>W>>H){
		if(W==0&&H==0)break;
		REP(i,52)REP(j,52){
			mp[i][j]='0';
		}
		CLR(flag);
		int y,x;
		REP(i,H)REP(j,W){
			cin>>mp[i+1][j+1];
		}
		int sum=0;
		REP(i,H)REP(j,W){
			if(mp[i+1][j+1]=='1'&&bfs(i+1,j+1))sum++;
		}
		//cout<<"!"<<y<<" "<<x<<endl;
		cout<<sum<<endl;
	}
	return 0;
}

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

int main()
{
	/*#ifndef ONLINE_JUDGE
		freopen("in.txt","r",stdin);
		freopen("out.txt","w",stdout);
	#endif*/
	ios_base::sync_with_stdio(false);
   	cin.tie(NULL);
   	ll N,M; cin >> N >> M;
   	vector<bool> broken(N+1, true);

   	for (int i = 0; i < M; ++i)
   	{
   		ll a; cin >> a;
   		broken[a] = false;
   	}

	ll pasos = 1;
   	ll p = 0;

   	for (ll i = 1; i < N+1; ++i)
   	{
   		if (!broken[i] and !broken[i-1])
   		{
   			pasos = 0;
   			break;
   		}
   		if (broken[i] and broken[i-1] and (i > 1 and broken[i-2]))
   		{
   			ll aux = pasos;
   			pasos = (pasos + p) % 1000000007;
   			p = aux;
   		}
   		else if (i==1 and broken[i])
   		{
   			ll aux = pasos;
   			pasos = (pasos + p) % 1000000007;
   			p = aux;
   		}
   		else
   		{
   			p = pasos;
   		}
   	}

   	cout << pasos%1000000007 << '\n';



	return 0;	
}


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

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

#include <cassert>
#include <functional>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(...) ;
#else
#define debug(...) cerr << __LINE__ << " : " << #__VA_ARGS__ << " = " << _tostr(__VA_ARGS__) << endl;

template<typename T>
ostream &operator<<(ostream &out, const vector<T> &v);

template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template<typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}

void _tostr_rec(ostringstream &oss) {
  oss << "\b\b \b";
}

template<typename Head, typename... Tail>
void _tostr_rec(ostringstream &oss, Head &&head, Tail &&... tail) {
  oss << head << ", ";
  _tostr_rec(oss, forward<Tail>(tail)...);
}

template<typename... T>
string _tostr(T &&... args) {
  ostringstream oss;
  int size = sizeof...(args);
  if (size > 1) oss << "{";
  _tostr_rec(oss, forward<T>(args)...);
  if (size > 1) oss << "}";
  return oss.str();
}
#endif

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


int main() {
  int N, A[SIZE];

  scanf("%d", &N);

  for (int i = 0; i < N; i++) {
    scanf("%d", A + i);
  }

  sort(A, A + N, greater<int>());

  queue<int> que1, que2;

  ll ans = 0;
  int last = A[0];

  que1.push(A[0]);
  que2.push(A[0]);

  for (int i = 1; i < N; i++) {
    if (que2.empty()) {
      swap(que1, que2);
      que1.push(que2.front());
      last = que2.front();
      que2.pop();
    }

    ans += min(last, que2.front());
    debug(last, que2.front());
    que1.push(A[i]);
    que1.push(que2.front());
    last = que2.front();
    que2.pop();
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 5260
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.List;
import java.util.Queue;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		execute5_3();
	}
	
	private static void execute5_3() {
		try (Scanner sc = new Scanner(System.in)) {
			int H = sc.nextInt();
			int A = sc.nextInt();
			
			int ans = (H+A-1)/A;
			
			
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 21716
#include<cstdio>
#include<cstring>
#include<iostream>
#include<cstdlib>
using namespace std;

int main()
{
    string s;
    cin>>s;
    if (s.size()==2) cout<<s<<endl;
    else cout<<s[2]<<s[1]<<s[0]<<endl;
    return 0;
}

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

int main(){
    
while(1){
    
    int n;
    cin >> n;
    if(n==0) break;
    vector<int> vec(n,0);
    vector<int> comp(n-1,0);
    for(int i=0;i<n;i++){
        cin >>vec.at(i);
    }
    sort(vec.begin(),vec.end());
    for(int i=0;i<n-1;i++){
        comp.at(i)=vec.at(i+1)-vec.at(i);
    }
    sort(comp.begin(),comp.end());
    cout << comp.at(0) << endl;
}
}










Measured memory_bytes: 3104
/*-- ILSH  --*/
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back 
#define pop pop_back
#define mp make_pair
#define vii vector < ll >
#define vll vector < ll > 
#define dt cout<<"HERE\n";
#define pii pair < ll , ll >
#define pll pair < ll , ll >
#define vpi vector < pii >
#define vpl vector < pll >
#define fi first
#define se second 
#define sz size 
#define len length 
const ll inf=1e18+1e17;
const ll mod =1e9+7;
//const ll mod = 998244353;

ll modInverse(ll a,ll m){ll m0=m;ll y=0,x=1;if(m == 1)return 0;while(a> 1){ll q=a/m;ll t=m;m=a%m,a=t;t=y;y=x-q*y;x=t;}if(x<0)x+=m0;return x;}  
ll powm(ll a,ll b){a=a%mod;ll res=1;while(b){if(b&1)res=(res*a)%mod;a=	(a*a)%mod;b>>=1;}return (res%mod);}
const int N = 2e5 + 5 ;


void solve(){int n,k;
	cin>>n>>k;
	int arr[n];
	for ( int i=0;i<n;i++)
		cin>>arr[i];
	sort( arr,arr+n);
	ll aa=0;
	for ( int i=0;i<k;i++)
		aa+=arr[i];
	cout<<aa<<'\n';
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie( NULL);
	cout.tie(NULL);
//	/*
	#ifndef ONLINE_JUDGE
		freopen ("INPUT.txt" , "r" , stdin);
		freopen ("OUTPUT.txt", "w" , stdout);
	#endif
// */
	ll t=1;
	//cin>>t;
	for ( ll i=1;i<=t;i++){
		//cout<<"Case #"<<i<<": ";
    	solve();
    }
}

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

using namespace std;

int main()
{
    char a;
    cin >> a;
    int temp = (int)a;
    if (temp >= 65 && temp <= 90)
    {
        cout << "A" << endl;
    }
    else
    {
        cout << "a" << endl;
    }
}

Measured memory_bytes: 3632
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <vector>
#include <sstream>
#include <set>
using namespace std;
using ll = long long;

class range {private: struct I{int x;int operator*(){return x;}bool operator!=(I& lhs){return x<lhs.x;}void operator++(){++x;}};I i,n;
public:range(int n):i({0}),n({n}){}range(int i,int n):i({i}),n({n}){}I& begin(){return i;}I& end(){return n;}};

int main() {
  int a, b;
  while (cin >> a >> b) {
    if (a <= 0 && b >= 0) {
      cout << "Zero" << endl;
    } else if (b < 0) {
      if ((b - a) % 2) cout << "Positive" << endl;
      else cout << "Negative" << endl;
    } else if (a > 0) {
      cout << "Positive" << endl;
    }
  }
}



Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 200000
#define INF 1000000000
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define OUT(a) cout<<(a)<<endl
typedef pair<int,int> P;
const int MAX = 1000000;
const int MOD = 1000000007;
int main(){
	int a,b;
    cin>>a>>b;
    OUT(max({a+b,a-b,a*b}));
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int[] nums = new int[num];
		for(int i = 0; i < num; i++)nums[i] = sc.nextInt();
        int ans = nums[0];
        
        for(int i = 1; i < num; i++) {
            ans = Divisor.gcd(ans, nums[i]);
        }

		System.out.println(ans);
	}
}

class Divisor{
    public static int gcd(int a, int b){
        if(b == 0)return a;
        return gcd(b, a%b);
    }
}



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

int main() {
  while(1) {
    int h,m,s,time=7200;
    cin >> h >> m >> s;
    if(h==-1 && m==-1 && s==-1) break;
    
    time-=s+m*60+h*3600;
    
    for(int i=0; i<2; i++) {
      h=time/3600;
      m=(time-h*3600)/60;
      s=time%60;
      cout << "0" << h << ":";
      if(m<10) cout << "0";
      cout << m << ":";
      if(s<10) cout << "0";
      cout << s << endl;
      time*=3;
    }
  }
  return 0;
}


Measured memory_bytes: 1160
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <iostream>
using namespace std;
int main(){
	int ans = 0;
	long long x, y;
	cin >> x >> y;
	while(1){
		if(x > y)
			break;
		x *= 2;
		ans++;
	}
	cout << ans << endl;
	return 0;
}

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

int main(){
  int n,k;
  while(true){
    cin >> n >> k;
    if (!n&&!k)
      break;
    int s[k];
    int b[k];
    for(int i=0;i<k;i++){
      b[i] = 0;
      cin >> s[i];
    }
    int bb;
    for(int j=0;j<n;j++)
      for(int i=0;i<k;i++)
	cin >> bb,b[i]+=bb;
    int ii;
    for(ii=0;ii<k;ii++)
      if (s[ii]<b[ii])
	break;
    if (ii==k)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 856
#include<bits/stdc++.h>
using namespace std;
int dp[81][81][6400 * 2 + 2];
int find_it(int dif_sum , int i , int j , int &n , int &m , vector<vector<pair<int , int>>> & matrix){
    if(i == n - 1 && j == m - 1){
        return min(abs(dif_sum + matrix[i][j].first - matrix[i][j].second) , abs(dif_sum + matrix[i][j].second - matrix[i][j].first));
    }
    if(dp[i][j][dif_sum] != -1){
        return dp[i][j][dif_sum];
    }
    int minvalue = INT_MAX;
    if(i + 1 < n){
        minvalue = min(minvalue , find_it(dif_sum + (matrix[i][j].first - matrix[i][j].second) , i + 1 , j , n , m , matrix));
        minvalue = min(minvalue , find_it(dif_sum + (matrix[i][j].second - matrix[i][j].first) , i + 1 , j , n , m , matrix));

    }
    if(j + 1 < m){
        minvalue = min(minvalue , find_it(dif_sum + (matrix[i][j].second - matrix[i][j].first) , i , j + 1 , n , m , matrix));
        minvalue = min(minvalue , find_it(dif_sum + (matrix[i][j].first - matrix[i][j].second) , i , j + 1 , n , m , matrix));
    }
    return dp[i][j][dif_sum] = minvalue;

}
int main(){

	ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n , m;
    cin >> n >> m;
    vector<vector<pair<int , int> > > matrix(n , vector<pair<int , int>> (m));

    for(int i = 0; i < n; ++i){
        for(int j = 0; j < m; ++j){
            cin >> matrix[i][j].first;
        }
    }
    for(int i = 0; i < n; ++i){
        for(int j = 0; j < m; ++j){
            cin >> matrix[i][j].second;
        }
    }
    memset(dp , -1 , sizeof(dp));
    cout << find_it(0 , 0 , 0 , n , m , matrix);


return 0;
}


Measured memory_bytes: 328448
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

import sys, os
#def input(*args):
#    pass

def main():
    a, b = map(int, input().split())
    #print("a: {}".format(a))
    add = a + b
    sub = (a - b)
    mul = a * b
    max_val = max(add, sub, mul)
    print(max_val)

if __name__ == "__main__" :
    main()


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};

const int M=620,M2=310;
int h,w;
vvi a(M,vi(M));

ll f(int B=0){
	ll res=0;
	vvi b=a;
	for(int i=0;i<M;i++) for(int j=1;j<M;j++) b[i][j]+=b[i][j-1];
	for(int i=0;i<M;i++) for(int j=0;j<M;j++) if(a[i][j]){
		for(int k=j+1;k<M;k++) if(a[i][k]){
			int d=k-j;
			if(i+d<M) res+=b[i+d][k-B]-b[i+d][j-1+B];
			if(d<=i) res+=b[i-d][k-B]-b[i-d][j-1+B];
		}
	}
	for(int i=0;i<M;i++) for(int j=0;j<M;j++) b[M-j-1][i]=a[i][j];
	a=b;
	return res;
}

int main(){
	cin>>h>>w;
	for(int i=0;i<h;i++) for(int j=0;j<w;j++){
		char c;
		cin>>c;
		if(c=='#'){
			a[i+j+1][i-j+M2+1]++;
		}
	}
	cout<<f()+f(1)<<endl;
}

Measured memory_bytes: 3340
X = int(input())

L = [0]*10**6
i = 2
while i < 10**6:
    if L[i] != 0:
        i += 1
        continue
    L[i] = 1
    j = 2
    while i*j < 10**6:
        L[i*j] = -1
        j += 1
    i += 1
    
for i in range(X, 10**6):
    if L[i] == 1:
        print(i)
        break

Measured memory_bytes: 48620
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> PP;
int n,m;
int col[100005];
vector<int> G[100005];
int dist[100005];
vector<PP> vec;
int dist2[100005];

bool check(int vt){
	memset(dist2,-1,sizeof(dist2));
	int now=0;
	queue<int> que;
	int cnt=0;
	for(int i=0;i<=vt;i++){
		queue<int> tmp;
		while(que.size()){
			int v=que.front();
			cnt++;
			que.pop();
			for(int i=0;i<G[v].size();i++){
				if(dist2[G[v][i]]==-1){
					dist2[G[v][i]]=dist[v]+1;
					tmp.push(G[v][i]);
				}
			}
		}
		while(tmp.size()){
			int v=tmp.front();
			tmp.pop();
			que.push(v);
		}
		while(now<vec.size() && vec[now].first<=i){
			P p=vec[now].second;
			if(dist2[p.first]==-1){
				que.push(p.first);
				dist2[p.first]=i;
			}
			if(dist2[p.second]==-1){
				que.push(p.second);
				dist2[p.second]=i;
			}
			now++;
		}
	}
	int res=0;
	for(int i=0;i<n;i++){
		if(dist2[i]==-1 && (dist[i]%2!=vt%2 || dist[i]>vt))return false;
	}
	return true;
}

int main(void){
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++){
		int u,v;
		scanf("%d%d",&u,&v);
		u--;
		v--;
		G[u].push_back(v);
		G[v].push_back(u);
	}
	memset(dist,-1,sizeof(dist));
	dist[0]=0;
	queue<int> que;
	que.push(0);
	while(que.size()){
		int v=que.front();
		que.pop();
		for(int i=0;i<G[v].size();i++){
			if(dist[G[v][i]]==-1){
				dist[G[v][i]]=dist[v]+1;
				que.push(G[v][i]);
			}
		}
	}
	bool flag=false;
	for(int i=0;i<n;i++){
		for(int j=0;j<G[i].size();j++){
			if((dist[i]+dist[G[i][j]])%2==0){
				flag=true;
				vec.push_back(PP(max(dist[i],dist[G[i][j]]),P(i,G[i][j])));
			}
		}
	}
	if(!flag){
		printf("-1\n");
		return 0;
	}
	sort(vec.begin(),vec.end());
	vec.erase(unique(vec.begin(),vec.end()),vec.end());
	int l=0,r=n*3;
	while(l+1<r){
		int mid=(l+r)/2;
		if(check(mid*2))r=mid;
		else l=mid;
	}
	int nl=-1,nr=n*3;
	while(nl+1<nr){
		int mid=(nl+nr)/2;
		if(check(mid*2+1))nr=mid;
		else nl=mid;
	}
	printf("%d\n",min(r*2,nr*2+1));
	return 0;
}

Measured memory_bytes: 9532
#include <bits/stdc++.h>
using namespace std;
#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 ALL(v) v.begin(), v.end()
#define downque(que)  priority_queue<ll> que;
#define upque(que) priority_queue<ll, vector<int>, greater<int>> que;
typedef long long ll;
const int MOD = 1e9+7;


int main(){
  double a,b,x,v; 
  cin>>a>>b>>x;
  double t;
   v= (a*a*b)*0.50;
 if(v>=x){
  t=((a*b*b)/x)*0.50;
 }else if(v<x){
   t=(2*b)/a-(2*x)/pow(a,3);
 }

 double res=atan(t)*(180.0000/3.1415926535);
  cout << std::setprecision(12) << res;

}

Measured memory_bytes: 256
# https://atcoder.jp/contests/abc062/tasks/arc074_a

import itertools
from collections import Counter
from collections import defaultdict
import bisect
import math
import heapq

def main():
    H, W = map(int, input().split())

    # big value
    INF = int(1e15)
    ans = INF

    for h in range(1, H):
        sq1 = h * W

        rest_h = H - h
        # 横で割る   ___
        #           ___
        height1 = rest_h // 2
        height2 = rest_h - height1
        sq2 = height1 * W
        sq3 = height2 * W
        diff = max(sq1, sq2, sq3) - min(sq1, sq2, sq3)
        # print('diff = {}, {} {} {}'.format(diff, sq1, sq2, sq3))
        ans = min(ans, diff)

        # 縦で割る   ___
        #            |
        width1 = W // 2
        width2 = W - width1
        sq2 = width1 * rest_h
        sq3 = width2 * rest_h
        diff = max(sq1, sq2, sq3) - min(sq1, sq2, sq3)
        ans = min(ans, diff)

    for w in range(1, W):
        sq1 = w * H

        rest_w = W - w
        # 縦で割る
        height1 = H // 2
        height2 = H - height1
        sq2 = height1 * rest_w
        sq3 = height2 * rest_w

        diff = max(sq1, sq2, sq3) - min(sq1, sq2, sq3)
        ans = min(ans, diff)

        # 横で割る
        width1 = rest_w // 2
        width2 = rest_w - width1
        sq2 = width1 * H
        sq3 = width2 * H
        diff = max(sq1, sq2, sq3) - min(sq1, sq2, sq3)
        ans = min(ans, diff)


    print(ans)


if __name__ == '__main__':
    main()


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

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

int mat[N][N];
int lim;

int getMD(){
  int sum = 0;
  for(int i = 0; i < N; i++){
    for(int j = 0; j < N; j++){
      if(mat[i][j] == N*N-1) continue;
      sum += abs(mat[i][j]/4-i) + abs(mat[i][j]%4-j);
    }
  }
  return sum;
}

bool IDAstar(int depth,int prev,int py,int px){
  int MD = getMD();
  if(MD == 0) return true;
  if(depth + MD > lim) return false;

  for(int k = 0; k < 4; k++){
    int ny = py + dy[k];
    int nx = px + dx[k];
    if(ny < 0 || N <= ny || nx < 0 || N <= nx) continue;
    if(abs(k - prev) == 2) continue;
    swap(mat[ny][nx],mat[py][px]);
    if(IDAstar(depth+1,k,ny,nx)) return true;
    swap(mat[ny][nx],mat[py][px]);
  }
  return false;
}

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

  int py,px;
  for(int i = 0; i < N; i++){
    for(int j = 0; j < N; j++){
      cin >> mat[i][j];
      if(mat[i][j] == 0){
        mat[i][j] = N*N;
        py = i;
        px = j;
      }
      mat[i][j]--;
    }
  }

  for(lim = 0; lim < 100; lim++){
    if(IDAstar(0,100,py,px)){
      cout << lim << endl;
      return 0;
    }
  }

  return 0;
}



Measured memory_bytes: 3212
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define rrep(i,n) for(int (i)=1;i<=(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define MOD 998244353
#define INF 1e18
#define fcout cout << fixed << setprecision(15)
#define int long long
#define endl "\n"
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};

vector<int> dp(3030);

signed main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
	
	int n, s;
	cin >> n >> s;
	int a[n];
	rep(i, n) cin >> a[i];
	dp[0] = 1;

	rep(i, n) {
		vector<int> cur(s+1);
		rep(j, s+1) {
			if(j + a[i] <= s) cur[j + a[i]] += dp[j], cur[j + a[i]] %= MOD;
			cur[j] += dp[j] * 2, cur[j] %= MOD;
		}
		dp = cur;
	}
	cout << dp[s] << endl;
	return 0;
}

Measured memory_bytes: 3692
K=int(input())
count=0
from collections import deque


def bfs():
  count=0
  d=deque()
  for i in range(1,10):
    d.append(str(i))
    count+=1
    if count==K:
      print(i)
      return
  while count<K:
    S=d.popleft()
    if S[-1]=="9":
      for i in [8,9]:
        d.append(S+str(i))
        count+=1
        if count==K:
          print(S+str(i))
          break
    elif S[-1]=="0":
      for i in [0,1]:
        d.append(S+str(i))
        count+=1
        if count==K:
          print(S+str(i))
          break
    else:
      s=int(S[-1])
      for i in [s-1,s,s+1]:
        d.append(S+str(i))
        count+=1
        if count==K:
          print(S+str(i))
          break
bfs()

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

int main() {
  int n;
  cin>>n;
  vector<long long> l(n);
  for(int i=0;i<n;i++){
    cin>>l.at(i);
  }
  sort(l.begin(),l.end());
  
  long long ans=0LL;
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      for(int k=j+1;k<n;k++){
        if((l.at(i)!=l.at(j))&&(l.at(j)!=l.at(k))&&(l.at(i)+l.at(j)>l.at(k)))
          ans++;
      }
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 3632
N = int(input()) # 数字を変数に格納
S = input() # 文字列を変数に格納

List_1 = [0] * 10
List_2 = [[0] * 10 for i in range(10)]
List_3 = [[[0] * 10 for i in range(10)] for j in range(10)]

sum = 0
first = 0
second = 0
third = 0

for i in range(0,N-2):
    first = int(S[i])
    if List_1[first] == 0:
        List_1[first] = 1
        for j in range(i+1,N-1):
            second = int(S[j])
            if List_2[first][second] == 0:
                List_2[first][second] = 1
                for k in range(j+1,N):
                    third = int(S[k])
                    if List_3[first][second][third] == 0:
                        List_3[first][second][third] = 1
                        
for i in range(10):
    for j in range(10):
        for k in range(10):
            sum += List_3[i][j][k]

print(sum)

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

using namespace std;

//#define int long long
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define INF (1 << 30)

typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> Pi;
typedef pair<P, P> PP;

const int MOD = 1e9 + 7;
const int dy[]={0, 0, 1, -1};
const int dx[]={1, -1, 0, 0};

template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }

int N, a[50];
vector<P> vec;

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N;
    int maxi = 0, mini = INF;
    int r, l;
    rep(i, N) {
        cin >> a[i];
        if(maxi < a[i]) {
            chmax(maxi, a[i]);
            r = i + 1;
        }
        if(mini > a[i]) {
            chmin(mini, a[i]);
            l = i + 1;
        }
    }
    if(abs(maxi) < abs(mini)) {
        rep(i, N) if(a[i] != mini) vec.push_back(P(l, i + 1));
        for(int i = N - 1; i > 0; --i) vec.push_back(P(i + 1, i));
    }
    else {
        rep(i, N) if(a[i] != maxi) vec.push_back(P(r, i + 1));
        rep(i, N - 1) vec.push_back(P(i + 1, i + 2));
    }
    cout << vec.size() << endl;
    rep(i, vec.size()) cout << vec[i].first << " " << vec[i].second << endl;
    return 0;
}

Measured memory_bytes: 256
import collections
N = int(input())
s = [input() for i in range(N)]

counter = collections.Counter(s)
count = counter.most_common()

most = count[0][1]

c =[]
for i in range(len(count)):
    if count[i][1] == most:
        c.append(count[i])

c.sort()

for i in range(len(c)):
    print(c[i][0])

Measured memory_bytes: 47640
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
#include<set>
using namespace std;
int mod = 1e9+7;

int main() {

  long long int n, m; cin >> n >> m;
  vector<long long int> a(n);
  vector<long long int> b(n+1, 0);
  for(int i=0; i<n; i++){
    cin >> a[i];
    b[i+1] = a[i];
    b[i+1] += b[i];
  }

  long long int ans = 0;
  map<long long int, long long int> mp;
  for(int i=0; i<=n; i++){
    mp[b[i]%m]++;
  }

  for(auto i=mp.begin(); i!=mp.end(); i++){
    long long int x = i->second;
    ans += x * (x-1) / 2;
  }
  cout << ans << endl;

  return 0;
}




//


Measured memory_bytes: 5760
#ABC095_C
A,B,C,X,Y= map(int, input().split())
#AピザがA円、BピザがB円、ABのハーフハーフがC円。
#用意したいピザはAがX枚、BがY枚。
#Aピザをi枚買うとすると、ハーフハーフは2*(X-i)枚必要。
#このとき、Bピザの購入すべき枚数は

price_min = 1000000000
#初期値に注意する。どんどん安い値段が見つかるたびに更新したいのだから、
#初期値は十分大きくしておかないと、いつまでたっても最安値は更新されない

#Aピザをi枚買うとすると、iはi<=Xを満たす。
for i in range(X+1):
    #この時点ですでにBピザはX-i枚分ある。残りのピザをBピザとハーフピザで用意する。
    #この時点ですでにBピザが足りているなら、これ以上購入する必要はない。
    if Y <= X-i:
        price = i*A + 2*(X-i)*C
    #まだ足りないなら、残りY-（X-i）枚を用意する必要がある。
    #どちらを購入するかは、BとCの価格のうち、安いほうとすればよい。
    else:
        price = i*A + 2*(X-i)*C + min((Y-(X-i))*B,2*(Y-(X-i))*C)
    #print("Price now:", price)
    if price_min > price:
            #print("price_min",price_min,",price:",price)
            price_min = price
            #print("price_min changed to", price_min)
print(price_min)

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

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end() 
#define MOD 1000000007

typedef long long ll;
typedef pair <int, int> ii;
typedef pair <ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef long double ld;

long long INF=LLONG_MAX;

ll h[100111];
int dp[100111];

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    //freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
	int n; cin >> n;
	for(int i = 0; i < n; i++)cin >> h[i];
	dp[0] = 0; int ans = 0;
	for(int i = 1; i < n; i++){
		if(h[i]>h[i-1])dp[i] = 0;
		else dp[i] = dp[i-1]+1;
		ans = max(ans, dp[i]);
	}
	cout << ans << endl;
}	


Measured memory_bytes: 1408
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>



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

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

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a,b,c;
  cin>>a>>b>>c;
  cout<<(a^b^c)<<endl;

  return 0;

}


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

typedef long long ll;

const int Maxn = 300005;
const int mod = 1000000007;

int n;
ll a[Maxn];
int res;

int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
        scanf("%lld", &a[i]);
    for (ll b = 0; b < 60; b++) {
        int ones = 0, zers = 0;
        for (int i = 0; i < n; i++)
            if (a[i] & 1ll << b)
                ones++;
            else zers++;
        res = (ll(res) + (1ll << b) % mod * ones % mod * zers) % mod;
    }
    printf("%d\n", res);
    return 0;
}


Measured memory_bytes: 2560
#define _USE_NATH_DEFINES
#include<cstdio>
#include <iostream>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<complex>
#include <string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<numeric>
#include<limits>
#include<climits>
#include<cfloat>
#include<functional>
#include<iterator>
using namespace std;

int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if (a+b == c+d)
	{
		cout << "Balanced" << endl;
	}
	else if (a+b < c+d)
	{
		cout << "Right" << endl;
	}
	else if (a+b > c+d)
	{
		cout << "Left" << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
 
int main(){
    int a,b;
    cin >> a >> b;
    cout << "a ";
    if(a<b) cout << "< ";
    if(a==b) cout << "== ";
    if(a>b) cout << "> ";
    cout << "b" << endl;
     
     
    return 0;
}


Measured memory_bytes: 3096
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int N, K;
	cin >> N >> K;
	vector<int> x(N);
	for (int i = 0; i < N; ++i) {
		cin >> x[i];
	}
	int ret = 1012345678;
	for (int i = 0; i <= N - K; ++i) {
		int L = x[i], R = x[i + K - 1];
		if (0 <= L) ret = min(ret, R);
		else if (R <= 0) ret = min(ret, -L);
		else ret = min(ret, min((-L) * 2 + R, (-L) + R * 2));
	}
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 640
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <queue>
#include <stack>
#include <list>
#include <functional>
#include <numeric>
#include <iostream>

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)

int main() {

	char S[5123];
	int K;
	set<string> ss;

	scanf("%s %d", S, &K);

	int l = strlen(S);

	for (int i = l - 1; i >= 0; --i) {
		for (int j = 0; j < 5 && i - j >= 0; ++j) {
			ss.insert(string(S + i - j));
		}
		S[i] = '\0';
	}

	int i = 0;
	string a;
	for (auto sss : ss) {
		i++;
		a = sss;
		if (i == K) break;
	}

	printf("%s\n", a.c_str());

	return 0;
}


Measured memory_bytes: 1664
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

using namespace std;
using ll = long long;

#define EPS (1e-7)

int main() {
  ll N;
  cin >> N;
  vector<ll> A(N);
  for_each(begin(A), end(A), [](auto& x) { cin >> x; });

  sort(begin(A), end(A));
  ll ans = A.back();
  A.pop_back();
  N--;
  ll count = 0;
  while (N > 1) {
    ans += A.back();
    N--;
    count++;
    if (count > 1) {
      count = 0;
      A.pop_back();
    }
  }

  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4816
////////////////////////////////////////////////////////////////////
// This source code is for Visual Studio
////////////////////////////////////////////////////////////////////
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <stack>
#include <functional>
#include <iomanip>
#include <string>
#include <cstring>
#include <deque>
#include <math.h>

#define	numberof(a)	(sizeof(a) / sizeof(a[0]))
#define	INF		UINT64_MAX
#define Rep(i,n) for(int i = 0; i < (n); ++i )

using namespace std;

typedef vector< vector<int> > MAT;
typedef pair<int, int> PINT;
typedef long long ll;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int32_t s32;
typedef int64_t s64;

int main()
{
	string S = "";
	string ret = "";

	cin >> S;
	ret = "2018" + S.substr(4, S.length() - 1);

	cout << ret << endl;

	return 0;
}





Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define PI 3.1415926535

int main() {
    ll a, b;
    cin >> a >> b;
    ll o, p, q;
    o = a + b;
    p = a * b;
    q = a - b;
    ll ans = max(o, p);
    ans = max(ans, q);
    cout << ans << endl;
    

    
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] l = {5, 7, 5, 7, 7};
        while(true) {
            int n = sc.nextInt();
            if(n == 0) break;
            String[] w = new String[n];
            for(int i = 0; i < n; i++) {
            	w[i] = sc.next();
            }
            int ind = 0;
            int i = 0;
            int ans = 0;
            while(true) {
            	int sum = 0;
            	int j = 0;
            	while(sum < l[ind]) {
            		sum += w[i + j].length();
            		j++;
            	}
            	if(sum == l[ind]) {
            		//System.out.println(ind + " " + i);
            		if(ind == 4) {
            			System.out.println(ans + 1);
            			break;
            		}
            		ind++;
            		i += j;
            		continue;
            	}else {
            		ans++;
            		i = ans;
            		ind = 0;
            	}
            }
        }
    }
}


Measured memory_bytes: 32028