akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.StringJoiner;

public class Main {
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	public static void main(String[] args) throws Exception {
		String[] commands = br.readLine().split("");
		
		Deque<Integer> slopes = new ArrayDeque<>();
		Deque<Area> localAreas = new ArrayDeque<>();
		int totalArea = 0;
		
		for(int i = 0; i < commands.length; i++){
			if(commands[i].equals("\\")){
				slopes.push(i);
			}else if(commands[i].equals("/")){
				if(!slopes.isEmpty()){
					int org = slopes.pop();
					int addArea = i - org;
					totalArea += addArea;
					
					int localArea = 0;
					while(!localAreas.isEmpty()){
						Area a = localAreas.peek();
						if(org < a.x){
							localArea += a.area;
							localAreas.pop();
						}else{
							break;
						}
					}
					localAreas.push(new Area(org, localArea + addArea));
				}
			}
		}
		
		System.out.println(totalArea);
		
		StringJoiner sj = new StringJoiner(" ");
		sj.add(String.valueOf(localAreas.size()));
		
		while(!localAreas.isEmpty()){
			sj.add(String.valueOf(localAreas.pollLast().area));
		}
		System.out.println(sj);
	}
	
	static class Area{
		int x = 0;
		int area = 0;
		public Area(int x, int area) {
			this.x = x;
			this.area = area;
		}
	}
}



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

int main(void)
{
    long long int A,B,N;
    cin >> A >> B >> N;
    long long int i;
    long long int f = 0;
    long long int f_max = 0;

    if(B==1){
        f_max = 0;
    }
    else if(B>N){
        f_max = floor(A*N/B) - A * floor(N/B) ;
    }
    else{
        f_max = A - 1 - floor(A/B) ;
    }
    

    cout << f_max << endl;  

    return 0;

}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define INF 10000000
using ll = long long ;
ll gcd(ll a, ll b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}
ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b;
}
template< int id > struct CompTupleBy
{
  template<class T> 
  bool operator()( const T& a, const T& b ) const {
    return std::get<id>(a) < std::get<id>(b);
  }
};

using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    if (n==m){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }


        
}

Measured memory_bytes: 256
import numpy as np
from itertools import product
from collections import deque

H, W = map(int, input().split())
val = []
INF = 10**9
for i in range(H):
    tmp = input()
    val.append([0 if tmp[j] == '#' else INF for j in range(W)])
val = np.array(val)

for i in range(H-1):
    val[i+1, :] = np.minimum(val[i, :]+1, val[i+1, :])
for i in range(H-1, 0, -1):
    val[i-1, :] = np.minimum(val[i, :]+1, val[i-1, :])
for j in range(W-1):
    val[:, j+1] = np.minimum(val[:, j]+1, val[:, j+1])
for j in range(W-1, 0, -1):
    val[:, j-1] = np.minimum(val[:, j]+1, val[:, j-1])

print(val.max())

Measured memory_bytes: 28940
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m,i;
	cin>>n>>m;
	int a,b,arr[n+1];
	memset(arr,0,sizeof(arr));
	for(i=0;i<m;i++){
		cin>>a>>b;
		arr[a]++;
		arr[b]++;
	}
	for(i=1;i<=n;i++)cout<<arr[i]<<endl;
	return 0;
}

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

class Solution
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var d = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
        var m = int.Parse(Console.ReadLine());
        var t = Console.ReadLine().Split(' ').Select(int.Parse).ToList();

        var dDict = new Dictionary<int, int>();
        foreach (var dd in d)
        {
            if (!dDict.ContainsKey(dd))
            {
                dDict[dd] = 0;
            }
            dDict[dd]++;
        }
        var tDict = new Dictionary<int, int>();
        foreach (var tt in t)
        {
            if (!tDict.ContainsKey(tt))
            {
                tDict[tt] = 0;
            }
            tDict[tt]++;
        }

        foreach (var kv in tDict)
        {
            if(!dDict.ContainsKey(kv.Key) || dDict[kv.Key] < kv.Value)
            {
                Console.WriteLine("NO");
                return;
            }
        }

        Console.WriteLine("YES");
    }
}

Measured memory_bytes: 55212
#include "bits/stdc++.h"
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;

void Main()
{
  std::string S;
  std::cin >> S;

  int stock_one = 0;
  int stock_zero = 0;

  for(auto c: S | adaptor::reversed)
  {
    if(c=='0')
    {
      if(stock_one>0)
      {
        stock_one--;
      }
      else
      {
        stock_zero++;
      }
    }
    else
    {
      stock_one++;
    }
  }
  std::cout << (S.length()-std::abs(stock_one-stock_zero)) << std::endl;
}

int main()
{
   std::cin.tie(nullptr);
   std::ios_base::sync_with_stdio(false);
   std::cout << std::fixed << std::setprecision(15);
   Main();
   return 0;
}


Measured memory_bytes: 512
using System;
using System.Collections.Generic;

namespace ConsoleApplication1
{    

    class Program
    {
        static int[] L;
        static int[] R;
        const int inf = int.MaxValue;

        static void MergeSort(int[] data, int left, int right)
        {
            int mid = 0;

            if(right - left > 1)
            {
                mid = (right + left) / 2;
                MergeSort(data, left, mid);
                MergeSort(data, mid, right);
                Merge(data, left, mid, right);
            }

        }

        static void Merge(int[] data, int left, int mid, int right)
        {
            int n1 = mid - left;
            int n2 = right - mid;
            for (int i = 0; i < n1; i++)
            {
                L[i] = data[left + i];
            }
            for(int i = 0; i < n2; i++)
            {
                R[i] = data[mid + i];
            }

            L[n1] = inf;
            R[n2] = inf;

            int s = 0;
            int t = 0;

            for(int i = left; i < right; i++)
            {
                if(L[s] < R[t])
                {
                    data[i] = L[s++];
                }
                else
                {
                    cnt += n1 - s;
                    data[i] = R[t++];
                }
            }

        }
    
        static long cnt;

        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] input = Console.ReadLine().Split(' ');

            int[] data = new int[n];
            L = new int[n];
            R = new int[n];
            cnt = 0;

            for(int i = 0; i < n; i++)
            {
                data[i] = int.Parse(input[i]);
            }

            MergeSort(data, 0, n);            

            Console.WriteLine(cnt);
        }
    }
}



Measured memory_bytes: 36924
import java.util.*;
import java.math.*;
 
public class Main {
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
        int x = cin.nextInt();
        int y = cin.nextInt();
        int z = cin.nextInt();
        System.out.println(z+" "+x+" "+y);
    }
}


Measured memory_bytes: 21844
A,B,C,D = map(int,list(input()))
op = ["+","-"]
def check():
    ans = ""
    for i in range(2):
        for q in range(2):
            for k in range(2):
                op1,op2,op3 = op[i],op[q],op[k]
                if op1 == "+":
                    ans = A + B
                else:
                    ans = A - B
                if op2 == "+":
                    ans += C
                else:
                    ans -= C
                if op3 == "+":
                    ans += D
                else:
                    ans -= D
                if ans == 7:
                    return "{0}{1}{2}{3}{4}{5}{6}=7".format(A,op1,B,op2,C,op3,D)
print(check())
                
                

Measured memory_bytes: 3064
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author wijebandara
 */
public class Main {
    public static void main(String[] args) {
        try {
            java.io.BufferedReader in = new java.io.BufferedReader(new java.io.InputStreamReader(System.in));
            
            int data[]=new int [1000000];
            
            for (int i = 2; i < 1000000; i++) {
                if(isp(i))
                {
                    data[i]=data[i-1]+1;
                }
                else
                {
                    data[i]=data[i-1];
                }
            }
            String s =in.readLine();
            while(s!=null)
            {               
                System.out.println(data[Integer.parseInt(s)]);
                s =in.readLine();
            }
            
            
        } catch (Exception ex) {
            System.exit(0);
        }
    }
    static boolean isp(int x)
    {
        int a =(int)Math.sqrt(x);
        for (int i = 2; i <=a; i++) {
            if(x%i==0)
            {
                return false;
            }
        }
        return true;
    }
    
}

Measured memory_bytes: 23892
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main() {
    int i,j,input,counter;
    int max = 0;
    int maxcounter = 0;

    cin >> input;

    for(i = 1;i <= input; i++) {
        j = i;
        counter = 0;
        while(j > 1) {
        
            if(j % 2 == 0) {
                j /= 2;
                counter++;
            }else {
                break;
            }      
        }
        
        if(counter >= maxcounter) {
            max = i;
            maxcounter = counter;
        }
    }

    cout << max << endl;    

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b , c, d;
  cin >> a >> b >> c >> d;
  
  if(a + b > c + d){
    cout << "Left" << endl;
  }else if(a + b == c + d){
    cout << "Balanced" << endl;
  }else cout << "Right" << endl;
}

Measured memory_bytes: 3592
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <bitset>
#include <set>
#include <map>
#include <stack>
#include <list>

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,b,n) for(int i=b;i<n;i++)
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

const float PI = 3.1415926;
static const int INFTY = (1<<30);

using namespace std;

typedef long long ll;
typedef long double ld;

int n;

int main() {
  while(cin >> n, n) {
    rep(i, n) {
      int pm, pe, pj;
      cin >> pm >> pe >> pj;
      float tmp1 = (pm + pe) / 2.0;
      float tmp2 = (pm + pe + pj) / 3.0;
      if(tmp1 >= 90 || tmp2 >= 80 || pm == 100 || pe == 100 || pj == 100) {
        cout << 'A' << endl;
      } else if (tmp2 >= 70 || (tmp2 >= 50 && (pm >= 80 || pe >= 80))) {
        cout << 'B' << endl;
      } else {
        cout << 'C' << endl;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 3076
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;

bool check(P a,P b){
  return (a.first<=b.first&&b.second<=a.second);
}

int change(string str){
  int L=(str[0]-'0')*10+(str[1]-'0');
  int R=(str[3]-'0')*10+(str[4]-'0');
  return L*100+R;
}

vector<P> A,B;
vector<int> a[2];
int n,m;
string str;


int main(){
  cin>>n;
  A.resize(n);
  a[0].resize(n);
  a[1].resize(n);
  for(int i=0;i<n;i++){
    cin>>str;
    A[i].first=change( str.substr(0,5) );
    A[i].second=change( str.substr(6,5) );
  }

  for(int k=0;k<2;k++){
    int T;
    cin>>T;
    while(T--){
      cin>>m;
      B.clear();
      B.resize(m);
      for(int i=0;i<m;i++){
        cin>>str;
        B[i].first=change( str.substr(0,5) );
        B[i].second=change( str.substr(6,5) );
        for(int j=0;j<n;j++){
          if(check(B[i],A[j])){
            a[k][j]++;
          }
        }
      }
    }
  }

  int ans=0;
  for(int i=0;i<n;i++)
    ans+=min(a[0][i],a[1][i]);  
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 1216
{-# OPTIONS_GHC -O #-}

import Control.Applicative
import Control.Monad
import Control.Monad.ST
import Data.List
import Control.Monad.Trans.State.Strict
import Data.Char (isSpace)
import Data.Maybe (fromJust,fromMaybe,isNothing,isJust)
import qualified Data.ByteString.Lazy.Char8 as B

import Data.Array
import Data.Array.ST
import Data.Array.Unsafe

type Parser a = StateT B.ByteString Maybe a

parseInt :: Parser Int
parseInt = StateT (B.readInt . B.dropWhile isSpace)

parseInt2 :: Parser (Int,Int)
parseInt2 = liftM2 (,) parseInt parseInt

parseInt3 :: Parser (Int,Int,Int)
parseInt3 = liftM3 (,,) parseInt parseInt parseInt

parse :: Parser ((Int,Int), [(Int,Int,Int)])
parse = do
    (n,m)<-parseInt2
    rs<-replicateM m parseInt3
    return ((n,m),rs)

main=do
    ((n,m),rs)<-fromJust.evalStateT parse <$> B.getContents
    let da = wf n $ ml n rs
    print $ length $ filter (\(a,b,c)-> fmap (< c) (da!(a,b)) == Just True) rs

ml::Int->[(Int,Int,Int)]->[((Int,Int),Maybe Int)]
ml n rs =[((i,j),Nothing)|i<-[1..n],j<-[1..n]] ++ [((i,i),Just 0)|i<-[1..n]] ++ concatMap (\(u,v,l)->[((u,v),Just l),((v,u),Just l)]) rs

wf ::Int-> [((Int,Int),Maybe Int)] -> Array (Int,Int) (Maybe Int)
wf n g = foldl' psi (array ((1,1),(n,n)) g) $ replicateM 3 [1..n]
    where
    psi :: Array (Int,Int) (Maybe Int) -> [Int] -> Array (Int,Int) (Maybe Int)
    psi d [k,i,j] = runST $ do
        d' <- unsafeThaw d :: ST s (STArray s (Int,Int) (Maybe Int))
        dc <- readArray d' (i,j)
        dn <- liftA2 (+) <$> readArray d' (i,k) <*> readArray d' (k,j)
        when (isNothing dc || liftA2 (>) dc dn == Just True) $ writeArray d' (i,j) dn
        unsafeFreeze d'


Measured memory_bytes: 4348
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#define LL long long
int ans;
int X, Y;
int main() {
	std::cin >> X >> Y;
	int tmp = X;
	if (X%Y == 0) {
		std::cout << -1 << std::endl;
		return 0;
	}
	while (true) {
		X += tmp;
		if (X%Y != 0) {
			std::cout << X << std::endl;
			return 0;
		}
	}
}

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

int main(){
    using namespace std;
    unsigned long A, B, K;
    cin >> A >> B >> K;
    auto t{min(A, K)};
    A -= t;
    K -= t;
    auto k{min(B, K)};
    B -= k;
    cout << A << " " << B << endl;
}

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

vector<pair<int,int>> group;
int main(){
    string s;
    int k,n,ans=0;
    cin>>n>>k>>s;
    
    for(int i=0;i<n;){
        char k=s[i];
        int c=0;
        while(1){
            c++;
            if(s[i]==k)
                i++;
            else
                break;
        }
        //cout<<i<<' '<<c<<'\n';
        group.push_back({k-'0',c-1});
    }
    int cur=0,m=k;
    if(group[0].first==0){
        if((group.size()%2==1)+group.size()/2<=k){
            printf("%d",n);
            return 0;
        }
        for(int i=0;i<group.size();i++){
            if(i%2==0){
                
                cur+=group[i].second;
                if(m==0){
                   
                    cur-=group[i-2*k].second;
                    if(i-2*k-1>=0)
                        cur-=group[i-2*k-1].second;
                    m++;
                }
                m--;
                
            }else{
                cur+=group[i].second;
            }
            ans=max(ans,cur);
        }
    }else{
        if(group.size()/2<=k){
            printf("%d",n);
            return 0;
        }
        for(int i=0;i<group.size();i++){
            if(i%2==1){
                
                cur+=group[i].second;
                if(m==0){
    
                    cur-=group[i-2*k].second;
                    if(i-2*k-1>=0)
                        cur-=group[i-2*k-1].second;
                    m++;
                }
                m--;
            }else{
                cur+=group[i].second;
            }
            ans=max(ans,cur);
        }
    }
    printf("%d",ans);
    
}


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

#define mp make_pair
#define pb push_back

typedef pair<int, int> ii;
typedef long long ll;
typedef pair<ll, ll> l4;


int main()
{
  int a, b, c;
  ll k;
  scanf("%d %d %d %lld", &a, &b, &c, &k);
  k %= 2;
  printf("%d\n", (int) (2*k-1)*(b-a));
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef pair<string,int> psi;

bool myCompare(pair<int, psi> a, pair<int, psi> b){
    if(a.second.first < b.second.first){
        return a.second.first < b.second.first;
    }else if(a.second.first == b.second.first){
        if(a.second.second > b.second.second) return a.second.second > b.second.second;
        else return false;
    }else{
        return false;
    }
}

int main(){
    int n; cin >> n;
    vector< pair<int, psi> > vec_id_city_score;
    vec_id_city_score.resize(n);
    for(int i=0; i<n; i++){
        vec_id_city_score[i].first = i+1;
        cin >> vec_id_city_score[i].second.first >> vec_id_city_score[i].second.second; 
    }
    sort(vec_id_city_score.begin(), vec_id_city_score.end(), myCompare);
    for(int i=0; i<n; i++) cout << vec_id_city_score[i].first << "\n";
}



Measured memory_bytes: 256
import collections

n=int(input())
l=list(map(int,input().split()))
s=collections.Counter(l)
s=list(s.items())
#print(s)
a=0
f=[]
for i in s:
    if i[1]>=4:
        f.append(i[0])
        f.append(i[0])
    elif i[1]>=2:
        f.append(i[0])
#print(f)
if len(f)<2:
    print(0)
else:
    f.sort(reverse=True)
    #print(f)
    print(f[0]*f[1])

Measured memory_bytes: 21412
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;
using namespace std;

ll dp[3001][3005][2];

int main(int argc, char* argv[])
{
    int n,T;
    scanf("%d%d", &n, &T);

    vector<int> a(n),b(n);
    int i,j;
    for(i=0; i<n; i++) {
        scanf("%d%d", &a[i], &b[i]);
    }

    for(i=0; i<n; i++) {
        for(j=0; j<T; j++) {
            dp[i+1][j][0]=MAX(dp[i+1][j][0],dp[i][j][0]);
            dp[i+1][j][1]=MAX(dp[i+1][j][1],dp[i][j][1]);

            if(j+a[i]<T) {
                dp[i+1][j+a[i]][0]=MAX(dp[i+1][j+a[i]][0], dp[i][j][0]+b[i]);
            }
            dp[i+1][j][1]=MAX(dp[i+1][j][1], dp[i][j][0]+b[i]);

            if(j+a[i]<T) {
                dp[i+1][j+a[i]][1]=MAX(dp[i+1][j+a[i]][1], dp[i][j][1]+b[i]);
            }
        }
    }

    ll ans=0;
    for(j=0; j<T; j++) {
        ans=MAX(ans,MAX(dp[n][j][0],dp[n][j][1]));
    }
    printf("%lld\n", ans);

    return 0;
}


Measured memory_bytes: 141184
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)
 
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll a,ans,j,k,q,c;
    cin>>a>>q>>c;
    cout<<q/c-(a-1)/c;

}

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

char s[200005], t[200005];
int ans;

int main(){
    cin>>s; cin>>t;
    for (int i=0; i<200000; ++i){
        if (s[i] == '\0') break;
        if (s[i] != t[i]) ++ans;
    }
    cout<<ans;
}


Measured memory_bytes: 3980
//Organize Your Train part ?
#include<bits/stdc++.h>
using namespace std;

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

int main(){
  int n;
  cin>>n;
  while(n--){
    string s;
    map<string, int> mp;
    int ans=0;
    cin>>s;
    rep(i,s.length()){
      string t1="", t2="";
      rep(j,i)t1+=s[j];
      for(int j=i; j<s.length(); j++)t2+=s[j];
      if(mp.find(t1+t2)==mp.end()){ans++; mp[t1+t2]=1;}
      if(mp.find(t2+t1)==mp.end()){ans++; mp[t2+t1]=1;}
      reverse(t1.begin(), t1.end());
      if(mp.find(t1+t2)==mp.end()){ans++; mp[t1+t2]=1;}
      if(mp.find(t2+t1)==mp.end()){ans++; mp[t2+t1]=1;}
      reverse(t2.begin(), t2.end());
      if(mp.find(t1+t2)==mp.end()){ans++; mp[t1+t2]=1;}
      if(mp.find(t2+t1)==mp.end()){ans++; mp[t2+t1]=1;}
      reverse(t1.begin(), t1.end());
      if(mp.find(t1+t2)==mp.end()){ans++; mp[t1+t2]=1;}
      if(mp.find(t2+t1)==mp.end()){ans++; mp[t2+t1]=1;}
    }
    cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 1316
import java.util.Arrays;
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		int[][] x = new int[N][];
		int[][] y = new int[N][];
		for (int i = 0; i < N; ++i) {
			A[i] = sc.nextInt();
			x[i] = new int[A[i]];
			y[i] = new int[A[i]];
			for (int j = 0; j < A[i]; ++j) {
				x[i][j] = sc.nextInt();
				y[i][j] = sc.nextInt();
				--x[i][j];
			}
		}
		int ans = 0;
		out: for (int s = 1; s < (1 << N); ++s) {
			for (int i = 0; i < N; ++i) {
				if ((s >> i) % 2 == 0)
					continue;
				for (int j = 0; j < A[i]; ++j) {
					if ((s >> x[i][j]) % 2 != y[i][j])
						continue out;
				}
			}
			ans = Math.max(ans, Integer.bitCount(s));
		}
		System.out.println(ans);
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}


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

class Program
{
    static void Main()
    {
        var I = ReadLine().Split().Select(long.Parse).ToArray();
        var W = I[0];
        var H = I[1];
        var x = I[2];
        var y = I[3];
        var S = H * W;
        if (H % 2 == 0 && W % 2 == 0 && W / 2 == x && H / 2 == y) WriteLine($"{S / 2.0} {1}");
        else WriteLine($"{S / 2.0} {0}");
    }
}

Measured memory_bytes: 11348
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func next() string {
	sc.Scan()
	return sc.Text()
}
func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}
func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextInt64() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

//var done []bool = make([]bool, 10)
//var memo []int = make([]int, 10)

//func fib(n int) int {
//	fmt.Println(n)
//	if n == 0 {
//		return 0
//	}
//	if n == 1 {
//		return 1
//	}
//	if done[n] {
//		fmt.Println("done" + fmt.Sprint(n))
//		return memo[n]
//	}
//	done[n] = true
//	memo[n] = fib(n-1) + fib(n-2)
//	return memo[n]
//}

var m map[string]int = make(map[string]int)
var mInt map[int]int = make(map[int]int)

//var dp []int = make([]int, n)

//func fib(n int) int {
//	dp[0] = 0
//	dp[1] = 1
//	for i := 2; i <= n; i++ {
//		dp[i] = dp[i-1] + dp[i-2]
//	}
//	return dp[n]
//}

func line(ii []int, bn []int) []int {
	var res []int = ii
	for i := 0; i < len(ii); i++ {
		for j := 0; j < len(bn); j++ {
			if ii[i] == bn[j] {
				fmt.Println("hit" + fmt.Sprint(ii[i]))
				if i == len(ii)-1 {
					res = ii[:i]
				} else {
					res = append(ii[:i], ii[i+1:]...)
				}
			}
		}
	}
	return res
}

func main() {
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()
	eight := nextInt()
	ten := nextInt()
	x1 := int(math.Ceil(float64(eight) / 0.08))
	x2 := int(float64(ten) / 0.1)
	max1 := int(math.Ceil(float64(eight+1) / 0.08))
	max2 := int(float64(ten+1) / 0.1)

	if x1 != x2 {
		for ; x1 < max1; x1++ {
			for i := x2; i < max2; i++ {
				if x1 == i {
					x2 = i
					fmt.Fprint(out, x1)
					return
				}
			}
		}
		fmt.Fprint(out, "-1")
		return
	}

	fmt.Fprint(out, x1)
}


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

int main() {
    vector<ll> a(3);
    rep(i, 3) cin >> a.at(i);
    bool even = false;
    rep(i, 3) if (a.at(i) % 2 == 0) even = true;
    sort(a.begin(), a.end());

    if (even) cout << 0 << endl;
    else cout << a.at(0) * a.at(1) << endl;
    return 0;
}

Measured memory_bytes: 3616
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		int ans = 0;
		sc.close();

		for (int i = 1; i <= n; i+=2) {
			for (int j = 1; j <= i; j++) {
				if (i % j == 0) {
					count++;
				}

			}
			if (count == 8) {
				ans++;
			}
			count = 0;
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
int a,b,c;
bool check(){
	if(a<b&&b<c)
		return true;
	return false;
}
int main(){
	cin>>a>>b>>c;
	int k;
	cin>>k;
	if(check()){
		cout<<"Yes"<<endl;
	}else{
		for(int i=1;i<=k;i++){
			if(c<=b){
				c=c*2;
			}else if(b<=a){
				b=b*2;
			}
		}
		if(check()){
			cout<<"Yes"<<endl;
		}else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3620
#include<stdio.h>
#include<string.h>

int main(void){
    char s[101], t[51], u[51];
    int i, length, hLength, n;

    scanf("%s",s);
    length = strlen(s); hLength = length/2;
    for(i=0; i<hLength; i++){
        t[i] = s[i];
        u[i] = s[length-1-i];
    }
    t[hLength] = '\0';
    u[hLength] = '\0';

    i = 0;  n = 0;  
    while(t[i] != '\0'){
        if(u[i] != t[i]){
            u[i] = t[i];
            n++;
        }
        i++;
    }
    printf("%d\n",n);
    return 0;
}

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

#define llint long long int
#define pb push_back

using namespace std;

int main(){
  int n, m, x, y;
  cin >> n >> m >> x >> y;
  int xs[n], ys[m];
  for(int i = 0; i < n; i++)
    cin >> xs[i];
  for(int i = 0; i < m; i++)
    cin >> ys[i];
  sort(xs, xs+n);
  sort(ys, ys+m);
  int l = max(x, xs[n-1]);
  int r = min(y, ys[0]);
  if(r > l)
    cout << "No War";
  else
    cout << "War";
  return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<functional>
#include <random>
#include<iostream>
#include<iomanip>
using namespace std;


int main() {
	int R;
	cin >> R;
	cout << (double)R * 2 * 3.14159265358979;
}

Measured memory_bytes: 3784
#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

void Eratos(bool isp[],ll n){
    rep(i,n) isp[i]=1;
    for(ll i=2;i*i<n;i++){
        if(isp[i]){
            for(ll j=i;i*j<n;j++){
                isp[i*j]=0;
            }
        }
    }
}

int main(){
    ll q,np[(ll)1e5+1]={},cnt=0,l,r;
    bool isp[(ll)1e5+1];
    cin>>q;
    Eratos(isp,1e5+1);
    for(ll i=3;i<1e5+1;i++){
        if(isp[i]&&isp[(i+1)/2]) cnt++;
        np[i]=cnt;
    }
    rep(i,q){
        cin>>l>>r;
        cout<<np[r]-np[l-1]<<endl;
    }
    return 0;
}

Measured memory_bytes: 1536
import sys
input = sys.stdin.readline
sys.setrecursionlimit(pow(10, 6))

def main():
    q = int(input())
    ab = [tuple(map(int, input().split())) for _ in range(q)]
    for a, b in ab:
        if a > b:
            a, b = b, a
            
        if a == b or a + 1 == b:
            print(2 * a - 2)
        else:
            low, high = 1, pow(10, 9) + 5
            while low < high:
                mid = (low + high) // 2
                if mid * mid < a * b:
                    low = mid + 1
                else:
                    high = mid
            if low * (low - 1) >= a * b:
                print(2 * (low - 1) - 2)
            else:
                print(2 * (low - 1) - 1)                    


if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
import java.util.*;
import java.lang.Math;
public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int max = (int) -Math.pow(10, 9);
		int min = scan.nextInt();

		for (int i = 0; i < n - 1; i++) {
			int r = scan.nextInt();
			max = Math.max(max, r - min);
			min = Math.min(min, r);
		}
		System.out.println(max);	
	}
}


Measured memory_bytes: 99036
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int a = sc.nextInt();
    int b = sc.nextInt();
    if (a<=b) {
      System.out.println(a);
    } else {
      System.out.println(a-1);
    }
  }
}


Measured memory_bytes: 21844
#include <iostream>
#include <vector>
#define rep(i,N) for(int i = 0; i<(int)(N); i++)
#define REP(i,k,N) for(int i = k; i<(int)(N); i++)
#define INF 100000000
typedef long long ll;
using namespace std;

int main(){
        int n;
        cin >> n;
        vector< vector<int> > G(n, vector<int>(n,INF));
        int u,k,v,c;
        rep(i,n){
                cin >> u >>k;
                rep(j,k){
                        cin >> v >> c;
                        G[u][v] = c;
                }
        }

        vector<ll> d(n, INF * n);
        d[0]=0;
        bool update = true;
        while(update) {
                update  = false;
                rep(from,n) {
                        if(d[from] >= INF * n) continue;

                        rep(to,n){
                                if(from == to) continue;

                                if(d[to] > d[from] + G[from][to]) {
                                        update = true;
                                        d[to] = d[from] + G[from][to];
                                }

                        }
                }
        }
        rep(i,n){
                cout << i << " " << d[i] << endl;
        }

        return 0;
}



Measured memory_bytes: 3120
#include <bits/stdc++.h>
using namespace std;
long long a,b,ans,k;
int main()
{
    cin>>a>>b;
    k=((long long)(b/a));
    while(k)
	{
		k/=2;
		ans++;
	}
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
    string s ;
    cin >> s ;
    size_t n = s.length() ;
    bool flag = true ;
    for(int i = 0 ; i < n /2 ; i++){
         if(s[i] != s[n-1-i]){
              flag = false ;
         }
    }
    for(int j = 0 ; j < (n-1) / 4 ; j++){
         if(s[j] != s[((n - 1)/2) -1 - j]){
              flag = false ;
         }
    }

    for(int k = 0 ; k < (n-3) / 4 ; k++){
         if(s[n-1-k] != s[((n + 3)/2)-1 + k ]){
              flag = false ;
         }
    }


    if(flag == true){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }


    return 0;
}

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

string decode(string s){
	for(int i=0 ; i<(int)s.size() ; i++ ){
		char c = s[i] - 'A';
		c = (c + 26 - 3) % 26;
		s[i] = c + 'A';
	}
	return s;
}

int main(){
	string s;
	cin >> s;
	cout << decode( s ) << endl;
}

Measured memory_bytes: 0
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	x := nextInt()

	for i := x / 100; i <= x; i++ {

		if i*100 <= x && x <= i*105 {
			fmt.Println(1)
			return
		}
	}

	fmt.Println(0)

}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // Default=64
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 1780
def main():

    s = input()
    x, y = map(int, input().split())
    n = len(s)

    x1, y1 = 0, 0
    i = 0
    while i < n and s[i] == "F":
        x1 += 1
        i += 1

    count = 0
    UD = []
    LR = []
    while i < n:
        if s[i] == "T":
            count += 1
            i += 1
        else:
            d = 0
            while i < n and s[i] == "F":
                d += 1
                i += 1
            if count % 2 == 1: UD.append(d)
            else: LR.append(d)

    s1 = set([x1])
    for v in LR:
        temp = set()
        for u in s1:
            temp.add(u+v)
            temp.add(u-v)
        s1 = temp
    if x not in s1:
        return "No"
    s2 = set([0])
    for v in UD:
        temp = set()
        for u in s2:
            temp.add(u+v)
            temp.add(u-v)
        s2 = temp
    if y not in s2:
        return "No"

    return "Yes"




if __name__ == '__main__':
    print(main())

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

int main() {
    int n;
    cin >> n;
    char s[n];
    int c = 0, cc = 0;

    for (int i = 0; i < n; i++)
    {
        cin >> s[i];
        if(s[i]=='I')
        {
            cc++;
            c = max(c, cc);
        }
        else
        {
            cc--;
            c = max(c,cc);
        }
    }
    cout << c << endl;
    return 0;
}

Measured memory_bytes: 3640
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

int main() {
    ll x;
    cin >> x;
    ll i = 1;
    while (true) {
        if (2 * x <= i * (i + 1)) {
            cout << i << endl;
            return 0;
        }
        i++;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef string::const_iterator State;
class ParseError
{
};
int expr(State &begin);
int P, Q, R;
int NOT(int x)
{
    return 2 - x;
}
int AND(int x, int y)
{
    return min(x, y);
}
int OR(int x, int y)
{
    return max(x, y);
}
int main()
{
    string S;
    while (cin >> S)
    {
        if (S == ".")
            return 0;
        int ans = 0;
        for (P = 0; P < 3; P++)
        {
            for (Q = 0; Q < 3; Q++)
            {
                for (R = 0; R < 3; R++)
                {
                    State c = S.begin();
                    if (expr(c) == 2)
                        ans++;
                }
            }
        }
        cout << ans << endl;
    }
}
//パースして、その評価結果を返す。
int expr(State &begin)
{

    int ret;
    if (*begin == 'P')
        ret = P;
    else if (*begin == 'Q')
        ret = Q;
    else if (*begin == 'R')
        ret = R;
    else if (isdigit(*begin))
        ret = *begin - '0';
    else if (*begin == '-')
    {
        begin++;
        return NOT(expr(begin));
    }
    else if (*begin == '(')
    {
        begin++;
        ret = expr(begin);
        if (*begin == '*')
        {
            begin++;
            ret = AND(ret, expr(begin));
        }
        else if (*begin == '+')
        {
            begin++;
            ret = OR(ret, expr(begin));
        }
    }
    begin++;
    return ret;
}



Measured memory_bytes: 3228
#include <cstdio>
int main(int argc, char *argv[]) {
  int h, w;
  for (;;) {
    scanf("%d%d", &h, &w);
    if (h == 0 && w == 0) break;
    for (int i = 0; i < w; i++) {
      putchar('#');
    }
    putchar('\n');
    for (int j = 2; j < h; j++) {
      putchar('#');
      for (int k = 2; k < w; k++) {
        putchar('.');
      }
      printf("#\n");
    }
    for (int l = 0; l < w; l++) {
      putchar('#');
    }
    printf("\n\n");
  }
  return 0;
}



Measured memory_bytes: 2544
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const int64_t LINF=8931145141919364364,LMOD=998244353;
// const int dy[]={0,-1,0,1,1,-1,-1,1};
// const int dx[]={1,0,-1,0,1,1,-1,-1};

int main() {
	int64_t h; cin >> h;
	int64_t cnt = 1;
	int64_t ans = 0;
	while(h > 0) {
		ans += cnt;
		h /= 2;
		cnt *= 2;
	}
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 256
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

n,a,b = na()
tot = 0
ans = 0
for i in range(1,n+1):
    for j in list(str(i)):
        tot += int(j)
    if a <= tot <= b:
        ans += i
    tot = 0
print(ans)


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


int dp[101][4][4][4];

int main() {
	int N;
	cin >> N;
	
	//長さ0の文字列は1である。
	//0,1,2に関する制約しかないので、
	//Sは、333Sと考えても問題がない。
	dp[0][3][3][3] = 1;

	int mod = 1'000'000'007;

	//文字列の文字数
	for (int len = 0; len < N; len++)
	{
		//最後から1文字目の文字
		for (int c1 = 0; c1 < 4; c1++)
		{
			//最後から2文字目の文字
			for (int c2 = 0; c2 < 4; c2++)
			{
				//最後から3文字目の文字
				for (int c3 = 0; c3 < 4; c3++)
				{
					//条件に当てはまるものがない場合はcontinue;
					if (dp[len][c1][c2][c3] == 0) continue;

					//新しく追加する文字
					for (int a = 0; a < 4; a++)
					{
						//ダメな5つの条件をカットする
						if (a == 2 && c1 == 1 && c2 == 0) continue;
						if (a == 2 && c1 == 0 && c2 == 1) continue;
						if (a == 1 && c1 == 2 && c2 == 0) continue;
						if (a == 2 && c1 == 1 && c3 == 0) continue;
						if (a == 2 && c2 == 1 && c3 == 0) continue;

						//ダメな条件を抜けたら、aを足した文字列が作れる

						// S = ...... c3 c2 c1
						// nextS = ...... c2 c1 a

						dp[len + 1][a][c1][c2] += dp[len][c1][c2][c3];
						dp[len + 1][a][c1][c2] %= mod;
					}
				}
			}
		}
	}

	int ans = 0;

	//長さNの全部の答えを纏める
	//最後から1文字目の文字
	for (int c1 = 0; c1 < 4; c1++)
	{
		//最後から2文字目の文字
		for (int c2 = 0; c2 < 4; c2++)
		{
			//最後から3文字目の文字
			for (int c3 = 0; c3 < 4; c3++)
			{
				ans += dp[N][c1][c2][c3];
				ans %= mod;
			}
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

#define MAXLEN 65536

int main(void){
	int n;
	char src[MAXLEN], *p, *q;
	int ch, cnt;
	
	while (scanf("%d", &n), n){
		scanf("%s", src);
		for (int i=0; i<n; i++){
			char buf[MAXLEN] = {0};
			ch = *src;
			cnt = 1;
			q = buf;
			for (p = src+1; 1; p++){
//				printf("p=<%s>, buf=<%s>, (ch=%c, cnt=%d)\n", p, buf, ch, cnt);
				if (*p==ch){
					cnt++;
				}
				else {
					char tmp[100];
					sprintf(tmp, "%d", cnt);
					strcpy(q, tmp);
					q += strlen(tmp);
					*q++ = ch;
					ch = *p;
					cnt = 1;
					if (ch==0) break;
				}
			}
			strcpy(src, buf);
		}
		puts(src);
	}
	return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a,b;
    cin>>a>>b;
    if(a+b<10)
     cout<<a+b;
    else 
     cout<<"error";
    return 0;
}
    

Measured memory_bytes: 3656
//↓見なくていいよ！ここから--------------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  myerr("-----start-----");
  var start = new Date();
  Main();
  var end = new Date() - start;
  myerr("----- end -----");
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//↑見なくていいよ！ここまで--------------------------------------------------
function Main(){
	var s = next();
	var mae = myconv(s,6);
	var ato = myconv(s,6);
	var len = s.length;
	/*for(var i = len - 1; i >= 0; i--){
		if(mae[i] == "?"){
			if(mae[i + 1] == "D"){
				mae[i] = "P";
			}else{
				mae[i] = "D";
			}
			
		}
	}*/
	for(var i = 0; i < len; i++){
		if(ato[i] == "?"){
			if(ato[i - 1] == "P"){
				ato[i] = "D";
			}else if(ato[i - 1] == "D" && (ato[i + 1] == "?" || ato[i + 1] == "D")){
				ato[i] = "P";
			}else{
				ato[i] = "D";
			}
			
		}
	}
	
	myout(myconv(ato,0));
}


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

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var l = Console.ReadLine().Split().Select(long.Parse).ToArray();
            long K = l[0], A = l[1], B = l[2];

            if (B - A <= 2)
            {
                Console.WriteLine(K + 1);
            }
            else
            {
                K -= (A - 1);
                var ans = A + (B - A) * (K / 2) + K % 2;
                Console.WriteLine(ans);
            }
        }
    }
}


Measured memory_bytes: 13396
void main() {
	writefln("ABC%d", ri);
}

// ===================================

import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


Measured memory_bytes: 256
import Control.Monad
import Data.Function
import Data.Char
import Data.List
import Text.Read
import Text.ParserCombinators.ReadPrec

import qualified Data.ByteString.Char8 as B

newtype Pair a b = Pair { getPair :: (a, b) }

instance (Read a, Read b) => Read (Pair a b) where
  readPrec = Pair `dot` (,) <$> readPrec <* get <*> readPrec

instance (Show a, Show b) => Show (Pair a b) where
  show (Pair (a, b)) = show a ++ " " ++ show b

infixr 8 `dot`
dot :: (c -> d) -> (a -> b -> c) -> a -> b -> d
dot = ((.).(.))

main :: IO ()
main = do
  xs <- map read . words <$> getLine
  print $ solve xs

solve :: [Int] -> Int
solve = fst . head . filter (\(i, x) -> x == 0) . zip [1..]


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

using namespace std;

u_int seed = 3;
u_int xor_shift()
{
    seed ^= seed << 1;
    seed ^= seed >> 3;
    seed ^= seed << 10;
    return seed;
}

chrono::system_clock::time_point start_time;
int elapsed()
{
    auto cur = chrono::system_clock::now();
    return chrono::duration_cast<chrono::milliseconds>(cur - start_time).count();
}

int main(){
    int h, w, m;
    cin >> h >> w >> m;
    start_time = chrono::system_clock::now();
    set<array<int, 2>> bomb;
    vector<int> cnt_h(h), cnt_w(w);
    for (int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        bomb.insert({--a, --b});
        cnt_h[a]++;
        cnt_w[b]++;
    }

    auto max_ = [](vector<int>& A){return accumulate(A.begin(), A.end(), 0, [](auto &l, auto &r){return max(l, r);});};
    int ma_h = max_(cnt_h);
    int ma_w = max_(cnt_w);

    bool flag = false;
    vector<int> H, W;
    for (int i = 0; i < h; i++){
        if (cnt_h[i] != ma_h)
            continue;
        H.push_back(i);
    }

    for (int j = 0; j < w; j++){
        if (cnt_w[j] != ma_w)
            continue;
        W.push_back(j);
    }

    while (elapsed() < 1980){
        int rh = xor_shift() % H.size();
        int rw = xor_shift() % W.size();
        flag |= !bomb.count({H[rh], W[rw]});
    }

    flag |= H.size() * W.size() > m;
    cout << (ma_h + ma_w - (flag ? 0 : 1)) << endl;
}

Measured memory_bytes: 23808
#include <bits/stdc++.h>
using namespace std;
const int N=2e5+5;
char tmp[N];
pair<int,string> A[N];
map<string , int> idx;
map<string , int>mp;
map<int,vector<string> > rmp;
int main()
{
    int n,mx=-1;
    scanf("%d",&n);
    string s;
    for(int i=0;i<n;++i){
        scanf("%s",tmp);
        string s(tmp);
        mx = max(mx,++mp[s]);
        rmp[mp[s]].push_back(s);
    }
    sort(rmp[mx].begin(),rmp[mx].end());
    for(auto x:rmp[mx]){
        printf("%s\n",x.c_str());
    }

    return 0;
}


Measured memory_bytes: 34560
#include <iostream>
#include <string>
#include <cmath>
#include <sstream>
#include <iomanip>

using namespace std;

int main(int argc, char* argv[])
{

	int A,B,C;
	int ans=0;

	cin >> A >> B >> C;

	cout << ((A+B>=C) ? "Yes" : "No" ) << endl;

	return 0;

}

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


void solve()
{
	string s;
	cin >> s;
	if(s[s.length()-1]=='s')
	{
		s+='e';
		s+='s';
	}
	else
	{
		s+='s';
	}
	cout << s << endl;
	

	
}

int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    // int t;
    // cin >> t;
    // while (t--)
    // {
    //     solve();
    // }
    
   solve();
    return 0;
    
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
 
int main(){
 
  string s;
  cin >> s;
  if (s[0] == '7' || s[1] == '7' || s[2] == '7' ) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}

Measured memory_bytes: 3576
#include<stdio.h>

int main(void){
    int N=0;
    int D=0;
    int s=0;
    scanf("%d %d",&N,&D);
    s=2*D+1;
    if(N%s==0){
        printf("%d\n",N/s);
    }
    else{
        printf("%d\n",(N/s)+1);
    }
    return 0;
}

Measured memory_bytes: 128
#include<stdio.h>
#include<string.h>
#include<ctype.h>

int main(){

  int i=0;
  int count=0;

  char w[10],t[1000];

  scanf("%s",w);
  for(i=0;w[i];i++)
      w[i]=tolower(w[i]);

  while(1){
    scanf("%s",t);
    if(strcmp("END_OF_TEXT",t)==0)
      break;
    for(i=0;t[i];i++)
      t[i]=tolower(t[i]);
    if(strcmp(w,t)==0)
      count++;
  }
  printf("%d\n",count);

  return 0;
}

Measured memory_bytes: 1836
import java.io.*;
import java.util.*;

public class Main{
	public static void main(String[] args) throws Exception {
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		Scanner s = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		int n = Integer.parseInt(f.readLine().trim());
		long[] vals = new long[n];
		for(int i = 0; i < n; i++) 
			vals[i] = Integer.parseInt(f.readLine().trim());
		long ans = 0, curSum = 0;
		for(int i = 0; i < n; i++) {
			if(vals[i] == 0) {
				ans += curSum/2;
				curSum = 0;
			}
			curSum += vals[i];
		}
		ans += curSum/2;
		System.out.println(ans);
	}
}

Measured memory_bytes: 20944