akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int d[] =new int[N];
    for(int i=0;i<N;i++){
      d[i]=sc.nextInt();}
    Arrays.sort(d);
    int s =N/2;
    System.out.println(d[s]-d[s-1]);
  }
}

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

int main()
{
  std::string s, t;
  std::cin >> s >> t;
  int len = s.size();
  int can1, k;
  std::string ans = "No";
  for (int i=0; i<len; i++){
    can1=0;
    for (int j=0; j<len; j++){
      k = (i+j < len) ? i+j : i+j-len;
      if(s[k] != t[j])  break;
      else can1++;
    }
    if (can1==len) {
      ans="Yes";
      break;
    }
  }
  std::cout << ans << '\n';
}


Measured memory_bytes: 256
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
	int ans = INF;
	int tmp;
	int a, b, c;
	cin >> a >> b >> c;
	int x, y;
	cin >> x >> y;
	int mi = max(x, y);
	for(int i = 0; i <= mi; i++){
		ans = min(ans, c * i * 2 + a * max(0, x - i) + b * max(0, y - i));
	}

	cout << ans << endl;
}

Measured memory_bytes: 256
#pragma comment(linker,"/stack:16777216")
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<functional>
#include<utility>
#include<algorithm>
#include<sstream>
#include<cstring>
#include<cmath>
#include<cctype>
#include<exception>
#include<climits>
#include<cfloat>
#include<iomanip>
#include<bitset>
#include<streambuf>
#include<cstdlib>
#include<ctime>
//#include"functions.h"
//#include"highprecision.h"
#define pb push_back
#define pf push_front
#define ppb pop_back
#define mp make_pair
#define np next_permutation
#define fi first
#define sc second
#define vi vector<int>
#define vll vector<long long>
#define vvi vector<vector<int> >
#define vpi vector<pair<int,int> >
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pff pair<float,float>
#define pdd pair<double,double>
#define psi pair<string,int>
#define pis pair<int,string>
#define ppi pair<pii,int>
#define pdi pair<pii,pii>
#define LN 84757
#define INF 1e9
#define LLINF 1e18
#define MAXINT 0x7fffffff
#define MAXLL 0x7fffffffffffffff
#define EPS 1e-5
#define DEPS 1e-9
#define LDEPS 1e-13
#define MOD 1000000007
#define E 2.7182818284
#define PI 3.1415926535
#define rep(a,b) for(int a=0;a<b;a++)
#define rep(a,b) for(int a=0;a<b;a++)
#define forn(a,n) for(int a=1;a<=n;a++)
#define forr(a,n) for(int a=n;a>=1;a--)
#define repn(a,n,p) for(int a=0;a<n;a+=p)
#define repr(a,n) for(int a=n-1;a>=0;a--)
#define foreach(a,b) for(__typeof(b.begin())a=b.begin();a!=b.end();a++)
#define fillemp(a) memset(a,0,sizeof(a))
#define fillinf(a) memset(a,0x3f,sizeof(a))
#define frestream freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define stdf(a,b) freopen(a,"r",stdin);freopen(b,"w",stdout);
#define inputf(a) freopen(a,"r",stdin);
#define outputf(a) freopen(a,"w",stdout);
#define sz(a) a.size()
#define all(a) a.begin(),a.end()
#define MOD 1000000007
typedef long long ll;
typedef long double ld;
using namespace std;

int n,m,cnt;
int low[500010],dep[500010];
vector<int> g[500010];
bool vis[500010];
void dfs(int v,int f,int d){
	vis[v]=1;
	dep[v]=d;
	low[v]=d;
	for(auto to:g[v]){
		if(to==f)continue;
		if(!vis[to]){
			dfs(to,v,d+1);
			low[v]=min(low[v],low[to]);
		}
		else{
			low[v]=min(low[v],dep[to]);
		}
	}
	if(low[v]==dep[v]&&dep[v]){
		cnt++;
	}
}
int main(int argc,char** argv){
	cin>>n>>m;
	rep(i,m){
		int a,b;
		cin>>a>>b;
		a--;b--;
		g[a].pb(b);
		g[b].pb(a);
	}
	dfs(0,-1,0);
	cout<<cnt<<endl;
	return 0;
}

Measured memory_bytes: 15364
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int x,y,z,temp;
  cin>>x>>y>>z;
  temp=y;
  y=x;
  x=temp;
  temp=z;
  z=x;
  x=temp;
  cout<<x<<" "<<y<<" "<<z;
  return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;

int main() {
  ll n;
  cin >> n;

  vector<ll> p(n);
  for (ll i = 0; i < n; ++i) {
    cin >> p[i];
    p[i]--;
  }

  bool ok = true;
  ll cur = 0;
  stack<ll> stack;
  stringstream ss;
  for (ll i = 0; i < n; ++i) {
    for (; cur <= p[i]; ++cur) {
      ss << "(";
      stack.push(cur);
    }

    if (stack.top() != p[i]) {
      ok = false;
      break;
    }

    ss << ")";
    stack.pop();
  }

  if (ok) {
    cout << ss.str() << endl;
  } else {
    cout << ":(" << endl;
  }

  return 0;
}


Measured memory_bytes: 4436
#include<stdio.h>
#include<math.h>

int main(){
  int X, Y, max = 0, p;
  
  scanf("%d", &X);
  Y = sqrt(X);
  for (int i = 1; i <= Y; i++){
    p = i;
    for(int j = 1; j < 10; j++){
      p *= i;
      if(p <= X && max < p){
        max = p;
      }
    }
  }
  
  printf("%d\n", max);
  
  return 0;
}

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

namespace _054_SumofNthdecimalplaces
{
	class Program
	{
		static void Main ( string[] args )
		{
			string inputStr;

			while ((inputStr = Console.ReadLine ()) != null)
			{
				int[] inputNum = inputStr.Split (' ').Select (int.Parse).ToArray ();

				int sum = 0;
				decimal fraction = inputNum[0] * 1.0m / inputNum[1];

				//??´??°??¨???????????????
				if (1.0m <= fraction)
				{
					int integer = decimal.ToInt32 (fraction);
					fraction -= integer;
				}

				//?°???°??????????±???????
				for (int lp = 0; lp < inputNum[2]; lp++)
				{
					fraction *= 10;
					int integer = decimal.ToInt32 (fraction);
					sum += integer;
					
					fraction -= integer;
				}

				Console.WriteLine (sum);
			}
		}
	}
}

Measured memory_bytes: 9436
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<functional>

using namespace std;

int t[101];

main(){
  int n,pm,tm;
  int nowc,nowm;
  int piza;
  int cmax=0;
  scanf("%d",&n);
  scanf("%d %d",&pm,&tm);
  scanf("%d",&piza);
  for(int i=0;i<n;i++) scanf("%d",&t[i]);
  sort(t,t+n,greater<int>());
  nowc=piza;
  nowm=pm;
  cmax=nowc/nowm;
  for(int i=0;i<n;i++){
    nowc+=t[i];
    nowm+=tm;
    cmax=max(cmax,nowc/nowm);
    //    printf("%d/%d=%d\n",nowc,nowm,cmax);
  }
  printf("%d\n",cmax);
}

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

#define INCANT cin.tie(0), ios::sync_with_stdio(false), cout << fixed << setprecision(20)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
#define all(x) (x).begin(),(x).end()
#define out(a) cout << a << endl
#define PRINT(V) for (auto v : (V)) cout << v << " "

const int MOD = 1000000007;
const double PI = acos(-1.0);

void solve() {
    ll N, X, Y;
    cin >> N >> X >> Y;
    X = X-1;
    Y = Y-1;
    vector<ll> ans(N, 0);
    rep(i, N-1){
        FOR(j, i+1, N){
            ans.at(min(ll(j-i), abs(X-i)+1+abs(Y-j))) += 1;
        }
    }
    FOR(i, 1, N) out(ans.at(i));
}
int main() {
    INCANT;
    solve();
    return 0;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ctime>
#define ll long long
using namespace std;
const int maxn=3e5+5;
string s;
int sume[maxn],sumw[maxn];
int main(){
	srand((unsigned)time(0));
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	string s;
	cin>>s;
	s="#"+s;
	for (int i=1;i<=n;i++){
		if (s[i]=='E'){
			sume[i]=sume[i-1]+1;
			sumw[i]=sumw[i-1];
		}else{
			sume[i]=sume[i-1];
			sumw[i]=sumw[i-1]+1;
		}
	}
	ll ans=1e9;
	for (int i=1;i<=n;i++){
		ll a=sumw[i-1];
		ll b=sume[n]-sume[i];
		ans=min(ans,a+b);
	}
	cout<<ans<<endl;
	
}

Measured memory_bytes: 3056
#include<iostream>
#include<utility>
#include<vector>
using namespace std;

const int MAXV=51;
int G[MAXV][MAXV]={};
int visited[MAXV];

bool search_exceptAB(int n, int start, int goal, int a, int b){
    visited[start]=true;
    if( start==goal ){
        return true;
    }
    for( int i=1; i<=n; i++ ){
        if( G[start][i]>0 ){
            if( start==a && i==b ) continue;
            if( start==b && i==a ) continue;

            if( !visited[i] ){
                if( search_exceptAB(n,i,goal,a,b) ){
                    //cout << "return true: start goal a b = " << i << " " << goal << " " << a << " " << b << endl;
                    return true;
                }else{
                    continue;
                }
            }
        }
    }

    return false;
}

int main(){
    int N,M;
    cin >> N >> M;
    int a,b,ans;
    vector < pair<int, int> > edge;
    for(int i=0; i<M; i++){
        cin >> a >> b;
        G[a][b]++;
        G[b][a]++;
        edge.push_back( make_pair(a,b) );
    }

    ans=0;
    for( auto x:edge ){
        a=x.first;
        b=x.second;
        for(int i=0; i<N+1; i++){
            visited[i]=false;
        }
        if( !search_exceptAB(N,a,b,a,b) ){
            //cout << "bridge: a b = " << a << " " << b << endl;
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

VVI C;
vector<vector<bool>> used;
int MH, MW;
int dh[] = {0, 0, -1, 1, -1, -1, 1, 1};
int dw[] = {-1, 1, 0, 0, -1, 1, -1, 1};
bool inside(int h, int w) {
    return 0 <= h && h < MH && 0 <= w && w < MW;
}
bool dfs(int h, int w) {
    if (used[h][w]) return false;
    used[h][w] = true;
    REP(i, 8) {
        int nh = h + dh[i], nw = w + dw[i];
        if (!inside(nh, nw)) continue;
        if (C[nh][nw] == 1) dfs(nh, nw);
    }
    return true;
}
void solve(int w, int h) {
    MH = h; MW = w;
    C.resize(h, VI(w));
    used.resize(h, vector<bool>(w, false));
    REP(i, h)REP(j, w) cin >> C[i][j];
    int cnt = 0;
    REP(i, h)REP(j, w) {
        if (C[i][j] == 1) cnt += dfs(i, j);
    }
    cout << cnt << endl;
    used.clear();
    C.clear();
    return;
}

int main(void) {
    int n, p, m, w, h;
    string s;
    int a, b, c;
    while (cin >> w >> h) {
        if (w == 0 && h == 0) return 0;
        solve(w, h);
        //return 0;
    }
}

Measured memory_bytes: 3116
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;

/* DEBUGGING */
void  __print(int x) {cerr << x;}
void  __print(long x) {cerr << x;}
void  __print(long long x) {cerr << x;}
void  __print(unsigned x) {cerr << x;}
void  __print(unsigned long x) {cerr << x;}
void  __print(unsigned long long x) {cerr << x;}
void  __print(float x) {cerr << x;}
void  __print(double x) {cerr << x;}
void  __print(long double x) {cerr << x;}
void  __print(char x) {cerr << '\'' << x << '\'';}
void  __print(const char *x) {cerr << '\"' << x << '\"';}
void  __print(const string &x) {cerr << '\"' << x << '\"';}
void  __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif

/* MACROS */ 
typedef unsigned long long int ll;
 
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

typedef map<int,int> mii;

#define  ff          first
#define  ss          second
#define  pb          push_back
#define  IOS         ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define  lb          lower_bound
#define  ub          upper_bound
#define  all(x)      (x).begin(), (x).end()
#define  ps(x,y)     fixed<<setprecision(y)<<x
#define  setbit(x)   __builtin_popcountll(x)
#define  rep(i,a,b)  for(int i=a ; i<b ; ++i)
#define  repr(i,a,b) for(int i=a ; i>=b ; --i)

/* CONSTANTS */ 
#define PI 3.141592653589793
const ll MOD = 1e9 + 7;
const ll INF = 1000000000;
const ll MAX_N = 2e5 + 2;

// #define cerr if(false)cerr
/* CODE STARTS HERE */

void solve(){
    int n; cin >> n;
    vi v(n);
    ll sum = 0;
    rep(i,0,n) cin >> v[i] , sum += v[i];
    for(int i=0;i<n-1;i+=2){
    	sum -= (2*v[i]);
    }
    vi ans(n);
    ans[n-1] = sum;
    repr(i,n-2,0){
    	ans[i] = 2*v[i] - ans[i+1];
    }
    rep(i,0,n) cout << ans[i] << " ";
}

int main(){
    IOS;
    solve();
}

Measured memory_bytes: 3992
#include <bits/stdc++.h>
using namespace std;
//17:25~

int main() {
  string S;
  cin >> S;
  bool ans=false;
  if(S[0]==S[1] && S[2]==S[3])ans=true;
  if(S[0]==S[2] && S[1]==S[3])ans=true;
  if(S[0]==S[3] && S[2]==S[1])ans=true;
  if(S[0]==S[1] && S[1]==S[2])ans=false;
  if(ans)cout << "Yes" << endl;
  else cout << "No" << endl;
}



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

int main() {
  int N, M;
  cin >> N >> M;
  
 int S = 0; 
  vector<int> A(M);
  for(int i = 0; i < M; i++) {
    cin >> A.at(i);
    S += A.at(i);
  }
  
  if(S > N) cout << -1 << endl;
  else cout << N - S << endl;
}

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

#define SZ(x) (((int)x.size()))

typedef long double ld;

using namespace std;

const int maxn = 60;
int n, a[maxn];
ld ans;

int main()
{
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	sort(a, a + n);
	ans = a[0];
	for (int i = 1; i < n; i++)
		ans = (ans + a[i]) / 2;
	cout << setprecision(12) << fixed << ans;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+1;
int n,k;
long long ans;
int main(){
    ios::sync_with_stdio(false);
    cin>>n>>k;
    for (int i=k;i<=n;i++){
        int x=n-i;
        int j=i+1;
        while (j<=n){
            int l;
            if (x/j==0)l=n;
            else
                l=x/((x/j));
            ans+=(x/j)*(l-j+1);
            j=l+1;
        }
        if (i)ans+=n-i;
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<string>

using namespace std;

int main() {

	int N,M;

	cin >> N >> M;

	
	int a = 0, b = 100001;

	for (int i = 0; i < M; i++) {
		int L, R;
		cin >> L >> R;

		a = max(a, L);
		b = min(b, R);
	}


	if (b < a) {
		cout << 0 << endl;
	}
	else {
		cout << b - a + 1 << endl;
	}

	return 0;
}

Measured memory_bytes: 384
/*ex7-3 B-Grid Compression
ryo_1129*/
#include <stdio.h>
#include <stdlib.h>

int main(void){
    int height,width,i,j;
    int *row,*col;
    char **pixel;

    //高さと幅の入力
    scanf("%d %d",&height,&width);

    //黒の含まれる行を記録する配列
    row =(int*)calloc(height,sizeof(int));
    if(row == NULL){
        exit(1);
    }

    //黒の含まれる列を記録する配列
    col = (int*)calloc(width,sizeof(int));
    if(col == NULL){
        exit(1);
    }

    //2次元配列
    pixel =(char**)calloc(height,sizeof(char*));
    if(pixel == NULL){
        exit(1);
    }
    for(i=0;i<height;i++){
        pixel[i] = (char*)calloc(width,sizeof(char));
        if(pixel[i]==NULL){
            exit(1);
        }
    }

    //初期化
    for(i=0;i < height;i++){
        row[i] = 0;
    }
    for(j=0;j < width;j++){
        col[j] = 0;
    }

    //マスの入力と黒を含む行、列を記録
    for(i=0;i < height;i++){
        for(j=0;j < width;j++){
            scanf(" %c",&pixel[i][j]);
            //1が黒を表す
            if(pixel[i][j] == '#'){
                row[i] = 1;
                col[j] = 1;
            }
        }
    }
    
    //マスを圧縮して出力する
    for(i=0;i < height;i++){
        //行、列に黒が含まれる場合のみ表示する
        if(row[i] == 1){
            for(j=0;j < width;j++){
                if(col[j] == 1){
                    printf("%c",pixel[i][j]);
                }
            }
            printf("\n");
        }
    }

    //メモリの開放
    free(row);
    free(col);
    for(i=0;i<height;i++){
        free(pixel[i]);
    }
    free(pixel);
    return 0;
}

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

int main(){
    string str;
    int hash[26];
    for(int i=0;i<26;i++){
        hash[i] = 0;
    }

    cin >> str;
    //cout << str.length() << endl;
    for(int i=0;i<str.length();i++){
        //printf("%d ",str[i]-'a');
        hash[str[i]-'a']++;
    }
    //cout << endl;
    for(int i=0;i<26;i++){
        //cout << hash[i] << " ";
        if(!hash[i]){
            printf("%c\n",i+'a');
            return 0;
        }
    }
    cout << "None\n";
    //cout << endl;

    //scanf("%[^\n]",str);
    //cout << str.length() << endl;
    //cout << str << endl;
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <queue>
#include <string>
#include <algorithm>
using namespace std;

int main(void) 
{
	int n, q, t;
	string name;
	queue< pair<string, int> > Q;
	cin >> n >> q;
	for (int i = 0; i < n; i++)
	{
		cin >> name >> t;
		Q.push(make_pair(name, t));
	}
	pair<string, int> temp;
	int time = 0;
	while (!Q.empty())
	{
		temp = Q.front();
		Q.pop();
		t = min(temp.second, q);
		time += t;
		temp.second -= t;
		if (temp.second > 0)
		{
			Q.push(temp);
		}
		else
		{
			cout << temp.first << " " << time << endl;
		}
	}
}


Measured memory_bytes: 6348
#include<iostream>
#include<vector>
#include <algorithm>
#include<cmath>
#include<iomanip>

using namespace std;

class P {
public:
	int x, y;
	P(int xx,int yy):x(xx),y(yy){}
	P():x(0),y(0){}
};


int main() {
	
	int N;
	cin >> N;
	
	vector<P> Pair;
	
	for (int i = 0; i < N; i++) {
		int x, y;
		cin >> x >> y;
		Pair.push_back(P(x, y));
	}

	vector<vector<double>> Dis(N,vector<double>(N));

	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			Dis[i][j] = sqrt((Pair[i].x - Pair[j].x) * (Pair[i].x - Pair[j].x) + (Pair[i].y - Pair[j].y) * (Pair[i].y - Pair[j].y));
		}
	}
	
	vector<int> Jyun(N);
	for (int i = 0; i < N; i++) {
		Jyun[i] = i + 1;
	}
	
	long double sub_ans = 0.0;
	
	do {
		for (int i = 0; i < N - 1; i++) {
			sub_ans += Dis[Jyun[i] - 1][Jyun[i + 1] - 1];
		}
	} while (next_permutation(Jyun.begin(), Jyun.end()));

	int sub = 1;
	for (int i = 1; i <= N; i++) {
		sub *= i;
	}

	cout << setprecision(100) << sub_ans / sub;

	return 0;
}


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

int main() {
	string s, t;
	cin >> s >> t;
	int c = 0;
	for(int i = 0; i < 3; i++) {
		if(s[i]==t[i]) c++;
	}
	cout << c;
	return 0;
}

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

vector<int> forintinput(int n) {
	vector<int> x;
	for(int i = 0;i < n;i++){
		int ia;
		cin >> ia;
		x.push_back(ia);
	}
	return x;
}
int main(){
	bool bad = false;
	string s;
	cin >> s;
	for(int i = 0;i < 3;i++){
		if(s[i] == s[i+1]) bad = true;
	}
	if(bad){
		cout << "Bad" << endl;
	}else{
		cout << "Good" << endl;
	}
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
using namespace std;

template<typename T>
ostream& operator << (ostream& os, vector<T>& v){
	rep(i,v.size()){ os << v[i] << (i == v.size() - 1 ? "" : " "); } return os;
}
template<typename T>
istream& operator >> (istream& is, vector<T>& v){
	for(T& x: v){ is >> x; } return is;
}

const long long M = 1000000007;

class Combination{
	public:
		vector<long long> fact, rev;
		Combination(int n = 10005) : fact(n), rev(n) { // n = h + w
			fact[0] = fact[1] = 1;
			range(i,2,n){
				(fact[i] = fact[i - 1] * i) %= M;
			}
			rev[n - 1] = power(fact[n - 1], M - 2) % M;
			for (int i = n - 1; i > 0; i--) {
				rev[i - 1] = rev[i] * i % M;
			}
		}
		long long power(long long x, long long n){ //べき乗 x^n mod M
			long long res = 1;
			if(n > 0){
				res = power(x, n / 2);
				if(n % 2 == 0) res = (res * res) % M;
				else res = (((res * res) % M) * x ) % M;
			}
			return res;
		}
		long long factorial(long long l, long long r){ return fact[r] * rev[l - 1] % M; }
		long long factorial(long long n){ return fact[n]; }
		long long combination(long long n, long long r){ //nCr (1,1)から(w,h)だと、引数は(w - 1, h - 1, M)
			if(n < 0) return 0;
			return factorial(n - r + 1, n) * rev[r] % M;
		}
};

int main(){
	long long n, a, b, c, d;
	cin >> n >> a >> b >> c >> d;

	Combination com;
	long long dp[1005][1005] = {{0}}; // 残り人数、何人以下でグループを作ったか
	dp[n][0] = 1;
	for(int i = n; i >= 0; i--){
		range(j,1,b + 1){
			(dp[i][j] += dp[i][j - 1]) %= M;
			if(j < a) continue;

			long long pro = 1;
			rep(k,c) (pro *= com.combination(i - k * j, j)) %= M;
			range(k,c,d + 1){
				if(i - k * j < 0) break;
				//cout << i << ' ' << j << ' ' << k << endl;
				//show(pro)show( com.rev[k] % M)
				(dp[i - k * j][j] += dp[i][j - 1] * pro % M * com.rev[k] % M) %= M;
				(pro *= com.combination(i - k * j, j)) %= M;
				//rep(i,n + 1){ rep(j,b + 1){ cout << dp[i][j] << ' '; } cout << endl; }cout << endl;
			}
		}
	}
	//rep(i,n + 1){ rep(j,b + 1){ cout << dp[i][j] << ' '; } cout << endl; }cout << endl;

	cout << dp[0][b] << endl;
}


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

using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); ++i)
double const PI = 3.1415926535897932384626433;

int main() {
    int r;
    cin >> r;
    if (r < 1200)
        cout << "ABC";
    else if (r >= 1200 && r < 2800)
        cout << "ARC";
    else
        cout << "AGC";
    return 0;
}

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

int main() {
  while (true) {
    int n;
    cin >> n;
    if (n == 0)
      return 0;

    vector<int> s(n);
    rep(i, n) cin >> s[i];

    double m = 0;
    rep(i, n) m += s[i];
    m /= n;

    double variance = 0;
    rep(i, n) {
      double d = s[i] - m;
      variance += d * d;
    }
    variance /= n;

    printf("%.9f\n", sqrt(variance));
  }
}


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

int main(){
    int n;
    while(cin >> n, n){
        int dp[1<<16] = {};
        while(n-- > 0){
            int m, l;
            cin >> m >> l;
            int bit = 0;
            while(m-- > 0){
                int s, e;
                cin >> s >> e;
                for(int i = s; i+1 <= e; i++)   bit |= (1<<(i-6));
            }
            for(int j = (1<<16)-1; j >= 0; j--){
                if(j&bit)   continue;
                dp[j] = max(dp[j], dp[j^bit]+l);
            }
        }
        cout << *max_element(dp, dp+(1<<16)) << endl;
    }
}


Measured memory_bytes: 3260
#include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <utility>
#include <vector>
#define FOR(i,a,b) for (int i=(a),for_##i##_max=(b);i<=(for_##i##_max);++i)
#define RFOR(i,a,b) for (int i=(a),rfor_##i##_min=(b);i>=(rfor_##i##_min);--i)
#define REP(i,n) for (int i=0,rep_##i##_len=(n);i<(rep_##i##_len);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)

namespace { // Basics

template<typename T>
void chmin(T &x, T y) {
  x = std::min(x, y);
}

template<typename T>
void chmax(T &x, T y) {
  x = std::max(x, y);
}

template<typename T>
const auto minimum = static_cast<T const &(*)(T const &, T const &)>(std::min);

template<typename T>
const auto maximum = static_cast<T const &(*)(T const &, T const &)>(std::max);

template<typename T>
T constexpr infty = std::numeric_limits<T>::max / 3;
template<>
auto constexpr infty<int> = 1'100'100'100;
template<>
auto constexpr infty<long long int> = 100'500'400'300'200'100LL;

using lli = long long int;
using ld = long double;

} // namespace

using namespace std;

int main() {
  // cout << fixed << setprecision(10);

  int N;
  while (cin >> N && N) {
    vector<lli> vals;
    REP(i, N) {
      lli A; cin >> A;
      vals.push_back(A);
    }
    lli sum = accumulate(begin(vals), end(vals), 0);
    int cnt = 0;
    REP(i, N) {
      if (N * vals[i] <= sum) {
        ++cnt;
      }
    }
    cout << cnt << endl;
  }
  return 0;
}



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

int main()
{
	int n;
	cin >> n;
    map <string, int> cnt;
	while (n--)
    {
        string s;
        cin >> s;
        cnt[s]++;
    }
    cout << "AC x " << cnt["AC"] << endl;
    cout << "WA x " << cnt["WA"] << endl;
    cout << "TLE x " << cnt["TLE"] << endl;
    cout << "RE x " << cnt["RE"] << endl;
	return 0;
}


Measured memory_bytes: 3580
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
#include <math.h>
#include <utility>
#include <vector>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <stack>
#include <queue>
#define div1 1000000007
const long long INF = 1LL << 60;
using namespace std;
using ll = long long;
using ld = long double;
// a>b -> a==b;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
// a<b -> a==b;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main(void)
{
    ll N, i, A[200001], count[200001]={0}, sum, a, ans;

    cin >> N;

    for(i=1; i<=N; i++){
        cin >> A[i];
        count[A[i]]++;
    }

    sum = 0;
    for(i=1; i<=N; i++){
        if(count[i] >= 2){
            sum += (count[i]*(count[i]-1)/2);
        }
    }

    for(i=1; i<=N; i++){
        a = count[A[i]];
        count[A[i]]--;

        ans = sum;

        if(a>=2){
            ans -= (a*(a-1)/2);
        }
        if(a-1>=2){
            ans += ((a-1)*(a-2)/2);
        }

        cout << ans << endl;

        count[A[i]]++;
    }

    return 0;
}

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

#define FORE(i, a) for (auto i = a.begin(); i != a.end(); ++i)
#define REPU(i, a, b) for (int i = (a); i < (b); ++i)
#define REPD(i, a, b) for (int i = (a); i > (b); --i)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())

vector<string> split(const string &s, char c) {
	vector<string> v; stringstream ss(s); string x;
	while (getline(ss, x, c)) v.push_back(x);
	return v;
}
#define DEBUG(args...) { vector<string> _v = split(#args, ','); err(_v.begin(), args); }
void err(vector<string>::iterator it) {}
template<typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
	cerr << "[DEBUG] " << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << '\n';
	err(++it, args...);
}

typedef long long ll;
const int MOD = 1000000007;

template<class T, class U> inline T tmin(T a, U b) { return (a < b) ? a : b; }
template<class T, class U> inline T tmax(T a, U b) { return (a > b) ? a : b; }
template<class T, class U> inline void amax(T &a, U b) { if (b > a) a = b; }
template<class T, class U> inline void amin(T &a, U b) { if (b < a) a = b; }
template<class T> T gcd(T a, T b) { while (b != 0) { T c = a; a = b; b = c % b; } return a; }

int main(int argc, char *argv[]) {
	ios_base::sync_with_stdio(false);

	int n, x; cin >> n >> x;
	vector<int> a(n);
	REPU(i, 0, n) cin >> a[i];
	ll ans = 0;
	for (int i = 0; i + 1 < n; ++i) {
		ans += max(0, a[i] + a[i + 1] - x);
		if (a[i] + a[i + 1] > x) {
			if (a[i] >= x) a[i] = x, a[i + 1] = 0;
			else a[i + 1] = x - a[i];
		}
	}
	cout << ans << endl;

	return 0;
}


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

int main(){
  long long ans = 0;
  int cnt = 0;
  std::string str, bw;
  std::cin >> str;
  bw = "BW";
  for(int i = 0; i < (int)(str.length()); i++){
    if(str[i] == bw[1]){
      ans += i - cnt;
      cnt++;
    }
  }
  std::cout << ans << std::endl;
}

Measured memory_bytes: 832
#include <bits/stdc++.h>
#define rep(i , n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;
pair<int, int> x[100009],y[1000009];
int main() {
    int n;
    cin >> n;
    rep(i, n){
        int a;
        cin >> a;
        if(i % 2 == 0){
            x[a].first++;
        }
        else{
            y[a].first++;
        }
    }
    for(int i = 1; i <= 100000; i++){
        x[i].second = i;
        y[i].second = i;
    }
    sort(x, x + 100000);
    sort(y, y + 100000);
    reverse(x, x + 100000);
    reverse(y, y + 100000);
    int s = 0, t = 0;
    if(x[0].second == y[0].second){
        if(x[0].first + y[1].first > x[1].first + y[0].first){
            cout << n - x[0].first - y[1].first << endl;
        }
        else{
            cout << n - x[1].first - y[0].first << endl;
        }
    }
    else{
        cout << n - x[0].first - y[0].first << endl;
    }
}


Measured memory_bytes: 5184
for _ in [0]*input():
  A = "012345678954321"
  A += A
  a, b = raw_input().split()
  i1 = A.index(a)
  i2 = A.index(a,i1+1)
  i3 = A.index(b,i1)
  if i2<i3: i1=i2
  print " ".join(A[i1:i3+1])

Measured memory_bytes: 4204
#include<bits/stdc++.h>
using namespace std;
int gcdEx(int a, int b, int *x, int *y){if(!a){*x=0;*y=1;return b;}
int x1,y1,gcd=gcdEx(b%a,a,&x1,&y1); *x=y1-(b/a)*x1;*y=x1; return gcd;}
int modI(int b, int m)      {int x,y;gcdEx(b,m,&x,&y);return (x%m+m)%m;}
typedef long long           ll;
typedef pair<int, int>      pii;
typedef vector<int>         vi;
typedef vector<pii>         vii;
typedef set<int>            si;
typedef map<string, int>    msi;
#define all(x) (x).begin(), (x).end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define loop(i,b,n)           for(int i=b;i<n;i++)
#define loopv(b,n,a)         for(int i=b;i<n;i+=a)
#define loopr(b,n)           for(int i=n;i>=0;i--)

#define sum(a)     ( accumulate ((a).begin(), (a).end(), 0ll))
#define mine(a)    (*min_element((a).begin(), (a).end()))
#define maxe(a)    (*max_element((a).begin(), (a).end()))
#define mini(a)    ( min_element((a).begin(), (a).end()) - (a).begin())
#define maxi(a)    ( max_element((a).begin(), (a).end()) - (a).begin())
#define lowb(a, x) ( lower_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define uppb(a, x) ( upper_bound((a).begin(), (a).end(), (x)) - (a).begin())

#define start_routine() int begtime = clock();
#define end_routine() int endtime = clock(); \
                      cerr << "\n\n" << "Time elapsed: " << \
                      (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n"; \
                      return 0
#define mp                  make_pair
#define ff                  first
#define ss                  second
#define pb                  push_back
#define MOD                 1000000007
#define modA(a,b)           (((a%MOD)+(b%MOD))%MOD)
#define modS(a,b)           (((((a%MOD)-(b%MOD))%MOD)<0)?(int)(MOD+((a%MOD)-(b%MOD))%MOD):(int)(((a%MOD)-(b%MOD))%MOD))
#define modM(a,b)           (int)((((ll)(a%MOD))*((ll)(b%MOD)))%MOD)
#define modD(a,b)           ((modI(b,MOD)*(a%MOD))%MOD)
ll modP(ll x, ll y)         {ll r=1; x%=MOD; while(y>0){if(y&1){r=(r*x)%MOD;}
y=y>>1; x=(x*x)%MOD;} return r;}
#define trace1(x)               cerr<<#x<<": "<<x<<endl
#define trace2(x, y)               cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
//#define ONlo
int main()
{
//  freopen("input.txt","r",stdin);
    ll t=1;
//    cin>>t;
    while(t--)
    {
        ll a,b,c;
        cin>>a>>b>>c;
        if((a+b+c)>=22)
            cout<<"bust";
        else
            cout<<"win";
    }

return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define PI 3.14159265358979323846
#define vll vector<long long>
#define vvll vector<vector<long long>>
using namespace std;
using ll = long long;
using ld = long double;

// グローバル変数（入力）
ll n, k;
vll A;

void input() {
  cin >> n >> k;
  rep(i, n) {
    ll a;
    cin >> a;
    A.push_back(a);
  }
}

void solve() {
  rep(i, k) {
    // いもす法を使って操作を行う
    vll B(n, 0);

    // 左と右だけ記録
    rep(i, n) {
      ll l = max(0LL, i - A[i]);
      ll r = min(n - 1, i + A[i]);
      B[l]++;
      if (r + 1 < n) { B[r + 1]--; }
    }

    // シミュレート
    rep(i, n) {
      if (i > 0) { B[i] += B[i - 1]; }
    }

    A = B;

    // もし全部nだったらおわりにする
    ll sum = 0;
    rep(i, n) { sum += A[i]; }
    if (sum == n * n) { break; }
  }

  // 出力
  rep(i, n) {
    cout << A[i];
    if (i < n - 1) { cout << " "; }
  }
  cout << endl;
}

int main() {
  input();
  solve();
  return 0;
}


Measured memory_bytes: 6404
import java.io.*;

class Main {
	public static void main(String[] arg)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		int S =  Integer.parseInt(str);
		int h = S/3600;
		int tmp = S%3600;
		int m = tmp/60;
		int s = tmp%60;
		System.out.println(h+":"+m+":"+s);
	}	
}

Measured memory_bytes: 17056
#include <algorithm>
#include <array>
#include <cmath>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>
#include <bitset>

#define pv(val) cerr << #val << '=' << (val) << endl
#define pvn(name, val) cerr << name << '=' << (val) << endl
#define pl cerr << '@' << __LINE__ << endl

using namespace std;

using ll = int64_t;
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(a) a.begin(), a.end()

template <class T>
ostream &operator<<(ostream &os, vector<T> const &vec) {
    if (vec.empty()) {
        os << "{}";
    } else {
        os << '{';
        for (size_t i = 0; i < vec.size() - 1; i++) os << vec[i] << ", ";
        os << vec.back() << '}';
    }
    return os;
}

template <class T, size_t S>
ostream &operator<<(ostream &os, array<T, S> const &arr) {
    if (arr.empty()) {
        os << "{}";
    } else {
        os << '{';
        for (size_t i = 0; i < arr.size() - 1; i++) os << arr[i] << ", ";
        os << arr.back() << '}';
    }
    return os;
}

template <class T, class U>
ostream &operator<<(ostream &os, pair<T, U> const &p) {
    os << '(' << p.first << ", " << p.second << ')';
    return os;
}

namespace math {
ll gcd(ll u, ll v) {
    while (v != 0) {
        ll r = u % v;
        u = v;
        v = r;
    }
    return u;
}
ll lcm(ll m, ll n) {
    if ((0 == m) || (0 == n)) return 0;

    return ((m / math::gcd(m, n)) * n);
}
}  // namespace math

struct UnionFind {
    vector<ll> data;
    UnionFind(ll size) : data(size, -1) {}
    bool unionSet(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x != y) {
            if (data[y] < data[x]) swap(x, y);
            data[x] += data[y];
            data[y] = x;
        }
        return x != y;
    }
    bool findSet(ll x, ll y) { return root(x) == root(y); }
    ll root(ll x) { return data[x] < 0 ? x : data[x] = root(data[x]); }
    ll size(ll x) { return -data[root(x)]; }
};

template <class T, class U>
pair<T, U> operator+(pair<T, U> const &a, pair<T, U> const &b) {
    return pair<T, U>(a.first + b.first, a.second + b.second);
}

template <class T, class U>
pair<T, U> operator-(pair<T, U> const &a, pair<T, U> const &b) {
    return pair<T, U>(a.first - b.first, a.second - b.second);
}

ll bound(function<bool(ll)> f, ll ng, ll ok) {
    while (abs(ng - ok) > 1) {
        ll mid = (ng + ok) / 2;
        if (f(mid))
            ok = mid;
        else
            ng = mid;
    }

    return ok;
}


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

    double jpy = 0.0;
    rep(i, N){
        double x;
        string u;
        cin >> x >> u;
        if(u == "JPY")
            jpy += x;
        else
            jpy += 380000.0 * x;
    }
    cout << jpy << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
const int SIZE = 10005;

int n,m;
int num[SIZE]={};
bool flag[SIZE]={};
int parent[SIZE];
set<int> st;
vector<int> order[SIZE], rev[SIZE];
int vec[SIZE][2]={};
priority_queue<P, vector<P> > que;

//Kyo
int dfs1(int i, int index);
void dfs2(int i);

//Union_find
void init();
void unite(int x, int y);
int find(int x);
bool same(int x, int y);

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

  init();

  cin >> n >> m;
  for(int i=0;i<m;i++){
    int a,b;
    cin >> a >> b;
    order[a].push_back(b);
    rev[b].push_back(a);
  }

  int index = 1;
  for(int i=0;i<n;i++){
    if(num[i] == 0){
      index = dfs1(i, index)+1;
    }
  }

  /*
  for(int i=0;i<n;i++){
    cout << i << " = " << num[i] << endl;
  }
  */
  int count = 0;
  while(!que.empty() && st.size() < n){
    P p = que.top(); que.pop();
    int pos = p.second;
    int cost = p.first;
    if(st.find(pos) != st.end()) continue;
    count++;
    dfs2(pos);
  }
  /*
    for(int i=0;i<n;i++){
    cout << i << " = root = " << find(i) << endl;
    } 
  */
  int m;
  cin >> m;
  for(int i=0;i<m;i++){
    int a,b;
    cin >> a >> b;
    if(same(a, b)) cout << 1 << endl;
    else cout << 0 << endl;
  }
  
  return 0;
}

int dfs1(int i, int index)
{
  if(flag[i]) return 0;//なくてもいい
  flag[i] = true;

  for(int j=0;j<order[i].size();j++){
    int next = order[i][j];
    if(!flag[next]){
      index = dfs1(next, index)+1;
    }
  }
  
  num[i] = index;
  que.push(P(index, i));
  return(index);
}

void dfs2(int i)
{
  if(st.find(i) != st.end()) return;

  st.insert(i);
  for(int j=0;j<rev[i].size();j++){
    int next = rev[i][j];
    P a = P(min(i, next), max(i, next));
    if(st.find(next) == st.end()){
      unite(i, next);
      dfs2(next);
    }
  }
  
  return;
}

void init()
{
  for(int i=0;i<SIZE;i++) parent[i] = i;
  return;
}

void unite(int x, int y)
{
  x = find(x);
  y = find(y);
  if(x == y) return;

  parent[y] = x;
  return;
}

int find(int x)
{
  if(x == parent[x]) return x;
  return parent[x] = find(parent[x]);
}

bool same(int x, int y)
{
  return( find(x) == find(y));
}



Measured memory_bytes: 5604
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, h;
    cin >> a >> b >> h;
    cout << (a + b) * h / 2 << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-10;
const long double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
long double ABS(long double a){return max(a,-a);}

int main(void) {
  int a,b;
  scanf("%d%d",&a,&b);
  printf("%d\n",max(a+b,max(a-b,a*b)));
}

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

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

int main(){
  int n,k;
  cin >> n >> k;

  vector<int> a(n);
  rep(i,n) cin >> a.at(i);

  sort(a.begin(), a.end());
  a.push_back(-1);

  vector<int> kind;
  rep(i,n){
    int count = 1;
    while(a.at(i)==a.at(i+1)){count++; i++;}
    kind.push_back(count);
  }

  a.pop_back();
  sort(kind.begin(), kind.end());

  int ans=0;
  int p = kind.size()-k;
  rep(i,max(p,0)) ans+=kind.at(i);

  cout << ans;
}

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

int main(){
    int N, A, B, C, D;
    string S;
    cin >> N >> A >> B >> C >> D;
    cin >> S;
    int count=0;
    bool flag=false;
    bool ans=true;
    // 3
    
    for(int i=B-2; i<D+1; i++){
	if(S[i]=='.')
	    count++;
	else
	    count=0;

	if(count==3){
	    flag=true;
	    break;
	}	    
    }    
    if(C>D && flag==false)
	ans = false;


    //##
    count=0;
    for(int i=A; i<C; i++){
	if(S[i]=='#')
	    count++;
	else
	    count=0;

	if(count==2){
	    ans=false;
	    break;
	}	    
    }
    count=0;
    for(int i=B; i<D; i++){
	if(S[i]=='#')
	    count++;
	else
	    count=0;

	if(count==2){
	    ans=false;
	    break;
	}	    
    }


    if(ans)
	cout << "Yes"<<endl;
    else
	cout << "No"<<endl;    
}



Measured memory_bytes: 640
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1000050;
int main()
{
    ll a[3];cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    if((a[0]==a[1]&&a[2]!=a[1])||(a[1]==a[2]&&a[0]!=a[1])) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
//#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>
#include<cctype>
#include<fstream>


#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979
#define MAXI 7500000

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

int dy[5] = { 0,0,1,-1,0 };
int dx[5] = { 1,-1,0,0 ,0 };

ll gcd(ll a, ll b) {
	if (b == 0) {
		return a;
	}
	return gcd(b, a%b);
}


int main(void) {
	long long int n, X;
	long long int x[100001];
	long long int result;

	cin >> n >> X;
	FOR(i, 1, n) {
		cin >> x[i];
	}

	result = abs(X - x[1]);

	FOR(i, 2, n) {
		result = gcd(max(result, abs(X - x[i])), min(result, abs(X - x[i])));
	}

	cout << result << endl;

	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(),v.end()
typedef long long ll;

int main(){
    int N;
    cin >> N;
    vector<int> vec(N);
    rep(i,N){
        cin >> vec[i];
    }
    vector<pair<int,int> > number(0);
    number.push_back(pair<int,int>(vec[0],1));
    int ans = 0;
    rep(i,N - 1){
        if (vec[i] != vec[i + 1]){
            number.push_back(pair<int,int>(vec[i + 1], 1));
        }
        else{
            number[number.size() - 1].second++;
        }
    }
    int len = number.size();
    rep(i,len){
        ans += (number[i].second / 2);
    }
    cout << ans << endl;
}



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

#ifndef LOCAL_
#define fprintf if( false ) fprintf
#endif // LOCAL_
#define dump() fprintf(stderr, "#%s.%d\n", __func__, __LINE__);
#define dumpl(x1) fprintf(stderr, "#%s.%d (%s) = (%ld)\n", __func__, __LINE__, #x1, x1);
#define dumpll(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%ld, %ld)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define dumplll(x1, x2, x3) fprintf(stderr, "#%s.%d (%s, %s, %s) = (%ld, %ld, %ld)\n", __func__, __LINE__, #x1, #x2, #x3, x1, x2, x3);
#define dumpd(x1) fprintf(stderr, "#%s.%d (%s) = (%lf)\n", __func__, __LINE__, #x1, x1);
#define dumpdd(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%lf, %lf)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define loop for(;;)
typedef std::vector<long> LI;
typedef std::queue<long> QI;
#define rep(i,n) for(long i = 0; i < (long)n; ++i)
const double pi = M_PI;

template<typename T> void scan1(T& x) { fprintf(stderr, "unknown type\n"); }
template<> void scan1(long& x) { if( scanf("%ld", &x) < 0 ) exit(0); }
template<> void scan1(std::string& x) { if( not ( std::cin >> x ) ) exit(0); }
void scan() {}
template<typename Head, typename... Tail>
void scan(Head& x, Tail&... xs) {
  scan1(x); scan(xs...);
}

struct N001 {
   long n;
   std::vector<long> parents;
   std::vector<long> numbers;
   N001(long n_) : n(n_), parents(n+1, -1), numbers(n+1, -1) {
   }
};
long find(N001& s, long x) {
   if( s.parents[x] == -1 ) return x;
   return s.parents[x] = find(s, s.parents[x]);
}
bool same(N001& s, long x, long y) {
   return find(s, x) == find(s, y);
}
void unite(N001& s, long x, long y) {
   long x2 = find(s, x);
   long y2 = find(s, y);
   if( x2 == y2 ) return;
   if( not ( s.numbers[x2] <= s.numbers[y2] ) )
      std::swap(x2, y2);
   s.parents[x2] = y2;
   s.numbers[y2] += s.numbers[x2];
}


struct Solver {
   Solver() { fprintf(stderr, "--------Solver begin--------\n"); }
   ~Solver() { fprintf(stderr, "--------Solver end--------\n"); }
   void solve() {
      long n; scan(n);
      LI xs(n), ys(n);
      rep(i, n) scan(xs[i], ys[i]);
      std::priority_queue<std::tuple<long, long, long>> q;
      std::vector<std::pair<long, long>> zs(n);
      for(long i = 0; i < n; ++i) {
         zs[i] = std::make_pair(xs[i], i);
      }
      std::sort(zs.begin(), zs.end());
      for(long i = 1; i < n; ++i) {
         q.push(std::make_tuple(-(zs[i].first-zs[i-1].first), zs[i-1].second, zs[i].second));
      }
      for(long i = 0; i < n; ++i) {
         zs[i] = std::make_pair(ys[i], i);
      }
      std::sort(zs.begin(), zs.end());
      for(long i = 1; i < n; ++i) {
         q.push(std::make_tuple(-(zs[i].first-zs[i-1].first), zs[i-1].second, zs[i].second));
      }
      N001 uf(n);
      long count = 0;
      long res = 0;
      while( count != n - 1 ) {
         long d, i, k;
         std::tie(d, i, k) = q.top(); q.pop();
         if( same(uf, i, k) ) continue;
         unite(uf, i, k);
         count += 1;
         res += d;
      }
      printf("%ld\n", -res);
   }
};

int main() {
   loop std::unique_ptr<Solver>(new Solver())->solve();
}



Measured memory_bytes: 11632
n = int(input())
str_list = ["".join(sorted(input())) for i in range(n)]
ans = 0
str_dic = {}

for i in range(n):
    if str_list[i] in str_dic:
        str_dic[str_list[i]] += 1
        ans += str_dic[str_list[i]]
    else:
        str_dic[str_list[i]] = 0

print(int(ans))

Measured memory_bytes: 67032
n = input()
num = [n[i] for i in range(len(n)) ]
#print(num)
for i in range(len(num)):
    s = num[i]
    if s == "1":
        num[i] = "9"
    elif s == "9":
        num[i] = "1"
#print(num)
n2 = "".join(num)
print(int(n2))

Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <array>
#include <vector>
#include <functional>
#include <unordered_map> 
#include <map> 
#include <numeric>
#include <limits>
#include <utility>
#include <queue>
#include <random>
#include <bitset>
#include <memory>
using namespace std;
typedef long long LL;
//#define _USE_MATH_DEFINES

int main(void) {
	int a, b;
	cin >> a >> b;

	cout << max(a + b, max(a - b, a*b)) << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
int main(void){
    // Your code here!
 string s;
 cin >> s;
 cout << (s=="Sunny" ? "Cloudy" : (s=="Cloudy" ? "Rainy" : "Sunny"));
 return 0;
}

Measured memory_bytes: 3424