akhauriyash/Code-Regression huggingface dataset:
# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
#include <stdio.h>
#include<time.h>
#include <stdlib.h>
#include <cstdint>
#include <cfenv>
#include<fstream>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD = 1000000000 + 7;
constexpr long long INF = numeric_limits<LL>::max() / 2;
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr<<#x<<": "<<x<<'\n'
typedef pair<LL, LL> Pll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
struct Fll { LL first, second, third, fourd; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Mfor(i,mf) for(LL i=mf-1;i>=0;i--)
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}
struct Edge { LL to, cost; };
struct edge { LL from, to, cost; };
vector<vector<Edge>>g;
vector<edge>edges;
vector<Pll>v;
map<string, LL>ma;
multiset<LL>st;
LL h, w, n, m, k, t, s, p, q, last, cnt, sum, ans, a[210000], b[210000], d[200000];
string str[110000], ss;
bool f[110000];
char c;
int di[4][2] = { { 0,1 },{ 1,0 },{ 0,-1 },{ -1,0 } };
int main() {
	cin >> n;
	rep(i, n) {
		cin >> str[i];
		sort(str[i].begin(), str[i].end());
	}
	sort(str, str + n);
	rep(i, n - 1) {
		if (str[i] == str[i + 1]) {
			cnt++;
		}
		else {
			ans += (cnt)*(cnt + 1) / 2;
			cnt = 0;
		}
	}
	ans += (cnt + 1)*(cnt) / 2;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 7424
#include<iostream>
using namespace std;
int main()
{
    long long int N,i,s,c;
    cin>>N;
    int a[N];
    for(i=0;i<N;i++)
    {
        cin>>a[i];
    }
    s=a[0],c=1;
    for(i=1;i<N;i++)
    {
        if(a[i]<=s)
        {
            c++;
            s=a[i];
        }
    }
    cout<<c<<endl;

}


Measured memory_bytes: 4388
#include <stdio.h>

int main(){
	long long int h,w; //linha x coluna
	long long int res;
	scanf("%lli %lli",&h,&w);

	if((h==1)  || (w==1)){
		printf("1\n");

	}else if(h%2==0 && w%2==0){
		res = (h*w)/2;
		printf("%lli\n",res);

	}else if(h%2==0 && w%2!=0){
		res =(h*w)/2;
		printf("%lli\n",res);

	}else if(h%2!=0 && w%2==0){
		res=(h*w)/2;
		printf("%lli\n",res);
	}else if(h%2!=0 && w%2!=0){
		res = (h*w)/2 + 1;
		printf("%lli\n",res);
	}



	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < n; ++i)
using namespace std;
using ll = long long;
using ull = long long unsigned;
using P = pair<ll,ll>;
//const int 1001001001;
const int NMAX=8;
const ll MOD=1000000007;
const ll INF=1e18;
const int mod = 998244353;
ll dp[200005][4];

int main(){
	ll n;
	cin>>n;
	vector<ll> a(n);
	rep(i,n)cin>>a[i];
	ll k=n%2+1;//何個余分な数が入るか

	rep(i,n+1)rep(j,k+1)dp[i][j]=-INF;
	dp[0][0]=0;
	rep(i,n)rep(j,k+1){
		dp[i+1][j+1]=max(dp[i+1][j+1],dp[i][j]);
		//選ばれない時
		if((i+j)%2==0){
			dp[i+1][j]=max(dp[i+1][j],dp[i][j]+a[i]);
		}
		else{
			dp[i+1][j]=max(dp[i+1][j],dp[i][j]);
		}
	//	cout<<dp[i+1][j]<<'i'<<i<<'j'<<j<<endl;


	}
	ll ans=dp[n][k];
	cout<<ans;
}


Measured memory_bytes: 11088
def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    c = 0
    while all([ai % 2 == 0 for ai in a]):
        a = [ai // 2 for ai in a]
        c += 1
    print(c)


if __name__ == "__main__":
    resolve()


Measured memory_bytes: 2940
#include <iostream>
#include <cstdio> 
#include <cstring>
#include <cmath>
#include <string>
using namespace std;
int main()
{
	
	long long a,b,x;
	cin>>a>>b>>x;

	if(a==b)
	{
		if(a%x==0)
		{
			cout<<"1"<<endl;
		}
		else
		{
			cout<<"0"<<endl;
		}
	}
	else//a<b 
	{
		if(x>b)
		{
			if(a==0) cout<<"1"<<endl;
			else cout<<"0"<<endl;
		}
		else if(x==b)
		{
			if(a==0) 
			cout<<"2"<<endl;
			else
			cout<<"1"<<endl;
		}
		else
		{
			if(x==a)
			{
				long long t=(b-a)/x;
				cout<<(t+1)<<endl;
			}
			else if(x>a)
			{
				long long flag=0;
				if(a==0) flag=1;
				long long t=(b-x)/x;
				cout<<(flag+1+t)<<endl;
			}
			else
			{
				long long t=a/x;
				if(t*x==a)
				{
					cout<<(b-a)/x+1<<endl;
				}
				else
				{
					if((t+1)*x<=b)
					{
						cout<<(b-(t+1)*x)/x+1<<endl;
					}
					else
					{
						cout<<"0"<<endl;
					}
				}
			}
		}
	}
	
	
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;


public class Contest
{
	public static void Main()
	{

/*
		int n = a[0];
		int[][] e = new int[n][];
		for(int i=0; i<n; i++) MyRead.Array(out e[i]);

		int[] a;
		MyRead.Array(out a);

        long a,b,c,d,e,f;
        MyRead.Multi(out a, out b, out c, out d, out e, out f);

		Console.WriteLine(string.Join(' ', Array.ConvertAll(ans, x => x.ToString())));
*/

        int n;
		MyRead.Multi(out n);



		int ans = 0;
		for(int i=1;i<=n; i++)if((i.ToString().Length%2)==1) ans++;

		Console.WriteLine(ans);
	}


}

public static class MyRead
{
	private static bool eq<T, U>() => typeof(T).Equals(typeof(U));
	private static T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
	private static T cv<T>(string s) => eq<T, int>()    ? ct<T, int>(int.Parse(s))
	                                  : eq<T, long>()   ? ct<T, long>(long.Parse(s))
	                                  : eq<T, double>() ? ct<T, double>(double.Parse(s))
	                                  : eq<T, char>()   ? ct<T, char>(s[0])
	                                                    : ct<T, string>(s);
	public static string[] Array<T>(out T[] a) {		
		var ar = Console.ReadLine().Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries); 												
		a = System.Array.ConvertAll(ar, new Converter<string,T>(cv<T>));
		return ar;
	}										
	public static string[] Multi<T>(out T a) {
		var ar = Console.ReadLine().Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries); 
		a = cv<T>(ar[0]);
		return ar;
	}
	public static string[] Multi<T, U>(out T a, out U b) {
		var ar = Multi<T>(out a); 
        b = cv<U>(ar[1]);
		return ar;
	}
	public static string[] Multi<T, U, V>(out T a, out U b, out V c) {
		var ar = Multi<T, U>(out a, out b); 
        c = cv<V>(ar[2]);
		return ar;
	}
	public static string[] Multi<T, U, V, W>(out T a, out U b, out V c, out W d) {
		var ar = Multi<T, U, V>(out a, out b, out c); 
        d = cv<W>(ar[3]);
		return ar;
	}
	public static string[] Multi<T, U, V, W, X>(out T a, out U b, out V c, out W d, out X e) {
		var ar = Multi<T, U, V, W>(out a, out b, out c, out d); 
        e = cv<X>(ar[4]);
		return ar;
	}
	public static string[] Multi<T, U, V, W, X, Y>(out T a, out U b, out V c, out W d, out X e, out Y f) {
		var ar = Multi<T, U, V, W, X>(out a, out b, out c, out d, out e); 
        f = cv<Y>(ar[5]);
		return ar;
	}
}




Measured memory_bytes: 13268
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define REV(i,n) for(int i=n-1;i>0;i--)
#define req(i,n,m) for(int i=n;i<m;i++)
#define REQ(i,n,m,l) for(int i=n;i<m;i+=l) 
#define _GLIBCXX_DEBUG
int INF = 1e9 + 7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
    unsigned day;
    if (dow < dow1) dow += 7;
    day = dow - dow1;
    day += 7 * n - 6;
    return day;
}
signed gcd(int x, int y) {
    if (y == 0)return x;
    return gcd(y, x % y);
}
signed lcm(int x, int y) {
    return x / gcd(x, y) * y;
}
unsigned DayToWeekNumber(unsigned day)
{
    return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
    return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
signed main() {
    int N; cin >> N;
    string S; cin >> S;
    vector<int>C(N-1);
    REP(i, N) {
        vector<int>A(26,0);
        vector<int>B(26,0);
        rep(j, i)A[S.at(j) - 97] = 1;
        req(j, i, N)B[S.at(j) - 97] = 1;
        rep(j, 26)if (A[j] == 1 && B[j] == 1)C[i - 1]++;
    }
    sort(C.begin(), C.end());
    cout << C[N - 2] << endl;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define all(x) (x).begin(), (x).end()
#define len(x) ((long long)(x).size())
#define g(a, b) __gcd((a), (b))
#define l(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using pll = pair<ll, ll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U>bool has_key(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<class T, class U>T rem(T a, U b) { return a - b*floor(a/b); }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;

std::map<long long, long long> factorint(long long n)
{
    std::map<long long, long long> res;
    do {
    top:
        for (long long i = 2; i < std::sqrt(n)+1000; ++i) {
            if (n % i == 0) {
                if (res.find(i) == res.end()) res[i] = 0;
                res[i]++;
                n /= i;
                goto top;
            } 
        }
        if (n != 1) res[n] = 1;
        break;
    } while (true);
    
    return res;
}


int main()
{
        ll A, B;
        cin >> A >> B;
        ll g = g(A, B);
        //cout << g << endl;
        auto f = factorint(g);

        cout << len(f) + 1 << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		SC sc = new SC(System.in);
		int N=sc.nextInt();
		long K=sc.nextLong();
		long[] ito=new long[N];
		long nagasa=0;
		for(int i=0; i<N; i++) {
			ito[i]=sc.nextLong();
		}
		int counter=-1;
		for(int i=0; i<N-1; i++) {
			if(ito[i]+ito[i+1]>=K) {
				counter=i;
				break;
			}
		}
		if(counter==-1) {
			pl("Impossible");
		}
		else {
			StringBuilder sb=new StringBuilder();
			sb.append("Possible\n");
			for(int i=0; i<counter; i++) {
				sb.append(i+1+"\n");
			}
			for(int i=N-1; i>counter; i--) {
				sb.append(i+"\n");
			}
			pl(sb.toString());
		}
	}
	static class SC {
		private BufferedReader reader = null;
		private StringTokenizer tokenizer = null;
		public SC(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String next() {
			if (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
	public static void pl() {
		System.out.println();
	}
	public static void p(Object o) {
		System.out.print(o);
	}
}


Measured memory_bytes: 43700
#include <bits/stdc++.h>
#define cina(a, n) for (int i = 0; i < n; ++i){ cin >> a[i]; }
#define ll long long

using namespace std;

int main () {
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	ll a;
	double b;
	cin >> a >> b;
	cout << (a*(int)(b*100+.1)) / 100;

	return 0;
}

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

int main() {
  int N, count = 0;
  cin >> N;
  vector<int> S(N);
  rep(i,N) cin >> S.at(i);
  sort(S.begin(),S.end());
  for(int i = 0;i < N - 2;i++) {
    for(int j = i + 1;j < N - 1;j++) {
      for(int k = j + 1;k < N;k++){
        if(S.at(i) + S.at(j) > S.at(k) && S.at(i) != S.at(j) && S.at(j) != S.at(k)) count++;
        else continue;
      }
    }
  }
  cout << count << endl;
}

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

int main()
{
    int n;
    cin>>n;
    set<string> S;
    for (int i=0; i<n; i++)
    {
        string cmd, str;
        cin>>cmd>>str;
        if (cmd=="insert")
            S.insert(str);
        else
            cout<<(S.count(str)>0 ? "yes" : "no")<<endl;
    }
}



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

int main()
{
  vector<int> v(5);
  for(int &i:v)
  {
    cin>>i;
  }
  for(int i:v)
  {
  	if(v[i]==0){
      cout<<i+1;
      break;
	}
  }
  return 0;
}

Measured memory_bytes: 3528
#include<bits/stdc++.h>
#define FAST_IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int long long int
#define mod 1000000007
using namespace std;

void solve()
{
	int n;
	cin>>n;
	vector<int> v(n);
	for(int i=0;i<n;i++)
		cin>>v[i];

	int pre[n]={0};
	for(int i=0;i<n;i++)
	{
		pre[i] = (i-1>=0 ? pre[i-1] : 0) + v[i];
		pre[i]%=mod;

	}

	int ans=0;

	for(int i=1;i<n;i++)
	{
		ans+=(v[i]*pre[i-1])%mod;
		ans%=mod;

	}
	cout<<ans<<endl;




}
signed main()

{
	FAST_IO;
	int t = 1;

	// cin>>t;

	while(t--)
	{
		solve();
	}
	
	return 0;
}

Measured memory_bytes: 6356
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <stack>
using namespace std;

int main () {
	stack<char> s;
	string str;
	cin >> str;
	int res = 0;
	for (auto ss : str) {
		if (s.size() == 0)
			s.push(ss);
		else {
			if (s.top() != ss) {
				s.pop();
				res += 2;
			}
			else {
				s.push(ss);
			}
		}
	}
	cout << res;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
using namespace std;
int main(void){
    int N;
    unsigned long long star[26];
    string EN,EX;
    cin >> N;
    cin >> EN;
    cin >> EX;
    for(int i=0;i<26;i++){
        star[i]=0;
    }
    star[EN[0]-0x61]=1;
    for(int i=1;i<N-1;i++){
        int en=EN[i]-0x61;
        int ex=EX[i]-0x61;
        if(star[ex]>0){
            star[en]=(star[ex]+star[en]) % 1000000007;
        }
    }
    cout << star[EX[N-1]-0x61]<< endl;
}



Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
#define fine cout<<"fine"<<endl;
#define ll long long int
#define pb push_back
#define FASTIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
const ll inf=(ll)2e18;
const int mod=1e9+7;
bool overflow(ll a,ll b){
    if (a <= (inf+b-1)/b) return false;
    return true;
}
int main(){
FASTIO;
int k,n,i,x;
cin>>k>>n;
vector<int> v;
for(i=0;i<n;i++){
    cin>>x;
    v.pb(x);
}
reverse(all(v));
for(i=0;i<n;i++){
    v.pb(v[i]-k);
}
reverse(all(v));
int mini=1e9;
for(i=0;i<=n;i++){
    mini=min(mini,v[i+n-1]-v[i]);
}
cout<<mini<<endl;
}


Measured memory_bytes: 2420
n = int(input())
count, flag = 0, False
for i in range(n):
  a, b = map(int, input().split())
  if a == b:
    count += 1
  else:
    count = 0
  if count == 3:
    flag = True
if flag:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 9172
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Tasks
{
    public class C
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var N = Scanner.Scan<int>();
            var A = Console.ReadLine().Trim().Split(' ').Select(long.Parse).ToArray();
            var answer = 0L;
            for (var i = 1; i < A.Length; i++)
            {
                if (A[i] <= A[i - 1])
                {
                    var dif = A[i - 1] - A[i];
                    A[i] = A[i - 1];
                    answer += dif;
                }
            }
            Console.WriteLine(answer);
        }

        public static class Scanner
        {
            private static Queue<string> queue = new Queue<string>();
            public static T Next<T>()
            {
                if (!queue.Any()) foreach (var item in Console.ReadLine().Trim().Split(" ")) queue.Enqueue(item);
                return (T)Convert.ChangeType(queue.Dequeue(), typeof(T));
            }
            public static T Scan<T>() => Next<T>();
            public static (T1, T2) Scan<T1, T2>() => (Next<T1>(), Next<T2>());
            public static (T1, T2, T3) Scan<T1, T2, T3>() => (Next<T1>(), Next<T2>(), Next<T3>());
            public static (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>());
            public static (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>(), Next<T5>());
        }
    }
}


Measured memory_bytes: 47344
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using llu=unsigned long long;
#define mod 1000000007
#define mode 998244353
#define PI 3.14159265358979323846
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mms(x,y) memset(x,y,sizeof(x))
#define pqm priority_queue<ll,vector<ll>,greater<ll>>
#define pb push_back
#define um unordered_map
#define pr pair
#define mm multimap
#define ms multiset
#define mp make_pair
#define vr vector
#define pq priority_queue
#define lb lower_bound
#define ub upper_bound
#define inf INT_MAX
#define ninf INT_MIN
#define ff first
#define ss second
#define gcd __gcd
int main()
{
    fast;
    ll t,n,m,i,j,k;
    cin>>n>>k;
    ll a[n];
    for(i=0;i<n;i++)cin>>a[i];
    ll dp[n];
    for(i=1;i<n;i++)dp[i]=inf;
    dp[0]=0;
    for(i=1;i<n;i++)
    {
        for(j=1;j<=k;j++)
        {
            if(i-j>=0)
            {
                dp[i]=min(dp[i],dp[i-j]+abs(a[i]-a[i-j]));
            }
        }
    }
    cout<<dp[n-1];
}


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

int main() {
  int M;
  cin >> M;
  cout << 48 - M << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,s,e) for(int i=(s); i<(e);i++)
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n)
#define repe(i,n) for(auto &&i:n)
#define all(v) (v).begin(),(v).end()
#define decimal fixed<<setprecision(20)
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)
using namespace std;
using LL = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 1e9;
const LL LLINF = 1e16;


int main(){
    fastcin();
    int n, k;
    cin >> n >> k;
    vector<int> p(n);
    rep(i, n) cin >> p[i];
    vector<double> d(n);
    rep(i, n) d[i] = 1.*(p[i]+1.)/2.;

    double tmp = 0.;
    rep(i, k){
        tmp += d[i];
    }
    double ans = tmp;
    REP(i, k, n){
        tmp -= d[i-k];
        tmp += d[i];
        chmax(ans, tmp);
    }
    cout << decimal << ans << endl;


}

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

using namespace std;

typedef long long ll;

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

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

    vector<int> L(N);
    for (int i = 0; i < N; i++) {
        cin >> L[i];
    }
    sort(L.begin(), L.end());

    ll acc = 0;
    const int len = (int) L.size();
    for (int i = 0; i < len - 1; i++) {
        acc += L[i];
    }

    if (acc > L[len - 1]) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
 int main(){
     int a[3];
     scanf("%d %d %d", &a[0],&a[1],&a[2]);
     int flag5,flag7;
     flag5 = 0;
     flag7 = 0;
     for(int i=0;i < 3;i++){
         if(a[i] == 5){
             flag5++;
         }
         else if(a[i] == 7){
             flag7++;
         }
     }
     if(flag5==2 && flag7 == 1){
         printf("YES\n");
     }
     else{
         printf("NO\n");
     }
 }


Measured memory_bytes: 128
/*
g++ -std=c++14 -O2 -Wall a.cpp -o a && a
*/

//  io
#include <iostream>
//#include <fstream> //http://www.cplusplus.com/reference/fstream/fstream/
//#include <cstdio>
#include <iomanip> //http://www.cplusplus.com/reference/iomanip/
#include <limits>
//  util
#include <string>
#include <cstring>
#include <algorithm>
//#include <utility>
//#include <functional> //http://www.cplusplus.com/reference/functional/
//#include <cstdlib>
//#include <cmath>
//#include <complex>
//#include <random>
//#include <bitset>
//  containers https://en.cppreference.com/w/cpp/container
#include <vector>
//#include <queue>
//#include <set>
//#include <map>
//#include <unordered_set>
//#include <unordered_map>
//  time
//#include <ctime>
//#include <chrono>
//                  https://en.cppreference.com/w/cpp/header/chrono
//                  http://www.cplusplus.com/reference/chrono/

using namespace std;
typedef vector<int> arri;
typedef vector<float> arrf;
typedef pair<int, int> pairi;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 0x7fffffffffffffff;
const ll infneg = -0x7fffffffffffffff;

//int modadd(int a, int b) { return ((a += b) < mod) ? a : (a - mod); }
//int modmult(int a, int b) { return (int)((a * b) % mod) }

//file input routed to stdinout
/*
std::ifstream inFile("input.txt");
std::ofstream outFile("output.txt");
std::cin.rdbuf(inFile.rdbuf());
std::cout.rdbuf(outFile.rdbuf());
*/

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

    int n;
    cin >> n;
    vector<ld> ingred(n);
    for (int i = 0; i < n; i++)
    {
        cin >> ingred[i];
    }
    sort(ingred.begin(), ingred.end());

    while (ingred.size() != 1)
    {
        ld avg = (ingred[0] + ingred[1]) / 2;
        ingred.erase(ingred.begin(), ingred.begin() + 2);
        ingred.push_back(avg);
        sort(ingred.begin(), ingred.end());
    }
    cout << setprecision(std::numeric_limits<long double>::digits10 + 1) << ingred[0];
}


Measured memory_bytes: 256
n,m=map(int, input().split())
l=list(map(int, input().split()))
l1=[]
s=sum(l)
num=1/(4*m)
c=0
for i in l:
    l1.append(i/s)
for i in l1:
    if i>=num:
        c=c+1
if c>=m:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3060
import math
N,A,B = map(int,input().split())
H = [int(input()) for _ in range(N)]


def enough(T):
    temp = 0
    ch = H[:]
    for h in ch:
        left = h - B*T
        if left > 0:
            #temp += (left + A-B+1)//(A-B)
            temp += math.ceil(left/(A-B))
            #print(temp)

    if temp > T:
        return False
    else:
        return True

#print(enough(2))
ok = 10**15
ng = 0

while ok - ng > 1:
    mid = (ok + ng)//2
    if enough(mid):
        ok = mid
    else:
        ng = mid
    #print(ok,ng)
print(ok)

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

using namespace std;

using ll = long long;

#define ALL(A) A.begin(),A.end()

const double PI=3.14159;

int main()
{
    double N;
    cin >> N;
    
    cout << N * 2.0 * PI << endl;

    return 0;
}

Measured memory_bytes: 3784
fun main(args: Array<String>) {
    val (a, b) = readInputLine().split(" ").map{it.toInt()}
    
    if (a > 8 || b > 8) {
        println(":(")
    } else {
        println("Yay!")
    }
}

fun readInputLine(): String {
    return readLine()!!
}


Measured memory_bytes: 36004
#include<bits/stdc++.h>
using namespace std;
#define int long long
struct SA{
  int n,k;
  string S;
  vector<int> r,r2,t,sa;
  SA(){}
  SA(string S):S(S){init();}
  void init(){
    n=S.size();
    r.resize(n+1,0);
    r2.resize(n+1,0);
    t.resize(n+1,0);
    sa.resize(n+1,0);
    constract_sa();
  }
  bool compare_sa(int i,int j){
    if(r[i]!=r[j]) return r[i]<r[j];
    else{
      int ri=i+k<=n?r[i+k]:-1;
      int rj=j+k<=n?r[j+k]:-1;
      return ri<rj;
    }
  }
  void constract_sa(){
    n=S.length();
    for(int i=0;i<=n;i++){
      sa[i]=i;
      r[i]=i<n?S[i]:-1;
    }
    for(k=1;k<=n;k*=2){
      sort(sa.begin(),sa.end(),[&](const int &i, const int &j){
	  if(r[i]!=r[j]) return r[i]<r[j];
	  else{
	    int ri=i+k<=n?r[i+k]:-1;
	    int rj=j+k<=n?r[j+k]:-1;
	    return ri<rj;
	  }
	});
      t[sa[0]]=0;
      for(int i=1;i<=n;i++){
	t[sa[i]]=t[sa[i-1]]+(compare_sa(sa[i-1],sa[i])?1:0);
      }
      for(int i=0;i<=n;i++){
	r[i]=t[i];
      }
    }
  }
  bool contains(string T){
    int a=0,b=S.length()+1;
    while(a+1<b){
      int c=(a+b)/2;
      //cout<<a<<" "<<b<<" "<<c<<endl;
      if(S.compare(sa[c],T.length(),T)<0) a=c;
      else b=c;
    }
    if(b==(int)S.length()+1) b--;
    return S.compare(sa[b],T.length(),T)==0;
  }
};
char buf[1000001];
signed main(){
  scanf("%s",buf);
  string T(buf);
  SA sa(T);
  int q;
  scanf("%lld",&q);
  while(q--){
    scanf("%s",buf);
    string P(buf);
    printf("%lld\n",(int)sa.contains(P));
  }
  return 0;
}

Measured memory_bytes: 37172
function judge(n)
	for i = 2, math.sqrt(n) do
    	if n % i == 0 then
      		return false
      	end
    end
  return true
end

n = tonumber(io.read())

for i = n, n + 10000 do
  	if judge(i) then
    	print(i)
    	break
    end
end

Measured memory_bytes: 1008
#include <iostream>
#include <iomanip>
#include <ios> 
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <map>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

using namespace std;
typedef long long int lli;
typedef vector<int> vi;
const int MAX=1e5+5;
const int MOD=1e9+7;
int adm(int a,int b){
	return (a+b)%MOD;
}
int mnm(int a,int b){
	return (a+MOD-b)%MOD;
}


//d[j]はそれまでの人にj個配る場合の数
//s[j]はその補助
int d[MAX],s[MAX];

int main(){
	int N,K;
	cin>>N>>K;
	
	d[0]=1;
	rep1(i,N){
		int a;
		cin>>a;
		
		s[0]=d[0];
		rep1(i,K)s[i]=adm(s[i-1],d[i]);
		
		rep1(i,K){
			d[i]=s[i];
			if(i>=a+1)d[i]=mnm(d[i],s[i-a-1]);
		}
	}
	cout<<d[K];
	
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
typedef long long int ll;

#define PI (acos(-1))
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define dumparr(x) cerr << #x ; for(auto elem: x){cerr << " " << elem;} cerr << endl;
#define dumppairs(x) cerr << #x ; for(auto elem: x){cerr << "(" << elem.first << " " << elem.second << ") ";} cerr << endl;
#define dumpline cerr << "**********************" << endl;
#define dumpwline(x) cerr << "******** " << #x << "=" << (x) << " ********" << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

int main(void){
    ll a; ll v; cin >> a >> v;
    ll b; ll w; cin >> b >> w;
    ll t; cin >> t;
    string res = "YES";
    if (abs(a-b) > t*(v-w)){
        res = "NO";
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 3580
n = int(input())
A = list(map(int, input().split())) 

Asort = sorted(A)

min_ans = Asort[n//2-1]
max_ans = Asort[n//2]

if (min_ans == max_ans):
    for a in A:
        print(min_ans)
else:
    for a in A:
        if (min_ans >= a):
            print(max_ans)
        else:
            print(min_ans)

Measured memory_bytes: 25220
#include <iostream>
#include <vector>
#include <numeric>
#include <cmath>
#include <bitset>
 
using namespace std;
using ll = long long;
 
int main() {
  ll n, k;
  cin >> n >> k;
  vector<ll> vec(n);
  for (auto &v : vec)
    cin >> v;
 
  ll x_best = 0;
  ll score_best = accumulate(vec.begin(), vec.end(), 0LL);
  for (ll i = 63LL; 0LL <= i; --i) {
    bitset<64> bset = x_best;
    bset.set(i);
    ll x = bset.to_ulong();
    if (k < x)
      continue;
    ll score = 0;
    for (auto &v : vec)
      score += x ^ v;
    if (score_best < score) {
      score_best = score;
      x_best = x;
    }
  }
  cout << score_best << endl;
}


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

using namespace std;

int main() {
  string S, T;
  cin >> S >> T;

  size_t A, B;
  cin >> A >> B;

  string U;
  cin >> U;

  if (S == U) {
    cout << A-1 << " " << B << endl;
  } else {
    cout << A << " " << B-1 << endl;
  }

  return 0;
}


Measured memory_bytes: 256
S = input()
N = len(S)
i = 0
while N-i >4:
    if S[N-i-5:N-i] == "dream":
        i+=5
    elif N-i>6 and S[N-i-7:N-i]=="dreamer":
        i+=7
    elif S[N-i-5:N-i] == "erase":
        i += 5
    elif N-i>5 and S[N-i-6:N-i] =="eraser":
        i+=6
    else:
        break

if N == i:
    print("YES")
else:
    print("NO")

Measured memory_bytes: 68472
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <unordered_map>
    
using namespace std;

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    long long int a,b,k;
  int flag=0;
  cin>>a>>b>>k;
  if(a>=0 && a<=pow(10,12) && b>=0 && b<=pow(10,12) && k>=0 && k<=pow(10,12))
  {
    if(k>a)
    {
      k-=a;
        a=0;
    }
    else if( a>=k)
    {
      a-=k; k=0;
    }
   
      cout<<a<<" "<<((long long int)max((b-k),(long long int)0));
   
  }
  else
  {
    cout<<0<<" "<<0<<endl;
  }
  return 0;
}
    

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

long long int m=1e9 + 7;
long long int dp[2005];

long long int fun(long long int s)
{
    if(s==0)
    return 1;
    if(s<0)
    return 0;
    if(dp[s]!=-1)
    return dp[s];
    long long int temp=0;
    for(long long int i=3;i<=s;i++)
    {
        temp=(temp+fun(s-i))%m; 
    }
    dp[s]=temp;
    return dp[s];
}
 
int main()
{
    long long int s;
    cin>>s;
    memset(dp,-1,sizeof(dp));
    cout<<fun(s);
}
    

Measured memory_bytes: 3576
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll INF=20000000000000000;
 
struct edge{ll to, cost;};
typedef pair<ll,ll> P;
struct graph{
  ll V;  vector<vector<edge>> G;  vector<ll> d;

  graph(ll n){init(n);}

  void init(ll n){
    V = n;  G.resize(V);  d.resize(V);
    for(int i=0;i<V;i++){d[i] = INF;}
  }

  void add_edge(ll s, ll t, ll cost){
    edge e;  e.to = t, e.cost = cost;
    G[s].push_back(e);
  }

  void dijkstra(ll s){
    for(int i=0;i<V;i++){d[i] = INF;}
    d[s] = 0;
    priority_queue<P,vector<P>, greater<P> > que;
    que.push(P(0,s));
    while(!que.empty()){
      P p = que.top(); que.pop();
      ll v = p.second;
      if(d[v]<p.first) continue;
      for(auto e : G[v]){
        if(d[e.to]>d[v]+e.cost){
          d[e.to] = d[v]+e.cost;
          que.push(P(d[e.to],e.to));
        }
      }
    }
  }
};

int main(){
  int N,Q,K;
  cin >> N;
  vector<long long> a(N+10),b(N+10),c(N+10);
  for(int i=0;i<N-1;i++)cin >> a[i] >> b[i] >> c[i];
  cin >> Q >> K;
  vector<long long> x(Q+10),y(Q+10);
  for(int i=0;i<Q;i++)cin >> x[i] >> y[i];
  
  graph g1(N+100); 
  for(int i=0;i<N-1;i++){g1.add_edge(a[i]-1,b[i]-1,c[i]); g1.add_edge(b[i]-1,a[i]-1,c[i]);}
  g1.dijkstra(K-1);  ll ans=0;
  for(int i=0;i<Q;i++){
    cout << g1.d[x[i]-1]+g1.d[y[i]-1] << endl;
  }
}   

Measured memory_bytes: 15088
# coding: utf-8


def get_ans(num: int):
    if num < 105:
        return 0
    ans = 0
    for i in range(105, num + 1):
        if i % 2 == 0:
            continue
        if cnt_yaku(i):
            ans += 1
    return ans


def cnt_yaku(num: int):
    ans = 0
    for i in range(1, num + 1):
        if num % i == 0:
            ans += 1
    return ans == 8


num = int(input())
ans = get_ans(num)
print(ans)


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

int main()
{
	int n, b, f, r, v, c[4][3][10] = {};

	cin >> n;

	for (n; n > 0; n--) {
		cin >> b >> f >> r >> v;
		c[b - 1][f - 1][r - 1] += v;
	}

	for (int i = 0; i < 4; i++) {
		for (int j = 0; j < 3; j++) {
			for (int k = 0; k < 10; k++) {
				cout << " " << c[i][j][k];
			}
			cout << endl;
		}
		if (i < 3) cout << "####################" << endl;
	}

	return 0;
}

Measured memory_bytes: 1164
#include <numeric>
#include<iostream>
#include<set>
#include<queue>
#include<vector>
#include<map>
#include<stack>
#include <cstdio>
#include<algorithm>
#include <sstream>
#include<string>
#include <cmath>
#include <iomanip>
#include <string>
#include<list>
using namespace std;
#define inf 1000000007
#define int long long
#define rep(i,j,n) for(int i=j;i<n;i++)
typedef pair<int,int>  P;
struct edge{int to,cost;};
double pi = 3.141592653589793;
//使うやつはここから下に置こうな
struct kl{int a,b,c;
    bool operator<(const kl& another) const {
         if (b != another.b)
        return b > another.b; // 同様に比較演算子を反転   
    if (a != another.a)
        return a < another.a; // 高い順に並べたいので演算子を逆に

    return c < another.c;
}};
signed main(){
    int n;cin>>n;
    int a[114514],b[114514];
    vector<kl> num;
    vector<int>v;
    int ans=0;
    bool key=true;
    int h=0;
    rep(i,0,n){
        cin>>a[i]>>b[i];
        if(a[i]!=b[i])key=false;
        if(a[i]<=b[i]){
            ans+=a[i];
            h+=b[i]-a[i];
        }
        else {
            ans+=a[i];
            v.push_back(b[i]);
        }
    }
    sort(v.begin(),v.end());
    if(key)cout<<0<<endl;
    else cout<<ans-v[0]<<endl;
    return 0;
}


Measured memory_bytes: 768
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtTest.Virtual
{
    class AGC008_B
    {
        static void Main(string[] args)
        {
            Method(args);
            ReadLine();
        }

        static void Method(string[] args)
        {
            int[] nk = ReadInts();
            int n = nk[0];
            int k = nk[1];
            long[] array = ReadLongs();
            long[] sums = new long[n];
            sums[0] = array[0];
            long[] plusSums = new long[n];
            if (array[0] > 0) plusSums[0] = array[0];
            for (int i = 1; i < n; i++)
            {
                sums[i] = sums[i - 1] + array[i];
                plusSums[i] = plusSums[i - 1];
                if (array[i] > 0) plusSums[i] += array[i];
            }
            long res = 0;
            for(int i = k - 1; i < n; i++)
            {
                long val = plusSums[n - 1] - plusSums[i];
                long range = sums[i];
                if (i - k >= 0)
                {
                    val += plusSums[i - k];
                    range -= sums[i - k];
                }
                range = Max(0, range);
                res = Max(res, val + range);
            }
            WriteLine(res);
        }

        private static string Read() { return ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


Measured memory_bytes: 30812
x,n = map(int, input().split())
p = list(map(int, input().split()))

if len(p)==0:
    print(x)
    exit()

for i in range(100):
    a = x+i
    b = x-i
    if p.count(b)==0:
        print(b)
        exit()
    elif p.count(a)==0:
        print(a)
        exit()


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

namespace AtCoder.Abcdef
{
    public class QuestionB
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            //Input string
            string s = Console.ReadLine();
            string t = Console.ReadLine();

            var ans = int.MaxValue;
            var diff = s.Length - t.Length;
            for (int i = 0; i <= diff; i++)
            {
                var flags = new bool[t.Length];
                for (int j = 0; j < t.Length; j++)
                {
                    if (s[j + i] != t[j]) flags[j] = true;
                }
                ans = Math.Min(ans, flags.Where(item => item).Count());
            }

            Console.WriteLine(ans);

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 26704
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <math.h> // sort

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;

int main(){
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());
    ll n,m;
    cin >> n >> m;
    --n;--m;
    ll res = n*m;

    cout << res << endl;
    return 0;    
}



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

int main() {
  int N;
  cin >> N;
  double A[N];

  rep(i, N) { cin >> A[i]; }

  double mo;
  for (int i = 0; i < N; i++) {
    mo += (double)(1 / A[i]);
  }

  cout << double(1 / mo) << endl;

  return 0;
}

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

#define PB push_back

int cnt[100100];

main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        int a;
        scanf("%d",&a);
        cnt[a]++;
    }
    int ans=0;
    int two=0;
    for(int i=1;i<=100000;i++)
    {
        if(cnt[i]>0)
        {
            if(cnt[i]%2==0)
                two++;
            else
                ans++;
        }
    }
    ans+=two;
    if(two%2==1)ans--;
    printf("%d\n",ans);
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const string ln = "\n";
constexpr int INF = 1001001001;
constexpr int MOD = 1000000007;

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

  int a, b;
  cin >> a >> b;

  int rect = a * b;
  int circ = (a + b) * 2;

  cout << rect << " " << circ << ln;

  return 0;
}


Measured memory_bytes: 3152
#include<stdio.h>
int main(void){
    int con[100];
    int i,a,b,city,road;
    for(i=0;i<100;i++)con[i]=0;
    scanf("%d %d",&city,&road);
    for(i=0;i<road;i++){
        scanf("%d %d",&a,&b);
        con[a]++;
        con[b]++;
    }
    for(i=1;i<=city;i++){
        printf("%d\n",con[i]);
    }
    return 0;
}



Measured memory_bytes: 128
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
total = B[A[0]-1]
for i in range(1,N):
  dish = A[i]
  score = B[dish-1]
  before = A[i-1]
  if dish == before + 1:
    score += C[before-1]
  total += score
print(total)
  

Measured memory_bytes: 9180
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;

#define abs(N) ((N>0)?N:-1*N)
#define min(A,B) ((A>B)?B:A)
#define max(A,B) ((A<B)?B:A)
#define print(S) (cout << S)
#define println(S) (cout << S << endl)

int main() {
	int H,W;
	while(true){
		cin >> H >> W;
		if(H==0 && W == 0){
			break;
		}
		for (int i = 0; i < H; ++i) {
			for (int j = 0; j < W; ++j) {
				string s = ((i+j)%2!=0) ? ".":"#";
				print(s);
			}
			println("");
		}
		println("");
	}

	return 0;
}



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

#define mk make_pair
#define pb push_back

typedef long long lld;
typedef pair<lld,lld> pr;
typedef priority_queue <lld> max_heap;
typedef priority_queue <lld, vector<lld>, greater<lld> > min_heap;
lld const mod = 1e9+7;

lld power(lld x, lld y)
{
    lld res = 1;
    while (y > 0) {
        if (y & 1)
            res = res * x;
        y = y >> 1;
        x = x * x;
    }
    return res;
}

lld power_mod(lld base, lld y)
{
    lld t = 1;
    while (y > 0)
    {

        if (y % 2 != 0)
            t = (t * base) % mod;
        base = (base * base) % mod;
        y /= 2;
    }
    return t % mod;
}

lld nCrModp(lld n, lld r, lld p)
{
    if (r > n - r)
        r = n - r;
    lld C[r + 1]={0};
    C[0] = 1;

    for (lld i = 1; i <= n; i++)
    {
      for (lld j = min(i, r); j > 0; j--)
      {
        C[j] = (C[j] + C[j - 1]) % p;

      }
    }
    return C[r];
}

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  char ch;
  cin>>ch;
  if(ch>='a' && ch<='z')
  {
    cout<<'a'<<endl;
  }
  else if(ch>='A' && ch<='Z')
  {
    cout<<'A'<<endl;
  }

}


Measured memory_bytes: 3636
'use strict'

function main(input) {
  input = input.split(' ').map(V => ~~V)
  const a = input[0] //aの倍数
  const b = input[1] //bで割る
  const c = input[2] //割った余り

  let i = 0
  while (i <= a * b) {
    if ((i * a) % b == c) {
      console.log('YES')
      return
    }
    // console.log(i)

    i++
  }
  console.log('NO')
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 11468
import java.util.Scanner;

public class Main {
    private static boolean solve(String S, String Q) {
        int slen = S.length();
        int qlen = Q.length();

        for(int i = 0; i < qlen + 1; i++) {
            String spre = S.substring(0, i);
            String qpre = Q.substring(0, i);

            if (!spre.equals(qpre)) continue;

            String ssuf = S.substring(slen - (qlen - i), slen);
            String qsuf = Q.substring(i, qlen);

            if (ssuf.equals(qsuf)) {
                return true;
            }
        }

        return false;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        final String Q = "keyence";

        if (solve(S, Q)) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}


Measured memory_bytes: 23124
#include <stdio.h> 
 
 

 int main(){ 
     char number[1001]; 
     int i, sum; 
     while(1){ 
         scanf("%s", number); 
         if(number[0]=='0')break; 
         sum=0; 
         for(i=0;number[i]!='\0';i++){ 
             sum+=number[i]-'0'; 
         } 
         printf("%d\n", sum); 
     } 
 
 
     return 0; 
 } 



Measured memory_bytes: 2144
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
const long long INF = 1LL << 60;
typedef pair<int, int> P;

vector<vector<char>> maze;
int memo[101][101];
int H, W;
int nax = 1e9;

void bfs(int x, int y, int cnt, char block) {
    int nextc = cnt;
    char nowb = maze[y][x];
    if (x >= W || y >= H) return ;
    if (maze[y][x] == '#' && block == '.') {
        nextc++;
    }
    if (memo[y][x] <= nextc) return ;
    else memo[y][x] = nextc;
    if (x == W - 1 && y == H - 1) chmin(nax, nextc);
    bfs(x + 1, y, nextc, nowb);
    bfs(x, y + 1, nextc, nowb);
}

int main()
{
    cin >> H >> W;
    maze = vector<vector<char>>(H, vector<char>(W));

    rep(i, H) {
        rep(j, W) {
            memo[i][j] = 1e9;
            cin >> maze[i][j];
        }
    }

    bfs(0, 0, 0, '.');

    cout << nax << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
const ll C = 1e9+7;

int main() {
    string num;
    cin >> num;
    int a = num[0]-'0', b = num[1]-'0', c = num[2]-'0', d = num[3] - '0';

    if(a + b + c + d == 7) cout << a << "+"<<b<<"+"<<c<<"+" << d << "=7" << endl;
    else if(a - b + c + d == 7) cout << a << "-"<<b<<"+"<<c<<"+" << d << "=7" << endl;
    else if(a + b - c + d == 7) cout << a << "+"<<b<<"-"<<c<<"+" << d << "=7" << endl;
    else if(a + b + c - d == 7) cout << a << "+"<<b<<"+"<<c<<"-" << d << "=7" << endl;
    else if(a - b - c + d == 7) cout << a << "-"<<b<<"-"<<c<<"+" << d << "=7" << endl;
    else if(a - b + c - d == 7) cout << a << "-"<<b<<"+"<<c<<"-" << d << "=7" << endl;
    else if(a + b - c - d == 7) cout << a << "+"<<b<<"-"<<c<<"-" << d << "=7" << endl;
    else if(a - b - c - d == 7) cout << a << "-"<<b<<"-"<<c<<"-" << d << "=7" << endl;
}

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

int main(){
  int s;
  string a;
  cin >> s >> a;
  if(s >= 3200) {
    cout << a << endl;
  }
  else cout << "red" << endl;
  return 0;
}

Measured memory_bytes: 256