akhauriyash/Code-Regression huggingface dataset:
#![allow(non_snake_case, unused_imports)]

// Input
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)*} }; }
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)*} };}
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, bytes) => { read_value!($next, String).into_bytes() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; }

// Module
use std::cmp::{min,max};
use std::collections::{HashSet,HashMap,BTreeMap,VecDeque};

// Functions

// Main
fn main(){
    input!{
        A: u64,
        B: u64,
        C: u64,
        D: u64,
    }
    println!("{}", max(A*B,C*D));
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
#include<vector>
using namespace std;
typedef long long LL;
const int maxn=20;
LL dp[maxn][maxn];
vector<int> res;
void dfs(int pos,int x,int k)
{
	if(pos==0) return ;
	res.push_back(x);
	if(k<=dp[pos-1][x-1])
	{
		dfs(pos-1,x-1,k);
	}
	else if(k<=dp[pos-1][x-1]+dp[pos-1][x])
	{
		dfs(pos-1,x,k-dp[pos-1][x-1]);
	}
	else
	{
		dfs(pos-1,x+1,k-dp[pos-1][x-1]-dp[pos-1][x]);
	}	
}
int main(void)
{
	memset(dp,0,sizeof(dp));
	for(int i=0;i<=9;i++) dp[1][i]=1;
	for(int i=2;i<=18;i++)
	{
		for(int j=0;j<=9;j++)
		{
			if(j==0) dp[i][j]=dp[i-1][j]+dp[i-1][j+1];
			else if(j==9) dp[i][j]=dp[i-1][j-1]+dp[i-1][j];
			else dp[i][j]=dp[i-1][j-1]+dp[i-1][j]+dp[i-1][j+1];
		}
	}
	int k; scanf("%d",&k);
	int p1,p2;
	for(int i=1;i<=18;i++)
	{
		bool flag=false;
		for(int j=1;j<=9;j++)
		{
			if(k<=dp[i][j])
			{
				p1=i; p2=j;
				flag=true;
				break;
			}
			k-=dp[i][j];
		}
		if(flag) break;
	}
	dfs(p1,p2,k);
	for(int v:res) printf("%d",v);
	printf("\n");
	return 0;
	
}

Measured memory_bytes: 256
N,P=map(int,input().split())
if N==1:
  print(P)
  exit(0)

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

res=factorization(P)
  
ans=1
for c in res:
  key=c[0]
  val=c[1]
  ans*=(key**(val//N))
  
print(ans)

Measured memory_bytes: 3188
n, x = map(int, input().split())
xs = list(map(int, input().split()))
ds = [abs(y - x) for y in xs]


def gcd(a, b):
    while True:
        a, b = b, a % b
        if b == 0:
            break
    return a


ds = sorted(ds, reverse=True)
res = ds[0]
for d in ds[1:]:
    if d == 0:
        continue
    res = gcd(res, d)
print(res)

Measured memory_bytes: 14252
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;

int main(){
	int n;
	while(cin >> n, n){
		/*n++;
		vector<int> t(n), v(n);
		t[0] = 0;
		for(int i = 1;i < n;i++){
			cin >> v[i];
			t[i] = max(t[i-1]+v[i], v[i]);
		}*/
		vector<int> vec(n),dp(n);
		for(int i=0;i<n;i++)cin >> vec[i];
		dp[0]=vec[0];
		for(int i=1;i<n;i++)dp[i]=max(dp[i-1]+vec[i],vec[i]);
		cout << *max_element(dp.begin(), dp.end()) << endl;
	}
	return 0; 
}

/*
7
-5
-1
6
4
9
-6
-7
*/

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

int main() {
  long n, d, a;
  cin >> n >> d >> a;
  pair<long, long> ary[n];
  for (long i = 0; i < n; i++) {
    long x, h;
    cin >> x >> h;
    h = (h + a - 1) / a;
    ary[i].first = x;
    ary[i].second = h;
    //cout << x << ' ' << h << endl;
  }
  sort(ary, ary+n);

  long tmp[n+1] = {0};
  
  long j = 0;
  long res = 0;
  long sum = 0;
  long cur = 0;
  for (long i = 0; i < n; i++) {
    while (j < n && ary[i].first + 2*d >= ary[j].first) j++;
    cur -= tmp[i];
    long diff = max(ary[i].second - cur, 0L);
    res += diff;
    cur += diff;
    tmp[j] += diff;
  }
  
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 4992
from itertools import accumulate
import bisect
n, m, k = map(int, input().split())
Acum = [0]+list(accumulate(map(int, input().split())))
Bcum = [0]+list(accumulate(map(int, input().split())))

ans = 0
for a in range(n+1):
    if k-Acum[a] < 0:
        break
    b = bisect.bisect_right(Bcum, k-Acum[a])-1
    if ans < a+b:
        ans = a+b
print(ans)


Measured memory_bytes: 48420
#include <numeric>
#include <bits/stdc++.h>
#include <utility>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <math.h>
#include <string>
#define ll long long
#define ull unsigned long long
#define make(type,x) type x; cin>>x
#define make2(type,x,y) type x,y; cin>>x>>y
#define fr(x,y) for(long long x=0;x<y;x++)
#define makevec(x,y,n) vector <x> y(n); for(ll i=0;i<n;i++) cin>>y[i]
#define M (ll)1000000007
#define MM (ll) 1e8
#define INF (ll) 1e18

# define IOS ios_base::sync_with_stdio(false); cin.tie(NULL)

using namespace std;

template <typename T>
T modpow(T base, T exp, T modulus) {
  base %= modulus;
  T result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulus;
    base = (base * base) % modulus;
    exp >>= 1;
  }
  return result;
}
bool sortbysec(const pair <ll,ll> &a,const pair <ll,ll> &b){
    return a.second<b.second;
}

struct cmp {
	bool operator() (const pair<int, int> &a, const pair<int, int> &b) const {
		int lena = a.second - a.first + 1;
		int lenb = b.second - b.first + 1;
		if (lena == lenb) return a.first < b.first;
		return lena > lenb;
	}
};


struct c_h {
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        x ^= FIXED_RANDOM;
        return x ^ (x >> 16);
    }
};

ll calcpow(ll x, ll y)
{
    ll temp;
    if(y == 0)
        return 1;
    temp = calcpow(x, y / 2);
    if (y % 2 == 0)
        return temp * temp;
    else
    {
        if(y > 0)
            return x * temp * temp;
        else
            return (temp * temp) / x;
    }
}
ll gcd(ll a, ll b){
    if(b==0) return a;
    return gcd(b,a%b);

}
ll egcd(ll a, ll b, ll &x,ll &y){
    if(b==0){
        x=1;
        y=0;
        return a;
    }
    ll x1;
    ll y1;
    ll g=egcd(b,a%b,x1,y1);
    x=y1;
    y=x1-y1*(a/b);
    return g;
}


bool isprime(ll a){
bool flag=1;
for(ll i=2;i*i<=a;i++){
    if(a%i==0) {flag=0; break;}
}
return flag;
}

ll dx8[8]={1,0,-1,0,1,-1,1,-1};
ll dy8[8]={0,1,0,-1,1,-1,-1,1};
ll dx4[4]={0,0,1,-1};
ll dy4[4]={1,-1,0,0};



int main(){
    IOS;
    make(ll,n);
    makevec(ll,a,n);
    ll p=0;
    ll ans=1;
    for(ll i=1;i<n;i++){
        if(a[i]==a[i-1]) {}
        else if(a[i]>a[i-1]){
            if(p==-1) {ans++; p=0;}
            else p=1;
        }
        else if(a[i]<a[i-1]){
            if(p==1) {ans++; p=0;}
            else p=-1;
        }

    }
    cout<<ans<<endl;

    return 0;
}


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

ulong MAX = 1_000_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Pair = Tuple!(long, "l    ", long, "r");
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);

void main()
{
    auto n = lread();
    auto a = new long[](0);
    while(abs(n) > 0)
    {
        if(n == 1)
        {
            a ~= 1;
            break;
        }

        if(abs(n % (-2)) > 0)
        {
            a ~= 1;
            n -= 1;
        }
        else
        {
            a~= 0;
        }
        
        n /= (-2);
    }
    foreach_reverse (e; a)
    {
        e.write();
    }
    if(a.empty())
        write(0);
    writeln();
}

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


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

using namespace std;

int main()
{
	int w, h;
	cin >> w >> h;
	priority_queue<int> a;
	vector<int> b(h);
	for (int i = 0; i < w; i++)
	{
		int tmp;
		cin >> tmp;
		a.push(tmp);
	}
	for (int i = 0; i < h; i++)
		cin >> b[i];
	for (int i = 0; i < h; i++)
	{
		vector<int> p(b[i]);
		for (int j = 0; j < b[i]; j++)
		{
			int pop = a.top();
			a.pop();
			pop--;
			if (pop < 0)
			{
				cout << 0 << endl;
				return 0;
			}
			p[j] = pop;
		}
		for (int in : p)
			a.push(in);
	}
	if (a.top() == 0)
		cout << 1 << endl;
	else
		cout << 0 << endl;

	return 0;
}



Measured memory_bytes: 3176
(defparameter *k* 1)
(defparameter *l* 0)

(defun cnt (lst)
  (if lst
      (progn (unless (equal (car lst) *k*)
	       (setf *l* (+ *l* 1)))
	     (setf *k* (+ *k* 1))
	     (cnt (cdr lst))
	     )
      *l*
      )
  )
 
      
	  
(defparameter *n* (read))
(defparameter *lst* (loop :repeat *n* :collect (read)))

(if (member (cnt *lst*) '(0 2))
    (princ "YES")
    (princ "NO")
    )

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

signed main() {
	int A,B;
	cin >> A>> B;
	vector<int> a={1,2,3};
	int ans;
	for(int i=0;i<3;i++){
		if(a.at(i)!=A && a.at(i)!=B){
			ans=a.at(i);
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <numeric>
#include <ctime>
#include <complex>
#include <bitset>
#include <random>
#include <stack>

using namespace std;

typedef long long ll;
typedef long double ld;

//#define int ll
#define double ld
#define loop(i, n) for(int i = 0; i < (int)n; ++i)
#define loop1(i, n) for(int i = 1; i <= (int)n; ++i)
#define F first
#define S second
#define pb push_back
#define pi pair <int, int>
#define all(x) begin(x), end(x)
#define ti tuple <int, int, int>
#define Point Vect
#define mkt make_tuple
#define no {cout << "No"; return;}

const int N = 1e5 + 7;

int p[N], t[4 * N];

void build(int v, int l, int r) {
    if (l == r) {
        t[v] = p[l];
        return;
    }
    int m = l + r >> 1;
    build(2 * v + 1, l, m);
    build(2 * v + 2, m + 1, r);
    t[v] = max(t[2 * v + 1], t[2 * v + 2]);
}

int ask(int v, int l, int r, int L, int R, int x, bool flag, int n) {
    if (l > R || r < L || t[v] < x)
        return (!flag ? n : -1);
    if (l == r)
        return l;
    int m = l + r >> 1;
    int pans = (!flag ? ask(2 * v + 1, l, m, L, R, x, flag, n) : ask(2 * v + 2, m + 1, r, L, R, x, flag, n));
    return (pans != -1 && pans != n ? pans : (!flag ? ask(2 * v + 2, m + 1, r, L, R, x, flag, n) : ask(2 * v + 1, l, m, L, R, x, flag, n)));
}

void solve() {
    int n; cin >> n;
    vector <int> nxt(n, n), prv(n, -1), snxt(n), sprv(n);
    stack <int> s;
    loop(i, n) {
        cin >> p[i];
        while (!s.empty() && p[s.top()] < p[i]) {
            nxt[s.top()] = i; s.pop();
        }
        s.push(i);
    }
    while (!s.empty())
        s.pop();
    for (int i = n - 1; i >= 0; --i) {
        while (!s.empty() && p[s.top()] < p[i]) {
            prv[s.top()] = i; s.pop();
        }
        s.push(i);
    }
    build(0, 0, n - 1);
    loop(i, n) {
        sprv[i] = ask(0, 0, n - 1, 0, prv[i] - 1, p[i], 1, n);
        snxt[i] = ask(0, 0, n - 1, nxt[i] + 1, n - 1, p[i], 0, n);
    }
    ll ans = 0;
    loop(i, n) {
        if (prv[i] != -1)
            ans += ll(prv[i] - sprv[i]) * (nxt[i] - i) * p[i];
        if (nxt[i] != n)
            ans += ll(snxt[i] - nxt[i]) * (i - prv[i]) * p[i];
    }
    cout << ans;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //int t; cin >> t; loop(i, t)
    solve();
    return 0;
}

Measured memory_bytes: 6668
#include <stdio.h>

int main (){
	char kalimat1[255];	// rng
	char kalimat2 [255]; // gorila
	char kalimat3 [255]; // apple
	scanf("%s", &kalimat1);
	scanf("%s", &kalimat2);
	scanf("%s", &kalimat3);	
	int lenght1=0;
	for (int i=0; kalimat1[i]!='\0'; i++){
		lenght1++;
	}
	int lenght2=0;
	for (int i=0; kalimat2[i]!='\0'; i++){
		lenght2++;
	}
	if (kalimat1[lenght1-1]==kalimat2[0]){
		if (kalimat2[lenght2-1]== kalimat3[0]){
			printf("YES");
		}
		else {
			printf("NO");
		}
	}
	else {
		printf("NO");
	}
	return 0;
}

Measured memory_bytes: 1732
import sys,bisect

from sys  import stdin,stdout

from bisect import bisect_left,bisect_right,bisect,insort,insort_left,insort_right

from math import gcd,ceil,floor,sqrt

from collections import Counter,defaultdict,deque,OrderedDict

from queue import Queue,PriorityQueue

from string import ascii_lowercase

sys.setrecursionlimit(10**6)
INF = float('inf')
MOD = 998244353
mod = 10**9+7

def isPrime(n):
    
    if (n <= 1) :return False
    if (n <= 3) :return True
    if (n%2 == 0 or n%3 == 0):return False
    for i in range(5,ceil(sqrt(n))+1,6):
        if (n%i==0 or n%(i+2)==0):
            return False
    return True


def st():
    return list(stdin.readline().strip())

def inp():
    return int(stdin.readline())

def li():
    return list(map(int,stdin.readline().split()))

def mp():
    return map(int,stdin.readline().split())

def pr(n):
    stdout.write(str(n)+"\n")
    
def DFS(dictionary,vertex,visited):
    visited[vertex]=True
    stack=[vertex]
    print(vertex)
    while stack:
        a=stack.pop()
        for i in dictionary[a]:
            if not visited[i]:
                print(i)
                visited[i]=True
                stack.append(i)


def BFS(dictionary, vertex,visited):
    visited[vertex]=True
    q=deque()
    q.append(vertex)
    while q:
        a=q.popleft()
        for i in dictionary[a]:
            if not visited[i]:
                visited[i]=True
                q.append(i)
                print(i)

                


def soe(limit):
    l=[1]*(limit+1)
    l[0]=0
    l[1]=0
    prime=[]
    for i in range(2,limit+1):
        if l[i]:
            for j in range(i*i,limit+1,i):
                l[j]=0
    
    for i in range(2,limit+1):
        if l[i]:
            prime.append(i)
    return prime

def segsoe(low,high):
    limit=int(high**0.5)+1
    prime=soe(limit)
    n=high-low+1
    l=[0]*(n+1)
    for i in range(len(prime)):
        lowlimit=(low//prime[i])*prime[i]
        if lowlimit<low:
            lowlimit+=prime[i]
        if lowlimit==prime[i]:
            lowlimit+=prime[i]
        for j in range(lowlimit,high+1,prime[i]):
            l[j-low]=1
    for i in range(low,high+1):
        if not l[i-low]:
            if i!=1:
                print(i)
                
def gcd(a,b):
    while b:
        a=a%b
        b,a=a,b
    return a

def power(a,n):
    r=1
    while n:
        if n&1:
            r=(r*a)
        a*=a
        n=n>>1
    return r
    
def solve():
    n=input()
    s=sum(list(map(int,str(n))))
    if s%9==0:
        pr('Yes')
    else:
        pr('No')

    




for _ in range(1):
    solve()
    


Measured memory_bytes: 84644
#include <cstdio>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <cmath>
#include <iomanip>
#include <deque>
#include <queue>
#include <unordered_map>
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;
ll intpow(ll N, ll P){
    if(P==0) return 1;
    if(P%2==0){
        ll t = intpow(N, P/2);
        return t*t;
    }
    return N * intpow(N, P-1);
}
ll modpow(ll N, ll P,ll k){
    if(P==0) return 1;
    if(P%2==0){
        ll t = modpow(N, P/2,k)%k;
        return t*t%k;
    }
    return N * modpow(N, P-1,k)%k;
}
ll modkai(ll n,ll m,ll k){//n*(n-1)*(n-2)*...(m+1)%k
    if(n == m)return 1;
    return modkai(n-1,m,k)*n%k;
}
ll mod_cnb(ll n,ll m,ll k){//nCm%k,kは十分大きい素数
  int m_=modkai(m,0,k);
  return modkai(n,n-m,k)*modpow(m_,k-2,k)%k;
}
ll gcd(ll n,ll m){
    ll n_ = max(n,m);
    ll m_ = min(n,m);
    if(n_%m_ == 0)return m_;
    return gcd(m_,n_%m_);
}
ll lcm(ll n,ll m){
    return n*m/gcd(n,m);
}
int main(){
    ll n;cin>>n;
    string s;cin>>s;
    ll ans=0;
    ll r,g,b;
    r=b=g=0;
    rep(i,n){
        if(s[i]=='R')r++;
        if(s[i]=='G')g++;
        if(s[i]=='B')b++;
    }
    ll cnt=0;
    for(int i=1;i<n;i++){//i個飛ばし
        for(int j=0;j+2*i<n;j++){
            if(s[j]!=s[j+i]&&s[j]!=s[j+i*2]&&s[j+i]!=s[j+i*2])cnt++;
        }
    }
    ans=r*b*g-cnt;
    cout<<ans<<endl;
}

Measured memory_bytes: 3612
#include <iostream>
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    int a,b,c,d,e,f,g,h;
    while(n--){
      cin>>a>>b>>c>>d;
      cin>>e>>f>>g>>h;
      cout<<a*e-b*f-c*g-d*h<< " " <<
      a*f+b*e+c*h-d*g<< " " <<
      a*g-b*h+c*e+d*f<< " " <<
      a*h+b*g-c*f+d*e<< endl;
    }
  }
}

Measured memory_bytes: 3072
/**
*    author:  boutarou
*    created: 27.06.2020 21:09:03
**/

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < int(n); i++)
#define fcout cout << fixed << setprecision(15)
using lint = long long;
using P = pair<int, int>;

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

const double PI = 3.1415926535897932;
const lint MAX = 1e7;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    lint n;
    lint ans = 0;
    cin >> n;
    vector<lint>a(n + 1);
    for (int i = 1; i <= n; i++) {
        for (int j = i; j <= n; j += i) {
            a[j]++;
        }
    }
    for (int i = 1; i <= n; i++) {
        ans += i * a[i];
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 81344
#include <math.h>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <iomanip>
#include <iterator>
#include <algorithm>
#include <functional>
#include <typeinfo>
#include <utility>
#include <tuple>
#include <queue>
#include <deque>

using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define reprrev(i, a, b) for (int i = (int)(b) - 1; i >= (int)(a); i--)
#define reprev(i, n) reprrev(i, 0, n)
#define mp(a, b) make_pair(a, b)
#define all(vec) (vec).begin(), (vec).end()
#define yn(formula) (formula) ? (cout << "Yes" << endl) : (cout << "No" << endl)
#define YN(formula) (formula) ? (cout << "YES" << endl) : (cout << "NO" << endl)
#define MIN(a, b) ((a) < (b)) ? (a) : (b)
#define LLONG_MAX     9223372036854775807i64

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pii> vp;
typedef vector<pll> vpl;
typedef vector<vi> vvi;
typedef vector<vll> vvl;
typedef vector<vb> vvb;
typedef vector<vc> vvc;
typedef vector<vs> vvs;
typedef vector<vp> vvp;
typedef vector<vpl> vvpl;

constexpr double PI = 3.14159265358979323846;
constexpr ll INF = 1 << 29;
constexpr ll MOD = (ll)1e9 + 7;
constexpr double EPS = 1e-7;
constexpr int dy[4] = { 0, 1, 0, -1 };
constexpr int dx[4] = { 1, 0, -1, 0 };

struct edge { ll to; ll cost; };

/*<ここから>***********************************************************/


int main()
{
	int A, B, C;
	cin >> A >> B >> C;

	cout << max(A + B, max(A - B, A*B)) << endl;


	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int [] X = new int [5] ;
		int ans = 0;
		
		for(int i=0;i<5;i++) {
			X[i] = sc.nextInt();
			if(X[i]==0) {
				ans = i+1;
			}
		}
		System.out.println(ans);
		
		sc.close();
	}

}

Measured memory_bytes: 35708
#include<bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>*/
 
using namespace std;
//using namespace __gnu_pbds;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define int long long 
#define rep(i,n) for(int i=0;i<n;i++)
#define repa(i,arr,n) for(int i=arr;i<=n;i++)
#define repd(i,arr,n) for(int i=arr;i>=n;i--)
#define trav(arr,x) for(auto& arr:x)
#define all(c) c.begin(), c.end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz(arr) (int)arr.size()
#define pi 3.14159265358979323846
#define MAX 500003
#define vi vector<int>
#define pii pair<int,int>
#define pqueue priority_queue<int>
#define pdqueue priority_queue<int,vi,greater<int> >
//#define endl "\n"
 
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
 
const int mod=1e9+7;
int power(int a,int b)
{
    int ans=1;
    while(b)
    {
        if(b&1)
        {
            ans=(ans*a);
        }
        a=(a*a);
        b>>=1;
    }
    return ans;
}

int32_t main()
{
    fast;
    int n,k,ans=1,val,cnt=0;
    vi pos,neg,v;
    cin>>n>>k;

    rep(i,n)
    {
        cin>>val;
        if(val<0) neg.pb(abs(val));
        else pos.pb(val);
    }

    sort(all(neg));
    sort(all(pos));
    if(sz(pos)==0)
    {
        if(k%2)
        {
            rep(i,k)
            {
                ans*=(-neg[i]);
                ans%=mod;
            }
            
            ans=(ans+mod)%mod;

            cout<<ans<<endl;

        }
        else
        {
            repd(i,sz(neg)-1,sz(neg)-k)
            {
                ans*=(-neg[i]);
                ans%=mod;
            }
            ans=(ans+mod)%mod;

            cout<<ans<<endl;
        }
        return 0;
    }
    reverse(all(neg));
    reverse(all(pos));

    int p=0,ne=0;

    if(k%2)
    {
        ans*=pos[p];
        ans%=mod;
        p++;
    }

    while(cnt<k/2)
    {
        if(p<(sz(pos)-1) && ne<(sz(neg)-1))
        {
        //cout<<ne<<" "<<sz(neg)-1<<endl;
            int val1=pos[p]*pos[p+1];
            int val2=neg[ne]*neg[ne+1];

            if(val1>val2)
            {
                val1%=mod;
                ans*=val1;
                ans%=mod;
                p+=2;
            }
            else
            {
                val2%=mod;
                ans*=val2;
                ans%=mod;
                ne+=2;
            }
        }
        else if(p<(sz(pos)-1))
        {
            ans*=pos[p];
            p++;
            ans%=mod;
            ans*=pos[p];
            p++;
            ans%=mod;
        }
        else if(ne<(sz(neg)-1))
        {
            ans*=neg[ne];
            ne++;
            ans%=mod;
             ans*=neg[ne];
            ne++;
            ans%=mod;
        }
        else break;
        cnt++;
    }

    if(cnt<(k/2))
    {
        ans*=pos[p];
        ans%=mod;
        ans*=(-neg[ne]);
        ans%=mod;
        ans=(ans+mod)%mod;
    }

    cout<<ans<<endl;
}   


Measured memory_bytes: 5596
A,B,K = map(int,input().split())
if A>K:
	print(A-K,end =" ")
	print(B)
elif A+B > K:
	print(0,end = " ")
	print(B-(K-A))
elif A+B <=K:
	print(0,end = " ")
	print(0)


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

int k,s,ans;

int main()
{
	cin>>k>>s;
	for(int i=0;i<=k;i++)
		for(int j=0;j<=k;j++)
			if (s-i-j<=k&&s-i-j>=0) ans++;
	cout<<ans<<endl;			
	return 0;
}

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

int main()
{
    ll n, i, j, sum, x;
    vector <ll> v;
    cin >> n;
    ll N[n];
    for(i=0;i<n;i++)
    {
        cin >> N[i];
    }
    sort(N,N+n);
    for(i=N[0];i<=N[n-1];i++)
    {
        sum = 0;
        for(j=0;j<n;j++)
        {
            x = (N[j] - i)*(N[j] - i);
            sum = sum + x;
        }
        v.push_back(sum);
    }
    sort(v.begin(), v.end());
    cout << v[0] << endl;
    return 0;
}

Measured memory_bytes: 3636
a, b, c, d = map(int, input().split())

for i in range(1001):
    if i % 2 == 0:
        c -= b
        if c <= 0:
            print("Yes")
            break
    elif i % 2 == 1:
        a -= d
        if a <= 0:
            print("No")
            break

Measured memory_bytes: 9152
#include<iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int  a[200050],i,x;
long long s,maxn;
int main() 
{
	int n,k;
	cin>>n>>k;
	x=0;
	for(i=1;i<=n;i++)
	{
	 cin>>a[i];
	 a[i]++;
     s+=a[i];
     maxn=max(maxn,s);
     x++;
     if(x==k)
     {
    	s-=a[i-k+1];
    	x--;
	 }
    }
	cout<<maxn/2;
    if(maxn%2==1) cout<<".5";
    cout<<endl;
  
}

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

using namespace std;

int main()
{
    int N;
    cin >> N;
    string c;
    cin >> c;
    string d;
    d = c;
    sort(c.begin(), c.end());
    int diff = 0;
    for (int i = 0; i < N; i++)
    {
        if (c[i] != d[i])
            diff++;
    }
    cout << diff / 2 << endl;
}

Measured memory_bytes: 3916
#pragma GCC optimize ("O3")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")

#include <bits/stdc++.h>

// 汎用マクロ
#define ALL_OF(x) (x).begin(), (x).end()
#define REP(i,n) for (long long i=0, i##_len=(n); i<i##_len; i++)
#define RANGE(i,is,ie) for (long long i=(is), i##_end=(ie); i<=i##_end; i++)
#define DSRNG(i,is,ie) for (long long i=(is), i##_end=(ie); i>=i##_end; i--)
#define UNIQUE(v) { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); }
template<class T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return true;} return false; }
template<class T> bool chmin(T &a, const T &b) {if (a > b) {a = b; return true;} return false; }
#define INF 0x7FFFFFFF
#define LINF 0x7FFFFFFFFFFFFFFFLL
#define Yes(q) (q ? "Yes" : "No")
#define YES(q) (q ? "YES" : "NO")
#define DUMP(q) cerr << "[DEBUG] " #q ": " << (q) << " at " __FILE__ ":" << __LINE__ << endl
#define DUMPALL(q) { cerr << "[DEBUG] " #q ": ["; REP(dumpall_i, (q).size()) { cerr << q[dumpall_i] << (dumpall_i == (q).size() - 1 ? "" : ", "); } cerr << "] at " __FILE__ ":" << __LINE__ << endl; }
template<class T> T gcd(const T &a, const T &b) { return a < b ? gcd(b, a) : b ? gcd(b, a % b) : a; }
template<class T> T lcm(const T &a, const T &b) { return a / gcd(a, b) * b; }

// gcc拡張マクロ
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll

// エイリアス
using  ll = long long;
using ull = unsigned long long;
using  ld = long double;
using namespace std;

// モジュール


// 処理内容
int main() {
    
    ll n; cin >> n;
    vector<ll> a(n);
    REP(i, n) cin >> a[i];

    if (accumulate(ALL_OF(a), 0LL) == 0) {
        cout << "Yes" << endl;
        return 0;
    }

    if (n % 3) {
        cout << "No" << endl;
        return 0;
    }

    REP(i, 32) {
        ll bitnum = 0;
        REP(j, n) {
            bitnum += !!(a[j] & (1LL << i));
        }
        // DUMP(bitnum);
        if (bitnum != 0 && bitnum * 3 != n * 2) {
            cout << "No" << endl;
            return 0;
        }
    }
    
    map<ll, ll> numa;
    REP(i, n) {
        numa[a[i]]++;
    }
    switch(numa.size()) {

        case 1: {
            bool ans = accumulate(ALL_OF(a), 0LL) == 0;
            cout << Yes(ans) << endl;
        } break;
        
        case 2: {
            auto u = *numa.begin();
            auto v = *++numa.begin();
            if (u.first != 0) {
                cout << "No" << endl;
            } else if (u.second * 2 == v.second) {
                cout << "Yes" << endl;
            } else {
                cout << "No" << endl;
            }
        } break;

        case 3: {
            cout << "Yes" << endl;
        } break;

        default: {
            cout << "No" << endl;
        }
        
    }
    
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007 

ll a[100010];

int main() {
	ll n,k;
	cin>>n>>k;
	for(int i=0;i<n;i++){
		int l,r;
		cin>>l>>r;
		a[l]+=r;
	}
	ll sum=0,j=0;
	while(sum<k){
		sum+=a[j];
		j++;
	}
	cout << j-1;
}

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

int main(){
    int W,H,x,y,r;
    cin >> W >> H >> x >> y >> r;
    if(x - r >= 0 && x + r <= W){
        if(y - r >=0 && y + r <= H){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3092
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>

using namespace std;

#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

using Pi = pair<int, int>;
using ll = long long;
const int INF = 1 << 28;

string to_string(string s) {
  return s;
}

template <class T>
string to_string(vector<T> v) {
  string ret = "{";
  for (int i = 0; i < v.size() - 1; ++i) {
    ret += to_string(v[i]) + ",";
  }
  if (v.size() > 0) {
    ret += to_string(v.back());
  }
  ret += "}";
  return ret;
}

void debug() {
  cerr << endl;
}

template <class Head, class... Tail>
void debug(Head head, Tail... tail) {
  cerr << to_string(head) << " ";
  debug(tail...);
}

void print() {
  cout << endl;
}

template <class Head, class... Tail>
void print(Head head, Tail... tail) {
  cout << to_string(head);
  print(tail...);
}

void get() {}

template <class Head, class... Tail>
void get(Head& head, Tail&... tail) {
  cin >> head;
  get(tail...);
}

template <class T>
void getv(vector<T>& vec) {
  for (int i = 0; i < vec.size(); ++i)
    cin >> vec[i];
}

int main() {
  int N;
  get(N);
  vector<int> a(N);
  getv(a);
  map<int, int> list;
  FOR(i, N) { list[a[i]]++; }
  if (list.size() > 3) {
    print("No");
  } else if (list.size() == 1) {
    if (a[0] == 0) {
      print("Yes");
    } else {
      print("No");
    }
  } else if (list.size() == 2) {
    vector<Pi> p;
    for (Pi x : list)
      p.push_back(x);
    sort(ALL(p), [](const Pi& l, const Pi& r) { return l.second < r.second; });
    if (p[0].second * 2 == p[1].second &&
        (p[0].first ^ p[1].first) == p[1].first) {
      print("Yes");
    } else {
      print("No");
    }
  } else {
    vector<Pi> p;
    for (Pi x : list)
      p.push_back(x);
    sort(ALL(p), [](const Pi& l, const Pi& r) { return l.second < r.second; });
    if (p[0].second == p[1].second && p[1].second == p[2].second &&
        (p[0].first ^ p[1].first) == p[2].first) {
      print("Yes");
    } else {
      print("No");
    }
  }
  return 0;
}

Measured memory_bytes: 4224
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int main()
{
	string s;
	cin>>s;
	int a[4];
	a[0]=s[0]-'0';a[1]=s[1]-'0';
	a[2]=s[2]-'0';a[3]=s[3]-'0';
	int m1=a[0]*10+a[1];
	int m2=a[2]*10+a[3];
	if(!m2||!m1){
		if(!m1&&m2!=0){
			if(m2<=12){
				cout<<"YYMM";
			}
			else{
				cout<<"NA";
			}
		}
		//cout<<"NA";
		if(!m2&&m1!=0){
			if(m1<=12){
				cout<<"MMYY";
			}
			else{
				cout<<"NA";
			}
		}
		if(m1==0&&m2==0){
			cout<<"NA";
		}
	}
	else{
		if(m2<=12){
			if(m1<=12){
				cout<<"AMBIGUOUS";
			}
			else{
				cout<<"YYMM";
			}
		}
		else{
			if(m1<=12){
				cout<<"MMYY";
			}
			else{
				cout<<"NA";
			}
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int n,i,j=0;
    scanf("%d",&n);
    int ar[n];
    for(i = 0;i<n;i++)
    {
        scanf("%d",&ar[i]);
    }
    for(i = 1;i < n-1;i++)
    {
        if(ar[i-1] < ar[i] && ar[i] < ar[i+1])
        {
            j++;
        }
        else if(ar[i-1] > ar[i] && ar[i] > ar[i+1])
        {
            j++;
        }
    }
    printf("%d\n",j);
    return 0;
}


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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)

using ll = long long;
using ld = long double;
ll INF = LLONG_MAX;

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

namespace output {
	void pr(int x) { cout << x; }
	void pr(long x) { cout << x; }
	void pr(ll x) { cout << x; }
	void pr(unsigned x) { cout << x; }
	void pr(unsigned long x) { cout << x; }
	void pr(unsigned long long x) { cout << x; }
	void pr(float x) { cout << x; }
	void pr(double x) { cout << x; }
	void pr(ld x) { cout << x; }
	void pr(char x) { cout << x; }
	void pr(const char* x) { cout << x; }
	void pr(const string& x) { cout << x; }
	void pr(bool x) { pr(x ? "true" : "false"); }
	template<class T> void pr(const complex<T>& x) { cout << x; }
	
	template<class T1, class T2> void pr(const pair<T1,T2>& x);
	template<class T> void pr(const T& x);
	
	template<class T, class... Ts> void pr(const T& t, const Ts&... ts) { 
		pr(t); pr(ts...); 
	}
	template<class T1, class T2> void pr(const pair<T1,T2>& x) { 
		pr("{",x.f,", ",x.s,"}"); 
	}
	template<class T> void pr(const T& x) { 
		pr("{"); // const iterator needed for vector<bool>
		bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; 
		pr("}");
	}
	
	void print() { pr("\n"); } // print w/ spaces
	template<class T, class... Ts> void print(const T& t, const Ts&... ts) { 
		pr(t); if (sizeof...(ts)) pr(" "); print(ts...); 
	}
}

using namespace output;

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int N; cin >> N;
	vi arr (N);
	F0R(i, N) cin >> arr[i];
	int ans = 0;
	int l = 0;
	while (l < N) {
		if (l == N - 1) {
			++ans;
			break;
		}
		int h = l;
		while (h < N && arr[h] == arr[l]) ++h;
		if (h < N) {
			if (arr[h] > arr[l]) {
				while (h < N && arr[h] >= arr[h-1]) ++h;
			} else {
				while (h < N && arr[h] <= arr[h-1]) ++h;
			}
		}
		++ans;
		l = h;
	}
	print(ans);
}

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

#define F first
#define S second

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;

const int N = 200010, M = 10;

int n;
map<string, int> h;

int main()
{
	cin >> n;
	while (n -- )
	{
		string s;
		cin >> s;
		h[s] ++ ;
	}
	
	int maxa = -1;
	for (auto u : h) maxa = max(maxa, u.S);
	for (auto u : h)
		if (u.S == maxa)
			cout << u.F << endl;
	return 0;
}

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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();

            switch (input)
            {
                case ("Sunny"):
                    Console.WriteLine("Cloudy");
                    break;
                case ("Cloudy"):
                    Console.WriteLine("Rainy");
                    break;
                case ("Rainy"):
                    Console.WriteLine("Sunny");
                    break;
                default:
                    return;
            }

        }

    }


}


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

int main(){
	
	int n;
	cin >> n;
	vector<pair<int, int>> red(n), blue(n);
	for(int i = 0; i < n; i++)
	{
		int a, b;
		cin >> a >> b;
		//redのｙ座標をソートしたい
		red[i] = make_pair(b, a);
	}
	for(int i = 0; i < n; i++)
	{
		int a, b;
		cin >> a >> b;
		blue[i] = make_pair(a, b);
	}
	sort(red.begin(), red.end(), greater<pair<int, int>>());
	sort(blue.begin(), blue.end());

	
	int ans = 0;
	vector<bool> ok(n, true);
	for(int i = 0; i < n; i++)
	{
		for(int j = 0; j < (int)red.size(); j++)
		{	
			//redに代入した順序はｙ座標でソートさせるため、ｘとｙが逆になる
			if(ok[j] && red[i].first < blue[j].second && red[i].second < blue[j].first){
				ans++;
				ok[j] = false;
				break;
			}
		}
		
	}
	
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 384
#include<stdio.h>

int main(void){
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  if((a == 5 && ((a == b && c == 7) || (a == c && b == 7))) || (b == 5 && b == c && a == 7)){
    printf("YES\n");
  }else{
    printf("NO\n");
  }
  return 0;
}

Measured memory_bytes: 1620
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);(i)++)
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);(i)++)
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);(i)--)
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);(i)--)
#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()
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; }return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; }return 0; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }

int main() {
    init();

    int n;
    cin >> n;
    VL p(n), index(n);
    FOR(i, 0, n) {
        cin >> p[i];
        index[--p[i]] = i;
    }

    ll ans = 0;
    set<ll> set = { -1,n };
    rFOR(i, 0, n) {
        ll c = index[i];
        auto itr = set.lower_bound(c);

        ll d = *itr, e = n;
        if (d != n)e = *++itr--;
        else itr--;
        ll b = *itr, a = -1;
        if (b != -1)a = *--itr;

        ll num = (b - a) * (d - c) + (c - b) * (e - d);
        ans += num * (i + 1LL);

        set.insert(c);
    }
    cout << ans << "\n";
}

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

namespace VirtualAtCorder
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            const int ramen = 700;
            const int topping = 100;
            int sum = 0;

            foreach (char i in input)
            {
                if (i.CompareTo('o') == 0) sum += topping;
            }
            sum += ramen;

            Console.WriteLine(sum);

            Console.ReadKey();
        }



    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
 
int n,k,jk[12],ja[12][2003],dp[12][2003],ans;
 
int main(){
    scanf("%d%d",&n,&k);
    for(int i = 0;i < n;i++){
        int c,g;
        scanf("%d%d",&c,&g);
        ja[g][jk[g]++] = c;
    }
 
    for(int i = 1;i <= 10;i++){
        sort(ja[i],ja[i] + jk[i],greater<int>());
    }
    for(int i = 1;i <= 10;i++){
        for(int j = 1;j < jk[i];j++){
            ja[i][j] += ja[i][j-1] + j*2;
        }
    }
 
    for(int i = 1;i <= 10;i++){
        for(int j = 1;j <= k;j++){
            dp[i][j] = max(dp[i][j],dp[i-1][j]);
        }
        for(int j = 1;j <= jk[i];j++){
            for(int l = j;l <= k;l++){
                dp[i][l] = max(dp[i][l],dp[i-1][l-j]+ja[i][j-1]);
                ans = max(ans,dp[i][l]);
            }
        }
    }
 
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 3408
using System;
class Program
{
	static void Main(string[] args)
	{
		string line = Console.ReadLine();
        string[] chars = line.Split(' ');
        int num1 = int.Parse(chars[0]);
        int num2 = int.Parse(chars[2]);
        int result = 0;

        if(chars[1] == "+"){
            result = num1 + num2;
        }else{
            result = num1 - num2;
        }

		Console.WriteLine(result);
	}
}

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

const int INF=1000;
struct edge{
    int to,cap,rev;
};
vector<edge> graph[1010];
bool used[1010];
void add_edge(int from,int to,int cap){
    graph[from].push_back((edge){to,cap,static_cast<int>(graph[to].size())});
    graph[to].push_back((edge){from,0,static_cast<int>(graph[from].size()-1)});
}
int dfs(int at,int t,int f){
    if(at==t) return f;
    used[at]=true;
    for(int i=0;i<graph[at].size();i++){
        edge &now=graph[at][i];
        if(!used[now.to] && now.cap>0){
            int d=dfs(now.to,t,min(f,now.cap));
            if(d>0){
                now.cap-=d;
                graph[now.to][now.rev].cap+=d;
                return d;
            }
        }
    }
    return 0;
}
int max_flow(int s,int t,int V){
    int flow=0;
    for(;;){
        for(int i=0;i<V;i++){
            used[i]=false;
        }
        int f=dfs(s,t,INF);
        if(f==0) return flow;
        flow+=f;
    }
}

int b[510],r[510];
int main(){
    int m,n;
    for(;;){
        scanf("%d%d",&m,&n);
        if(m==0 && n==0) break;
        fill(graph,graph+m+n+2,vector<edge>());
        for(int i=0;i<m;i++){
            add_edge(m+n,i,1);
            scanf("%d",&b[i]);
        }
        for(int i=0;i<n;i++){
            add_edge(i+m,m+n+1,1);
            scanf("%d",&r[i]);
        }
        for(int i=0;i<m;i++){
            for(int j=0;j<n;j++){
                if(__gcd(b[i],r[j])>1) add_edge(i,j+m,1);
            }
        }
        printf("%d\n",max_flow(m+n,m+n+1,m+n+2));
    }
}

Measured memory_bytes: 7532
use std::collections::BinaryHeap;

#[allow(unused_macros)]
macro_rules! scan {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().to_string()
        }
    };
    (;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>()
        }
    };
    (;;$n:expr) => {
        {
            (0..$n).map(|_| scan!()).collect::<Vec<_>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty;;$n:expr) => {
        (0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    scan!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    scan!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let (n, m) = scan!(usize, usize);
    let mut h = scan!(i64;;)
        .into_iter()
        .map(|v| -v)
        .collect::<BinaryHeap<_>>();
    let mut cards = scan!(i64, i64;m);
    cards.sort_by_key(|&(_, v)| v);

    for &(b, c) in cards.iter().rev() {
        for _ in 0..b {
            if h.peek().unwrap() > &&(-c) {
                h.pop();
                h.push(-c);
            } else {
                break;
            }
        }
    }

    println!(
        "{}",
        -h.into_iter().collect::<Vec<_>>().into_iter().sum::<i64>()
    );
}


Measured memory_bytes: 8444
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;

// ModInt begin

using ll = long long;
template<ll mod>
struct ModInt {
    ll v;
    ll mod_pow(ll x, ll n) const {
        return (!n) ? 1 : (mod_pow((x*x)%mod,n/2) * ((n&1)?x:1)) % mod;
    }
    ModInt(ll a = 0) : v((a %= mod) < 0 ? a + mod : a) {}
    ModInt operator+ ( const ModInt& b ) const {
        return (v + b.v >= mod ? ModInt(v + b.v - mod) : ModInt(v + b.v));
    }
    ModInt operator- () const {
        return ModInt(-v);
    }
    ModInt operator- ( const ModInt& b ) const {
        return (v - b.v < 0 ? ModInt(v - b.v + mod) : ModInt(v - b.v));
    }
    ModInt operator* ( const ModInt& b ) const {return (v * b.v) % mod;}
    ModInt operator/ ( const ModInt& b ) const {return (v * mod_pow(b.v, mod-2)) % mod;}
    
    bool operator== ( const ModInt &b ) const {return v == b.v;}
    bool operator!= ( const ModInt &b ) const {return !(*this == b); }
    ModInt& operator+= ( const ModInt &b ) {
        v += b.v;
        if(v >= mod) v -= mod;
        return *this;
    }
    ModInt& operator-= ( const ModInt &b ) {
        v -= b.v;
        if(v < 0) v += mod;
        return *this;
    }
    ModInt& operator*= ( const ModInt &b ) {
        (v *= b.v) %= mod;
        return *this;
    }
    ModInt& operator/= ( const ModInt &b ) {
        (v *= mod_pow(b.v, mod-2)) %= mod;
        return *this;
    }
    ModInt pow(ll x) { return ModInt(mod_pow(v, x)); }
    // operator int() const { return int(v); }
    // operator long long int() const { return v; }
};

template<ll mod>
ModInt<mod> pow(ModInt<mod> n, ll k) {
    return ModInt<mod>(n.mod_pow(n.v, k));
}

template<ll mod>
ostream& operator<< (ostream& out, ModInt<mod> a) {return out << a.v;}
template<ll mod>
istream& operator>> (istream& in, ModInt<mod>& a) {
    in >> a.v;
    return in;
}

// ModInt end

using mint = ModInt<MOD>;

mint nCr(ll n, ll r) {
    if(r < 0 or n < r) return mint(0);
    if(n - r < r) return nCr(n, n-r);
    mint res(1);
    for(int i=0; i<r; i++) {
        res *= mint(n-i);
        res /= mint(i+1);
    }
    return res;
}

int main() {
    ll N, A, B; cin >> N >> A >> B;

    mint ans = pow(mint(2), N) - mint(1);
    ans -= nCr(N, A);
    ans -= nCr(N, B);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.*;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main
{
	public static void main (String[] arg)throws IOException
	{
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String ln ="";
		int a,y;
		while((ln=input.readLine()) != null){
			int count=0;	
			a = Integer.parseInt(ln);
			
			for (int i=a; i < 600; i+= a){
				y=i*i;
				count += y*a;
			}
			System.out.println(count);
		}
	}
}

Measured memory_bytes: 16864