akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
void run() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
}
const int N = 2e5+5;

char g[8][8];
int h,w,k,row[8],col[8],black=0;
/*int solve(int i,int j,int cnt,bool inRow){
    if(i==h && i==w)
        return cnt==k;
    for (int l = 0; l < h; ++l) {

    }
}*/
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    run();
    cin>>h>>w>>k;
    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            cin>>g[i][j];
            row[i]+=g[i][j]=='#';
            black+=g[i][j]=='#';
        }
    }
    for (int i = 0; i < w; ++i) {
        for (int j = 0; j < h; ++j) {
            col[i]+=g[j][i]=='#';
        }
    }
    vector<vector<int>> rows,cols;
    for (int i = 0; i < (1<<h); ++i) {
        vector<int> r;
        for (int j = 0; j < h; ++j) {
            if((1<<j)&i){
                r.push_back(j);
            }
        }
        rows.push_back(r);
    }
    ll ans=0;
    for (int i = 0; i < (1<<w); ++i) {
        vector<int> c;
        int cnt=0,now=0;
        for (int j = 0; j < w; ++j) {
            if((1<<j)&i){
                c.push_back(j);
                now+=col[j];
            }
        }
        for (auto r:rows) {
            cnt=now;
            for(int i:r){
                cnt+=row[i];
                for(int j:c){
                    cnt-=g[i][j]=='#';
                }
            }
            if(black-cnt == k)
                ans++;
        }


    }
    cout<<ans;

    return 0;
}

Measured memory_bytes: 3676
#include<bits/stdc++.h>
#define int long long
#define rg register
#define file(x) freopen(x".in","r",stdin);freopen(x".out","w",stdout);
using namespace std;
int read(){
    int x=0,f=1;char c=getchar();
    while(c<'0'||c>'9') f=(c=='-')?-1:1,c=getchar();
    while(c>='0'&&c<='9') x=x*10+c-48,c=getchar();
    return f*x;
}
int a[200001],b[200001],n,ans,c[2000001],sum[200001];
int lowbit(int x){
	return x&(-x);
}
void Add(int x,int v){
	while(x<=n+200000)
		c[x]+=v,x+=lowbit(x);
}
int Sum(int x){
	int ans=0;
	while(x)
		ans+=c[x],x-=lowbit(x);
	return ans;
}
bool check(int x){
	for(int i=1;i<=n;i++){
		sum[i]=sum[i-1];
		if(a[i]<x)
			sum[i]++;
		else if(a[i]>=x) sum[i]--;
	}
	int tot=0;
	Add(200000,1);
	for(int i=1;i<=n;i++)
		Add(sum[i]+200000,1),tot+=Sum(sum[i]+200000-1);
	Add(200000,-1);
	for(int i=1;i<=n;i++)
		Add(sum[i]+200000,-1);
	return tot<=(n*(n-1)/2+n)/2;
}
main(){
	//  file("A");
	n=read();
	for(int i=1;i<=n;i++)
		b[i]=a[i]=read();
	sort(b+1,b+1+n);
	int l=1,r=n;
	while(l<=r){
		int mid=(l+r)>>1;
		if(check(b[mid]))
			l=mid+1,ans=b[mid];
		else r=mid-1;
	}
	printf("%lld",ans);
    return 0;
}

Measured memory_bytes: 5888
// mdzz atcoder原题，偏偏这里没有代码
// srt: 2017年03月06日 08時29分30秒
// 暗柳啼鸦，单衣伫立，小帘朱户。
//     -- 周邦彦《琐窗寒·寒食》
// end: 2017年03月06日 08時47分34秒

#include<cstdio>

char s[1001][1001];
int main()
{
	int n,i,j;scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%s",s[i]);

	for(i=0;i<n;i++)
		for(j=0;j<n;j++)
			if(s[i][j]!='.')
			{ i=n+1;break; }
	if(i==n)return puts("-1"),0;

	for(i=0;i<n;i++)
		for(j=0;j<n;j++)
			if(s[i][j]!='#')
			{ i=n+1;break; }
	if(i==n)return puts("0"),0;

	int c=0;
	for(j=0;j<n;j++)
	{
		for(i=0;i<n;i++)
			if(s[i][j]!='#')
				break;
		c+=i==n;
	}

	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
			if(s[i][j]!='#')
				break;
		if(j==n)return printf("%d\n",n-c),0;
	}

	int ans=0,t;
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
			if(s[j][i]=='#')
				break;
		t=j==n?-1:0;
		for(j=0;j<n;j++)
			t+=s[i][j]=='#';
		t>ans&&(ans=t);
	}

	printf("%d\n",n-ans+n-c);
}

Measured memory_bytes: 640
s=input()
n=len(s)
count=0
max=0
for i in range(n):
    if(s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T'):
        count+=1
        if(i==n-1):
            if(max<=count):
                max=count
    else:
        if(max<=count):
            max=count
        count=0
print(max)

Measured memory_bytes: 3064
using System;
using System.Linq;
using System.Collections.Generic;
class c
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        var list = new List<int[]>();
        for (int i = 0; i < n; i++)
        {
            var inp = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            list.Add(inp);
        }
        var ans = new int[n + 1][];
        for (int i = 0; i < ans.Length; i++)
        {
            ans[i] = new int[3];
        }
        for (int i = 1; i <= n; i++)
        {
            for (int j = 0; j < 3; j++)
            {
                ans[i][j] = Math.Max(ans[i - 1][(j + 1) % 3] + list[i - 1][j], ans[i - 1][(j + 2) % 3] + list[i - 1][j]);
            }
        }
        Console.WriteLine(ans[n].Max());
    }
}

Measured memory_bytes: 29756
// Boudy is 32
// Tsunami is :gift_heart:
// Yassora is :sparkling_heart:
// Zetamoo is :heartbeat:
// Nour is Mo7nk
// Pillow is habd
// Lulu ...... meen Lulu?!!!
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>
using namespace __gnu_pbds;
using namespace __gnu_cxx;

template<class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
/***********************************************/
/* Dear online judge:
 * I've read the problem, and tried to solve it.
 * Even if you don't accept my solution, you should respect my effort.
 * I hope my code compiles and gets accepted.
 *  ___  __     _______    _______      
 * |\  \|\  \  |\  ___ \  |\  ___ \     
 * \ \  \/  /|_\ \   __/| \ \   __/|    
 *  \ \   ___  \\ \  \_|/__\ \  \_|/__  
 *   \ \  \\ \  \\ \  \_|\ \\ \  \_|\ \ 
 *    \ \__\\ \__\\ \_______\\ \_______\
 *     \|__| \|__| \|_______| \|_______|
 */
const long long mod = 1000000007;
//const long long mod = 998244353;
mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());

// watch this
using ll = long long;
//typedef long long LL;
#define ll long long
#undef ll

const int mxN = 100010;

int main(int argc, char** argv) {
#ifdef ONLINE_JUDGE	
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
//	freopen("highways.in", "r", stdin);
//	freopen("highways.out", "w", stdout);
#endif

	int N, M;
	cin >> N >> M;
	vector<pair<long long, int> > p(N);
	for (int i = 0; i < N; i++)
		cin >> p[i].first >> p[i].second;
	sort(begin(p), end(p));
	long long res = 0;
	for (int i = 0; i < N && M > 0; i++) {
		res += min(M, p[i].second) * p[i].first;
		M -= p[i].second;
	}
	cout << res << '\n';
	return 0;
}


Measured memory_bytes: 1792
def kai(nn):
    if nn == 0 or nn==1:
        return 1
    else:
        return nn*kai(nn-1)


#print(kai(5))

n,m = map(int,input().split())
#m = int(input())
# e+e or o+o
ans =0
if n>=2:
    ans += kai(n)//(2*kai(n-2))
if m>=2:
    ans += kai(m)//(2*kai(m-2))
print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	int ans1=0,ans2=0;
	cin >> s;
	for(int i=0;i<s.size();i++){
		ans1+=((i&1)&&s[i]=='1')+(!(i&1)&&s[i]=='0');
		ans2+=((i&1)&&s[i]=='0')+(!(i&1)&&s[i]=='1');
	}
	cout << min(ans2,ans1) << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define desync ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl '\n'
#define pb push_back
int error[4];
int main(){
   desync;
   int n; cin >> n;
   string erro;
   
   for(int i =0 ; i < n ; i++){
      cin >> erro;
      if(erro == "AC") error[0]++;
      else if(erro == "WA") error[1]++;
      else if(erro == "TLE") error[2]++;
      else error[3]++;
   }
   cout << "AC x " << error[0] << endl;
   cout << "WA x " << error[1] << endl;
   cout << "TLE x "<< error[2] << endl;
   cout << "RE x " << error[3] << endl;
   
   return 0;
}

Measured memory_bytes: 3656
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <queue>
#include <iomanip>

using namespace std;
int N;
vector<int> f(100001);
vector<int> s(100001);
set<int> graph[100001];

void bfsf(int i) {
  queue<int> que;
  f.at(i) = 0;
  que.push(i);
  while (!que.empty()) {
    int u = que.front(); que.pop();
    for (int v : graph[u]) {
      if (f.at(v) == -1) {
        f.at(v) = f.at(u) + 1;
        que.push(v);
        // cout << "f.at(" << v << "): " << f.at(v) << endl;
      }
    }
  }
}

void bfss(int i) {
  queue<int> que;
  s.at(i) = 0;
  que.push(i);
  while (!que.empty()) {
    int u = que.front(); que.pop();
    for (int v : graph[u]) {
      if (s.at(v) == -1) {
        s.at(v) = s.at(u) + 1;
        que.push(v);
        // cout << "s.at(" << v << "): " << s.at(v) << endl;
      }
    }
  }
}

int main() {
  cin >> N;
  for (int i=0; i<N-1; i++) {
    int a, b;
    cin >> a >> b;
    graph[a].insert(b);
    graph[b].insert(a);
  }
  for (int i=1; i<=N; i++) {
    f.at(i) = -1;
    s.at(i) = -1;
  }
  bfsf(1);
  bfss(N);
  int sumf = 0;
  for (int i=1; i<=N; i++) {
    if (f.at(i) <= s.at(i)) {
      sumf++;
    }
  }
  cout << ((sumf > N-sumf) ? "Fennec" : "Snuke") << endl;
}


Measured memory_bytes: 15104
#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>
#include <cstring>
#include <iomanip>
#include<queue>
#include<set>

using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
 
#define INF 1000000000
typedef long long  ll;

#define MOD 1000000007



int main()
{
    int N;
    cin >> N;
    ll a[N];
    multiset<ll> upset;
    REP(i,0,N){
      cin >> a[i];
    }
    
    REP(i,0,N){
      auto it = upset.lower_bound(a[i]);
      if(it==upset.begin()){
        upset.insert(a[i]);
      }else{
        --it;
        upset.erase(it);
        upset.insert(a[i]);
      }
    }
    cout << upset.size() << endl;
    return 0;
}


Measured memory_bytes: 5760
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

int sum(vector<int> v) {
	int w = 0;
	for (int i = 0;i < v.size();i++){
		w += v.at(i);
	}
	return w;
}

int main(){
	int N, X;
	cin >> N >> X;
	vector<int> m(N);
	int i;
	for (i = 0;i < N;i++) cin >> m.at(i);
	sort(m.begin(), m.end());
	cout << N + (X - sum(m)) / m.at(0) << endl;
	return 0;
}


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

ll powll(ll a,ll n){
  if(n==0)
  {
    return 1;
  }
  return powll(a,n-1)*a;
}


int main() {
   ll i,j,k;
   ll a,b,c;
   cin >>a>>b>>c; 
   
   cout<< c<<' '<<a<<' '<<b <<endl;
}

Measured memory_bytes: 256
while True:
    w = input()
    if w == "-": break
    m = int(input())
    l = list(w)
    L = len(l)
    for i in range(m):
        h = int(input())
        a = [l[j] for j in range(h)]
        b = [l[j] for j in range(h,L)]
        b.extend(a)
        for k in range(L):
            l[k] = b[k]
        
    print("".join(l))
        

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

using namespace std;

using ll = long long;

constexpr int kMaxV = 1e5;
constexpr ll inf = 1e18;

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

  int n, W;
  cin >> n >> W;

  // min weight for given value
  vector<ll> dp(kMaxV + 1, inf);
  dp[0] = 0;
  for (int i = 0; i < n; ++i) {
    ll w, v;
    cin >> w >> v;

    for (int j = kMaxV - v; j >= 0; --j) {
      dp[j + v] = min(dp[j + v], dp[j] + w);
    }
  }

  for (int i = kMaxV; i >= 0; --i) {
    if (dp[i] <= W) {
      cout << i << '\n';
      break;
    }
  }

  return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        String s = stdIn.next();

        for (int i = 0; i < s.length(); i++) {
            System.out.print("x");
        }

        System.out.println();
    }
}


Measured memory_bytes: 22868
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using loop = int;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(loop (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(loop (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(loop (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(loop (i)=(n);(i)>=(a);--(i))
#define each(i, a) for(auto &i : a)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x))
#define line cout << "------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause") //comment out this on AOJ.
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
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; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }

int main() {
    init();

    int A, B, m; cin >> A >> B >> m;
    VI a(A), b(B); cin >> a >> b;
    int ans = *min_element(all(a)) + *min_element(all(b));
    FOR(i, 0, m) {
        int x, y, c; cin >> x >> y >> c;
        --x, --y;
        chmin(ans, a[x] + b[y] - c);
    }
    cout << ans << "\n";
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(a); (i)<(b); ++(i))
#define rFor(i, a, b) for(int (i)=(a)-1; (i)>=(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef pair<int, int> pii;
typedef pair<pii, lint> ppl;
typedef pair<lint, lint> pll;
typedef complex<double> xy_t;
typedef vector<lint> poly;

const lint mod = 1e9 + 7;

lint powmod(lint x, lint n){
    lint ret = 1;
    while(n > 0){
        if(n&1) ret *= x, ret %= mod, n -= 1;
        else x *= x, x %= mod, n >>= 1;
    }
    return ret;
}

vector<lint> fact;
vector<lint> revfact;

void setfact(int n){
    fact.resize(n+1); revfact.resize(n+1);
    fact[0] = 1;
    rep(i, n) fact[i+1] = fact[i] * (i+1) % mod;

    revfact[n] = powmod(fact[n], mod-2);
    for(int i=n-1; i>=0; i--) revfact[i] = revfact[i+1] * (i+1) % mod;
}

lint getC(int n, int r){
    return fact[n] * revfact[r] % mod * revfact[n-r] % mod;
}

int main(){
    int h, w, n;
    scanf("%d%d%d", &h, &w, &n);
    pii p[n+1];
    p[0] = make_pair(0, 0);
    rep(i, n){
        int r, c;
        scanf("%d%d", &r, &c);
        p[i+1] = make_pair(r-1, c-1);
    }
    sort(p, p+n+1);

    setfact(h+w);
    lint dp[n+2][2];
    rep(i, n+2)rep(j, 2) dp[i][j] = 0;
    dp[0][0] = 1;
    rep(i, n+1)rep(j, 2)if(dp[i][j]){
        int rd, cd;
        For(k, i+1, n+1)if(p[i].se <= p[k].se){
            rd = p[k].fi - p[i].fi;
            cd = p[k].se - p[i].se;
            (dp[k][(j+1)%2] += dp[i][j] * getC(rd+cd, rd) % mod) %= mod;
        }
        rd = h-1 - p[i].fi;
        cd = w-1 - p[i].se;
        if(i) (dp[n+1][j] += dp[i][j] * getC(rd+cd, rd) % mod) %= mod;
    }

    lint ans = getC(h+w-2, h-1);
    (ans += dp[n+1][0] - dp[n+1][1] + mod) %= mod;
    printf("%lld\n", ans);
}

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

using namespace std;

int main() {

	// o + o = e
	// e + e = e

	int ne, no;
	cin >> no >> ne;
	int coo = (no * (no - 1)) / 2;
	int cee = (ne * (ne - 1)) / 2;
	cout << coo + cee << '\n';
	
	return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[n];
		int[] cnt = new int[n];
		int max = 0;
		int ans = -1;
		for(int i=0;i<n;i++) a[i] = sc.nextInt();
		for(int i=0;i<m;i++){
			int b = sc.nextInt();
			for(int j=0;j<n;j++){
				if(a[j]<=b){
					cnt[j]++;
					if(max<cnt[j]){
						max = cnt[j];
						ans = j+1;
					}
					break;	
				}
			}
		}
		System.out.println(ans);
	}

}

Measured memory_bytes: 25172
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define rep(i, s, n) for (int i = s; i < n; i++)
#define rrep(i, s, n) for (int i = (n)-1; i >= (s); i--)
#define all(a) a.begin(),a.end()
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
const long long MOD = 1000000007, INF = 1e17;
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;}
//******************************************************************************
template<typename T>vector<T>
make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
	return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
	for(auto &e:t) fill_v(e,v);
}

void print_vec(vector<int>&v){
	for(int i = 0;i<v.size();i++){
		if(i)cout<<" ";
		cout<<v[i];
	}
	cout<<endl;
}

vector<int>p;
int H,W;
string s[12];

bool check(vector<int>&q){
	bool b[12] = {};
	bool c = H&1;
	rep(i,0,H) if(!b[i]){
		rep(j,i+1,H) if(!b[j]){
			rep(k,0,W){
				if(s[i][k] != s[j][q[k]]) break;
				if(k+1 == W) b[i] = b[j] = 1;
			}
			if(b[j]) break;
		}
		if(!b[i]){
			if(c){
				rep(k,0,W) if(s[i][k] != s[i][q[k]]) return 0;
				c = 0;
			} else return 0;
		}
	}
	return 1;
}

signed main()
{
	//IOS();
	cin>>H>>W;
	for(int i = 0;i < H;i++){
		cin>>s[i];
	}
	p.resize(W);
	rep(i,0,W){
		p[i]=i/2;
	}
	do{
		//print_vec(p);
		vint q(W,-1);
		rep(i,0,W){
			if(q[i]==-1)q[i]=i;
			rep(j,i+1,W){
				if(p[i]==p[j]){
					q[i]=j;
					q[j]=i;
				}
			}
		}
		if(check(q)){
			cout<<"YES"<<endl;
			return 0;
		}
	}while(next_permutation(all(p)));
	cout<<"NO"<<endl;
}


Measured memory_bytes: 384
#include <iostream>
#include <string>

using namespace std;

int main(void){
    
    string topping={};
    
    cin >> topping;
    
    int count = 0;
    
    
    int plus = 0;
    
    
    
    for(int i=0;i<3;i++){
        
        
        if(topping[count] == 'o'){
            
            plus = plus + 100;
            
        }
        
        count++;
        
        
        
    }
    
    cout << plus + 700 << endl;
    
    
    return 0;
    
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<complex>
#include<atcoder/all>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
#define INF (1<<29)
#define LINF (1LL<<60)
#define EPS (1e-10)
#define PI 3.1415926535897932384626433832795028
typedef long long Int;
typedef pair<Int, Int> P;
typedef long double Real;
typedef complex<Real> CP;

Int k;

struct Val{
    Int nxt;
    Int sum;
    Val():nxt(0), sum(0){}
};

struct calculator{
    Int n;
    Int nums[220000];
    Val nxts[220000][20];
    void calc(){
        for(Int l = 0, r = 0;l < n;l++){
            while(r < n && nums[r] < nums[l] + k)r++;
            nxts[l][0].nxt = r;
            nxts[l][0].sum = r;
        }
        for(Int h = 1;h < 20;h++){
            for(Int i = 0;i < n;i++){
                nxts[i][h] = nxts[i][h-1];
                Int nxt_ind = nxts[i][h].nxt;
                if(nxt_ind != n){
                    nxts[i][h].nxt = nxts[nxt_ind][h-1].nxt;
                    nxts[i][h].sum += nxts[nxt_ind][h-1].sum;
                }
            }
        }
    }

    Int go(Int l, Int cnt){
        for(Int h = 19;h >= 0;h--){
            if(cnt < (1 << h))continue;
            l = nxts[l][h].nxt;
            if(l == n)return n;
            cnt -= (1 << h);
        }
        return l;
    }

    Int sum(Int l, Int cnt){
        Int ans = l;        
        for(Int h = 19;h >= 0;h--){
            if(cnt < (1 << h))continue;
            ans += nxts[l][h].sum;
            l = nxts[l][h].nxt;
            cnt -= (1 << h);
        }
        return ans;
    }
    
} X, Y;

int main(){
    Int n, q;
    cin >> n >> k;
    for(Int i = 0;i < n;i++){
        cin >> X.nums[i];
        Y.nums[n-i-1] = MOD - X.nums[i];
    }
    X.n = Y.n = n;
    X.calc();
    Y.calc();
    
    cin >> q;
    for(Int i = 0;i < q;i++){
        Int l, r;
        cin >> l >> r;l--,r--;
        Int bottom = 0, top = n;
        while(top - bottom > 1){
            Int mid = (top + bottom) / 2;
            if(X.go(l, mid) <= r)bottom = mid;
            else top = mid;
        }
        Int cnt = bottom + 1;
        cout << ((n-1) * cnt - Y.sum(n-r-1, cnt-1)) -  X.sum(l, cnt-1) +  cnt << endl;
    }    
    return 0;
}

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

/*
int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int64 N, X;
	cin >> N >> X;
	vector<int64> x(N), sumby2(N+1, 0);
	REP(i, N){
		cin >> x[i];
		sumby2[i+1] += sumby2[i]+2*x[i];
	}
	reverse(all(x));
	int64 res = X+x[0]*2;
	priority_queue<int64, vector<int64>, greater<int64>> pq;
	pq.push(1);
	REP(i, N){
		int32 cnt = pq.top(); pq.pop();
		if(X+5*x[i] >= (cnt*2+1)*x[i]){
			res += (cnt*2+1)*x[i]+X;
			cnt++;
		}else{
			pq.push(2);
			res += 2*X+5*x[i];
		}
		pq.push(cnt);
	}
	cout << res << endl;
}
*/

int main(void){
	int64 N, X;
	cin >> N >> X;
	vector<int64> x(N+1, 0);
	REP(i, N) cin >> x[i];
	reverse(all(x));
	REP(i, N){
		x[i+1] += x[i];
	}

	int64 res = numeric_limits<int64>::max();
	FOR(i, 1, N+1){
		int64 sum = X*i+X*N;
		for(int64 j = 0;j*i < N;j++){
			if(j == 0){
				sum += (x[min((j+1)*i, N)]-x[j*i])*5;
			}else{
				sum += (x[min((j+1)*i, N)]-x[j*i])*(2*(j+1)+1);
			}
			if(sum > res) break;
		}
		res = min(res, sum);
	}
	cout << res << endl;
}


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

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    
    int n;
    cin >> n;
    
    pair<int, int> a[n];
    for (int i = 0; i < n; ++i) {
        cin >> a[i].first;
        a[i].second = i + 1;
    }
    
    sort(a, a + n);
    
    int ans = 0, cnt = 0;
    for (auto to : a) {
        ++cnt;
        if (to.second % 2 != cnt % 2) {
            ++ans;
        }
    }
    
    cout << ans / 2;
}


Measured memory_bytes: 5180
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <stack>
#include <list>
#include <deque>
using namespace std;
int n, m, i, j, k, t, a, b;
char s[80];
int main(){
	cin>>a>>b;
	n=a*b;
	t=n%2;
	if(t) cout<<"Odd";
	else cout<<"Even";
	return 0;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//int n = sc.nextInt();
		//String[][] array = new String[100][500];
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		List<Integer> list=new ArrayList<Integer>();
		List<Integer> list_up=new ArrayList<Integer>();
		int n = sc.nextInt();
		for(int i=0;n>i;i++) {
			int a=sc.nextInt();
			list.add(a);
			list_up.add(a);
		}

		Collections.sort(list_up);
		if(list.equals(list_up)) {
			System.out.println("YES");
			System.exit(0);
		}


		for(int i=0;(n*(n-1))/2>i;i++) {
			for(int j=i+1;n>j;j++) {
				int a = list.get(i);
				int b = list.get(j);
				list.set(i, b);
				list.set(j, a);
				if(list.equals(list_up)) {
					System.out.println("YES");
					System.exit(0);
				}
				else {
					list.set(i, a);
					list.set(j, b);
				}

			}
		}

		System.out.println("NO");
	}

}

Measured memory_bytes: 21844
s = input()

yes = True
for i in range(len(s)):
  if s[i] == 'U' or s[i] == 'D':
    continue
  if i % 2 != 0:
    if s[i] == 'L':
      continue
    else:
      yes = False
      break
  else:
    if s[i] == 'R':
      continue
    else:
      yes = False
      break

if yes:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 3060
def isExactPay( a, b, c, amount)
  500*a + 100*b + 50*c == amount && a <=50 && b <= 50 && c <= 50
end

a = gets.chomp.to_i
b = gets.chomp.to_i
c = gets.chomp.to_i
x = gets.chomp.to_i
way_num = 0
(0..a).each do |num_500|
  (0..b).each do |num_100|
    (0..c).each do |num_50|
      way_num += 1 if isExactPay(num_500, num_100, num_50, x)
    end
  end
end
print("#{way_num}")


Measured memory_bytes: 1788
import java.util.Arrays;
import java.util.Scanner;
public class Main{
	public static void main(String[]args) {
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		long c=1;
		long sum=0;
		while(n!=0) {
			n=n/2;
			sum=sum+c;
			c=c*2;
		}
		System.out.println(sum);  
		
	}
	
}

Measured memory_bytes: 23380
import collections


n, m = map(int, input().split())
li = []

for i in range(n):
    li.append(i+1)


for i in range(m):
    a, b = map(int, input().split())
    li.append(a)
    li.append(b)

c = collections.Counter(li)

for k, v in sorted(c.items(), key=lambda x: x[0]):
        print(v-1)


Measured memory_bytes: 3316
n=int(input())
card=[[False for i in range(13)] for j in range(4)]
for i in range(n):
    mark,rank=input().split()
    if mark=="S":
        pattern=0
    elif mark=='H':
        pattern=1
    elif mark=='C':
        pattern=2
    elif mark=='D':
        pattern=3
    card[pattern][int(rank)-1]=True
for j in range(4):
    for i in range(13):
        if card[j][i]==False:
            if j==0:
                print('S',i+1)
            elif j==1:
                print('H',i+1)
            elif j==2:
                print('C',i+1)
            elif j==3:
                print('D',i+1)


Measured memory_bytes: 5616
from sys import stdin, setrecursionlimit


def main():
    n = int(stdin.readline())
    a = list(map(int, stdin.readline().split()))

    a.insert(0, 0)
    a.append(0)

    max = 0

    for i in range(1, n + 2):
        max += abs(a[i] - a[i - 1])

    for i in range(1, n + 1):
        print(max + abs(a[i + 1] - a[i - 1]) - abs(a[i] - a[i - 1]) - abs(a[i + 1] - a[i]))


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Measured memory_bytes: 63980
#include <stdio.h>
#include <vector>
#include <iostream>
#include <algorithm>
#include <limits>
#include <string>
#include <stack>
#include <queue>

#define INT_MAX 2147483647
#define INT_MIN -2147483647

using namespace std;

void maxHeap(vector<int> &data, int idx)
{
	int l = idx * 2;
	int r = idx * 2 + 1;

	int maxIdx;
	maxIdx = (l<data.size() && data[l] > data[idx]) ? l : idx;
	maxIdx = (r<data.size() && data[r] > data[maxIdx]) ? r : maxIdx;

	if (maxIdx != idx)
	{
		swap(data[idx], data[maxIdx]);
		maxHeap(data, maxIdx);
	}
}

int main()
{
	int num; cin >> num;
	vector<int> data(num + 1);
	for (int i = 1; i <= num; ++i) cin >> data[i];
	
	for (int i = num; i > 0; --i) 
		maxHeap(data, i);

	for (int i = 1; i <= num; ++i) cout << " " << data[i];
	cout << endl;
}

Measured memory_bytes: 4588
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#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>

using namespace std;

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define PB push_back
#define MP make_pair
#define ll long long

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

bool visited[401][401];
int dc[4] = {1, 0, -1, 0};
int dr[4] = {0, -1, 0, 1};
int h, w;

pair<ll,ll> dfs(int r, int c, vector<string> &map)
{
    ll black = 0, white = 0, nr, nc;
    char current_color = map[r][c];
    if(current_color == '.')
    {
        white++;
    } 
    else
    {
        black++;
    }

    visited[r][c] = true;
    for(int i=0;i<4;++i)
    {
        nr = r + dr[i];
        nc = c + dc[i];
        if((nr < 0 || h <= nr) ||
           (nc < 0 || w <= nc)) continue;
        if(visited[nr][nc]) continue;
        char next_color = map[nr][nc];
        if(current_color == next_color) continue;
        // dump(nr)
        // dump(nc)
        auto tmp = dfs(nr, nc, map);
        black += tmp.first;
        white += tmp.second;
    }

    return MP(black, white);
}

int main(){
    std::ios::sync_with_stdio(false);
    cin >> h >> w;
    vector<string> map;
    string tmp;
    for(int i=0;i<h;++i)
    {
        cin >> tmp;
        map.push_back(tmp);
    }
    ll ret = 0;
    for(int i=0;i<h;++i)
    {
        for(int j=0;j<w;++j)
        {
            if(!visited[i][j])
            {
                auto pair = dfs(i, j, map);
                // dump(pair.first)
                // dump(pair.second)
                ret += (ll)(pair.first) * (pair.second);
            }
        }
    }

    cout << ret << endl;
}

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

using namespace std;

typedef long long ll;
const int N = 5e5 + 9;

int n, m; 
ll to[N << 1], nxt[N << 1], beg[N], tot;
ll c[N], w[N << 1];
ll ans, f[4], flag;

inline void _read(int &x)
{
	x = 0;
	char t = getchar();
	while (!isdigit(t)) t = getchar();
	while (isdigit(t))
	{
		x = x * 10 + t - '0';
		t = getchar();
	}
}

inline void add(const int &u, const int &v, const int &c)
{
	to[++tot] = v;
	nxt[tot] = beg[u];
	w[tot] = c;
	beg[u] = tot;
}

inline void dfs(int u)
{
	f[c[u]]++;
	for (register int i = beg[u]; i; i = nxt[i])
	{
		if (w[i] == 1)f[3]++;
		if (!(~c[to[i]]))
		{
			c[to[i]] = (c[u] + w[i]) % 3;
			dfs(to[i]);
		}
		else if (c[to[i]] != (c[u] + w[i]) % 3)
			flag = 1;
	}
}

int main()
{
	_read(n), _read(m);
	for (register int i = 1, u, v; i <= m; i++)
	{
		_read(u), _read(v);
		add(u, v, 1), add(v, u, 2);
	}

	memset(c, -1, sizeof c);
	for (register int i = 1; i <= n; i++)
		if (!(~c[i]))
		{
			f[c[i] = 0] = f[1] = f[2] = f[3] = flag = 0;
			dfs(i);
			if (flag)
			{
				register ll cnt = f[0] + f[1] + f[2];
				ans += cnt * cnt;
				continue;
			}
			if ((!f[0]) || (!f[1]) || (!f[2]))
			{
				ans += f[3];
				continue;
			}

			ans += f[0] * f[1];
			ans += f[1] * f[2];
			ans += f[2] * f[0];
		}

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

Measured memory_bytes: 20096
#include <bits/stdc++.h>
#define REP(i, n) for(long long i=0; i<n; i++)
#define REPR(i, n) for(long long i=n-1; i>=0; i--)
#define FOR(i, m, n) for(long long i=m; i<=n; i++)
#define FORR(i, m, n) for(long long i=m; i>=n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;
using ll = long long;
using ull = unsigned long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;
const ll inf = 1e15;
ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}



int main(){FIN
    ll n;cin>>n;
    map<string, ll> mp;
    REP(i,n){
        string s;cin>>s;
        mp[s]++;
    }
    cout<<"AC x "<<mp["AC"]<<endl;
    cout<<"WA x "<<mp["WA"]<<endl;
    cout<<"TLE x "<<mp["TLE"]<<endl;
    cout<<"RE x "<<mp["RE"]<<endl;
    // cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3608
from itertools import accumulate
from functools import reduce
N,x,*A = map(int, open(0).read().split())
dp = [0]*N
for i in range(N):
  dp[i] = list(accumulate((A[i-j] for j in range(N)),min))
ans = reduce(min, (i*x+sum(a) for i,a in enumerate(zip(*dp))))
print(ans)

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

int main()
{
    char a;
    cin >> a;

    if (isupper(a))
    {
        cout << "A" << endl;
    }
    else
    {

        cout << "a" << endl;
    }

    return 0;
}

Measured memory_bytes: 3616
#include<stdio.h>
#define N 500000
int H,A[N];
int maxHeapify(int i){
  int l,r,q,largest;
  l = i*2;
  r = i*2+1;

  if(l<=H && A[l]> A[i])  largest = l;
  else  largest = i;
  if(r<=H && A[r] > A[largest]) largest = r;
  if(largest != i){
    q=A[i];
    A[i]=A[largest];
    A[largest]=q;
    maxHeapify(largest);
  }
}
int main(){
  int i;
  scanf("%d",&H);
  for(i=1;i<=H;i++){
    scanf("%d",&A[i]);
  }
  for(i=H/2;i>=1;i--){
    maxHeapify(i);
  }
  for(i=1;i<=H;i++){
    printf(" %d",A[i]);
  }
  printf("\n");
  return 0;
}

Measured memory_bytes: 2552
import sys
s=[list(map(int,e.split(',')))for e in sys.stdin]
for i in range(1,len(s)):
 for j in range(len(s[i])):
  b=len(s[i])>len(s[i-1])
  s[i][j]+=max(s[i-1][(j-b)*(j>0):j+2-b])
print(*s[-1])


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

int main(){
    string s;
    cin >> s;
    bool YM=true, MY=true;
    int l=s[0]-'0';
    int k=s[1]-'0';
    int i=s[2]-'0';
    int j=s[3]-'0';
    if(s.substr(2,2)=="00"||i*10+j>12)YM=false;
    if(s.substr(0,2)=="00"||l*10+k>12)MY=false;
    
    if(YM&&MY)cout << "AMBIGUOUS" << endl;
    else if(YM)cout << "YYMM" << endl;
    else if(MY)cout << "MMYY" << endl;
    else cout << "NA" << endl;  
}

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

#define int long long
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; }
#define rep(i,n) for(int i=0; i<(int)n; i++)
#define ll long long
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define COUT(x) cout << x << endl;
#define PB(x) push_back(x)
#define MP make_pair
int gcd(int a,int b){return b?gcd(b,a%b):a;}
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int INF = 1e9;
const int MOD = 1e9+7;

signed main(){
    int n,m; cin >> n >> m;
    cout<< n*(n-1)/2 +  m*(m-1)/2 <<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);
//cin.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll inf=1000000000000000000;
double pi=2*acos(0);
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;cin>>n;
    int b[n-1];
    rep(i,0,n-1)cin>>b[i];
    int a[n];
    a[0]=b[0];
    a[n-1]=b[n-2];
    rep(i,1,n-1){
        a[i]=min(b[i],b[i-1]);
    }
    int ans=0;
    rep(i,0,n)ans+=a[i];
    cout<<ans<<endl;
}


Measured memory_bytes: 256
/*When I wrote this, only God and I understood what I was doing
Now, God only knows*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
 
 
//#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
 
 
#define boost ios::sync_with_stdio(false); cin.tie(nullptr);
#define MOD 1000000007
#define sd(x) scanf("%d", &(x))
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define ones(x) __builtin_popcount(x)
#define sz(x) int (x.size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define REP(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define f1(i,a,b) for(int i=a; i<=b; i++)
#define rep(i,a,b) for(int i=a; i<b; i++)
#define NFOR(i,a,b) for(int i=(a);i>=(b);--i)


using ll = long long ;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
using namespace std;
 
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;  
typedef double ld;
typedef vector<ll> vll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the iterator to kth largest element.(0-based)
 
 
template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
 
#ifdef np
#define trace(...) cout<<"Line:"<<__LINE__<<" "; __f(#__VA_ARGS__, __VA_ARGS__)
template<typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
	cout<<name<<" : "<<arg1<<endl;
}
template<typename Arg1, typename ... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
	const char *comma=strchr(names+1,',');
	cout.write(names,comma-names)<<" : "<<arg1<<" | ";
	__f(comma+1,args...);
}
#else
#define trace(...)
#define endl '\n'
#endif
 
auto clk=clock();
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}
 
void solve(){
	int a , b ; 
	cin>>a>>b;
	int m =a*b;
	int maxi = max(a-b , a+b);
	cout<<max(m,maxi)<<endl;
}

signed main(){
	int T =1 ; 
	//sd(T);
	while(T--){
		solve();
	}

#ifdef np
	cout<<endl<<endl<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
#endif
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

struct Info{
	int tag_index,x_1,y_1,x_2,y_2,depth;
	vector<int> children;
};

int N;
char buf[1001];
char tagName[500][501];
Info info[500];

bool strCmp(char* base, char* comp){
	int length1,length2;
	for(length1=0;base[length1] != '\0';length1++);
	for(length2=0;comp[length2] != '\0';length2++);
	if(length1 != length2)return false;

	for(int i=0;base[i] != '\0'; i++){
		if(base[i] != comp[i])return false;
	}
	return true;
}

void strcpy(char* to,char* str){
	for(int i=0;str[i] != '\0';i++){
		to[i] = str[i];
		to[i+1] = '\0';
	}
}

void func(){

	for(int i = 0; i < 500; i++){
		info[i].children.clear();
	}

	scanf("%s",buf);

	char work[501];
	int tag_index = 0,work_index,depth = 0;
	int tmp,count;

	stack<int> PARENT;

	for(int index = 0;buf[index] != '\0';){

		if(buf[index] == '<'){
			if(buf[index+1] != '/'){
				work_index = 0;
				for(++index; buf[index] != '>'; index++){
					work[work_index] = buf[index];
					work[work_index+1] = '\0';
					work_index++;
				}
				strcpy(tagName[tag_index],work);
				info[tag_index].depth = depth;
				info[tag_index].tag_index = tag_index;

				if(!PARENT.empty()){
					info[PARENT.top()].children.push_back(tag_index);
				}

				index++;

				count = 0;
				while(count < 4){
					tmp = 0;
					for(;buf[index] != ',' && buf[index] != '<';index++){
						tmp = 10*tmp + buf[index]-'0';
					}
					switch(count){
					case 0:
						info[tag_index].x_1 = tmp;
						break;
					case 1:
						info[tag_index].y_1 = tmp;
						break;
					case 2:
						info[tag_index].x_2 = tmp;
						break;
					case 3:
						info[tag_index].y_2 = tmp;
						break;
					}
					count++;
					if(count < 4)index++;
				}

				PARENT.push(tag_index);
				tag_index++;
				depth++;

			}else{
				index++;
				for(;buf[index] != '>';index++);
				index++;
				depth--;
				PARENT.pop();
			}
		}
	}

	int x,y;
	int max_depth,touch_index;
	for(int loop = 0; loop < N; loop++){
		scanf("%d %d",&x,&y);

		max_depth = -1;
		for(int i = 0; i < tag_index; i++){
			if(info[i].x_1 <= x && info[i].x_2 >= x && info[i].y_1 <= y && info[i].y_2 >= y){
				if(max_depth < info[i].depth){
					max_depth = info[i].depth;
					touch_index = i;
				}
			}
		}
		if(max_depth == -1){
			printf("OUT OF MAIN PANEL 1\n");
		}else{
			printf("%s %lld\n",tagName[info[touch_index].tag_index],info[touch_index].children.size());
		}
	}
}


int main(){

	while(true){
		scanf("%d",&N);
		if(N == 0)break;

		func();
	}

	return 0;
}

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

int main()
{
	int x,y;
	char op;

	while(cin >> x >> op >>  y){
		if(op == '?')break;

		switch(op){
		case '+':cout << x+y << endl;break;
		case '-':cout << x-y << endl;break;
		case '*':cout << x*y << endl;break;
		case '/':cout << x/y << endl;break;
		}
	}

	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define ll long long 
using namespace std;
const ll MOD=1e9+7; //定义MOD代替1e9+7
int n;
ll dp[101][4][4][4],ans; 
int main()
{
	cin>>n;
	dp[0][3][3][3]=1;
	for (int len=1;len<=n;++len)
		for (int i=0;i<4;++i)
			for (int j=0;j<4;++j)
				for (int k=0;k<4;++k)
					for (int l=0;l<4;++l)
					{
						if (j==0 && k==2 && l==1) continue;
						if (j==2 && k==0 && l==1) continue;
						if (j==0 && k==1 && l==2) continue;
						if (i==0 && k==2 && l==1) continue;
						if (i==0 && j==2 && l==1) continue;
						dp[len][j][k][l]+=dp[len-1][i][j][k];
						dp[len][j][k][l]%=MOD;
					}
	for (int i=0;i<4;++i)
		for (int j=0;j<4;++j)
			for (int k=0;k<4;++k)
				ans+=dp[n][i][j][k],ans%=MOD;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <bits/stdc++.h>
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=1;i<=(n);++i)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define DUMP(x) cout<<#x<<"="<<(x)<<endl;
#define pb push_back
#define eb emplace_back
using namespace std;
typedef long long lint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
typedef pair<int, lint> pil;

const lint INF = (lint)1e12;
struct edge{int from, to; lint cost;};

class ECoinsRespawn {
public:
	void solve(std::istream& in, std::ostream& out) {
	    int N, M;
	    lint P, ans = INF;
	    in>>N>>M>>P;
	    vector<edge> E(M);
	    REP(i, M){
	        int A, B, C;
	        in>>E[i].from>>E[i].to>>E[i].cost;
	        E[i].from--, E[i].to--;
	        E[i].cost -= P; E[i].cost *= -1;
	    }
	    vector<lint> dist(N, INF);
	    dist[0] = 0;
	    REP(i, 2*N){
	        for(auto e : E){
	            int u = e.from, v = e.to;
	            if(dist[u]<INF and dist[u]+e.cost<dist[v]){
	                dist[v] = dist[u] + e.cost;
	                if(N<=i) dist[v] = -INF;
	            }
	        }
	    }
	    if(-dist[N-1]==INF) out<<"-1\n";
	    else out<<max(0LL, -dist[N-1])<<'\n';
	}
};


int main() {
	ECoinsRespawn solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 384
import math

n = int(input())

n2 = int(n // 1.08)

if math.floor(n2*1.08) == n:
	print(n2)
elif math.floor((n2-1)*1.08) == n:
	print(n2-1)
elif math.floor((n2+1)*1.08) == n:
	print(n2+1)
else:
	print(":(")


Measured memory_bytes: 3060
def A():
    temp = input().split()
    S = temp[0]
    T = temp[1]
    temp = [int(i) for i in input().split()]
    A = temp[0]
    B = temp[1]
    U = input()
    if U == S:
        print(A-1, B)
    else:
        print(A, B-1)

def B():
    print('x'*len(input()))

def C():
    N = int(input())
    A = [int(i) for i in input().split()]
    if N > len(set(A)):
        print('NO')
    else:
        print('YES')
        
C()

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

int main(){
    int n;cin>>n;
    int ans=0;
    for(int i=1;i<n+1;i++){
        int d=log10(i);
        if(d%2==0) ans++;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>


using namespace std;


int main(){

    //freopen("3.txt", "r", stdin);

    long long N, tmp;
    long long res = 1;
    long long modN = 1e9 + 7;

    cin >> N;

    vector<long long> vis(N, 0);
    vector<long long> high(N, 0);
    vector<long long> reverHigh(N,0);

    cin >> tmp;
    vis[0] = -1;
    high[0] = tmp;


    //maxH = tmp;

    for (long long i = 1; i < N; i++){
        cin >> tmp;
        if (tmp > high[i - 1]){
            vis[i] = -1;
            high[i] = tmp;
        }
        else{
            vis[i] = tmp;
            high[i] = high[i - 1];
        }

    }

    for (long long i = 0; i < N; i++){
        cin >> tmp;
        reverHigh[i] = tmp;
    }

    if (N == 1 && reverHigh[N - 1] != high[N - 1]){
        cout << "0" << endl;
        return 0;
    }




    if (reverHigh[N - 1] > high[N - 1]){
        cout << "0" << endl;
        return 0;
    }
    else{
        if (vis[N - 1] != -1){
            vis[N - 1] = -1;
        }

    }

    for (long long j = N - 2; j >= 0; j--){


        if (reverHigh[j] > reverHigh[j+1]){
            if (reverHigh[j] > high[j]){
                cout << "0" << endl;
                return 0;
            }
            vis[j] = -1;
        }
        else{
            if (vis[j] != -1){
                vis[j] = min(reverHigh[j], vis[j]);
            }
        }

    }
    /*
    for (auto x : vis){
        cout << x << endl;
    }
    */

    for (long long i = 1; i < N; i++){
        if (vis[i] != -1){
            res = (res * vis[i]) % modN;
        }
    }

    cout << res << endl;


    return 0;
}


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

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  if (A<=C&&C<=B) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 3612