akhauriyash/Code-Regression huggingface dataset:
/*
*
*	AUTHOR :- @soham01
*		// "WORK HARD AND NEVER GIVE UP" //
*
*/
#include "bits/stdc++.h"

using namespace std;

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

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> //find_by_order(), order_of_key()
#define pb push_back
#define mp make_pair
#define vi vector<long long int >
#define vb vector<bool>
#define vs vector<string>
#define vd vector<double>
#define vvi vector<vector<long long int> >
#define vp vector<pair<long long int , long long int > >
#define seti set<long long int >
#define setc set<char>
#define setd set<double>
#define mod 1000000009
#define endl '\n'
typedef long long int lli;

// ITS MY REQUEST TO PLEASE PLEASE DO LOOK AT THE CONSTRAINS GIVEN CAREFULLY
// DO CHECK FOR CORNER CASES

/*-------LET THE GAME BEGIN-----------*/

void solve()
{
	string s;
	cin >> s;
	lli l;
	l = s.size();
	if (s[l - 1] == 's')
	{
		cout << s << "es" << endl;
	}
	else if (s[l - 1] != 's')
	{
		cout << s << 's' << endl;
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	solve();
	return 0;
}


Measured memory_bytes: 3644
#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SORT(V);REV(V) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define Yay(n) cout << ((n) ? "Yay!": ":(") << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define VSUM(V) accumulate(ALL(V), 0)
#define MID(a,b,c) (a) < (b) && (b) < (c)
#define MIDe(a,b,c) (a) <= (b) && (b) <= (c)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define IN4(a,b,c,d) cin >> a >> b >> c >> d
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(i, (V).size()) {cout << (V)[i] << endl;}
#define VOUT2(V) REP(i, (V).size()) {cout << (V)[i] << " ";} cout<<endl;

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define Vd vector<double>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
//

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int gcd(int a,int b){return b != 0 ? gcd(b, a % b) : a;} //最大公約数
int lcm(int a, int b){return a * b / gcd(a, b);}
string toStrUp(string str){char diff = 'A'-'a';REP(i,str.size()) str[i] += diff;return str;}
string gCh(string str, int key){return str.substr(key,1);}

signed main() {
  RAPID;
  // デフォルト変数定義
  int n=0,m=0,a=0,b=0,c=INF,d=0,x=0,y=0,z=0;
  string s="",t="";
  //

  // ここから
  Vi v(5);
  VIN(v)
  REP(i,5){
    if(v[i]%10!=0) {
      if(min(c, v[i]%10) == v[i]%10){
        c = v[i]%10;
        y = i;
      }
    }
  }
  REP(i,5){
    if(i != y){
      while(v[i]%10!=0) v[i]++;
      m+=v[i];
    }
  }
  if(c==INF) c=0;
  OUT(m+v[y]);
}

Measured memory_bytes: 256
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <bitset>
typedef long long ll;
typedef unsigned long long ull;

# define INF 0x3f3f3f3f

#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define DEBUG(vec) for (auto v : vec) { cout << v << " "; } cout << endl;

using namespace std;

string prefixes[4] = {"maerd", "remaerd", "esare", "resare"};

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

  string S;
  cin >> S;
  reverse(S.begin(), S.end());

  int pos = 0;
  while (pos < S.size()) {
    bool ok = false;
    REP(i, 4) {
      string prefix = prefixes[i];
      if (equal(prefix.begin(), prefix.end(), S.begin() + pos)) {
        pos += prefix.size();
        ok = true;
        break;
      }
    }
    if (!ok) {
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;
  return 0;
}


Measured memory_bytes: 512
import math


def main():
    N = int(input())

    if N == 0 or N == 1:
        ans = 0

    elif N % 2 == 0:
        B = N // 2
        n = math.floor(math.log(B) / math.log(5))

        ans = 0
        for i in range(1, n + 1):
            ans += B // (5**i)

    else:
        ans = 0

    print(int(ans))


main()


Measured memory_bytes: 3060
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
ab = [(x,y) for x,y in zip(a,b)]
ab.sort(key = lambda x:x[1])
a = list(list(zip(*ab))[0])
ai = [[a[i],i] for i in range(n)]
flg = 0
if len(set(b)) == n:
  ai.sort()
  for i in range(n):
    ai[i][0] = i
  ai.sort(key = lambda x:x[1])
  idc = list(zip(*ai))[0]
  cnt = 0
  plc = 0
  while True:
    plc = idc[plc]
    cnt += 1
    if plc == 0:
      break
  if cnt == n:
    flg = 1
a.sort()
b.sort()
for x,y in zip(a,b):
  if x > y:
    print("No")
    exit()
if not flg:
  print("Yes")
else:
  for i in range(1,n):
    if a[i] <= b[i-1]:
      print("Yes")
      exit()
  print("No")

Measured memory_bytes: 105412
#include<iostream>
#include<cctype>

#define MAX_LEN 1000002

using namespace std;

typedef pair<string,int> parsed;
parsed parse(const string &expr, int i)
{
  parsed ret;
  string s;

  int d=1;
  if( isdigit( expr[i] ) ){
    d=0;
    while( isdigit( expr[i] ) ){
      int t = expr[i++]-'0';
      d*=10;
      d+=t;
    }
  }

  if( expr[i] == '(' ){
    ++i;
    while(expr[i]!=')'){
      parsed p = parse(expr,i);
      s += p.first;
      i = p.second;
    }
    ++i;
  }else{
    while( isalpha( expr[i] ) ){
      s+=expr[i++];
    }
  }

  for(int j = 0; j < d; ++j){
    ret.first+=s;
    if( ret.first.length() > MAX_LEN )
      break;
  }

  ret.second = i;
  return ret;
}

char solve(const string &expr, int n)
{
  parsed ans;

  while(ans.second<expr.size()){
    parsed p = parse(expr,ans.second);
    ans.first += p.first;
    if(ans.first.length()>MAX_LEN)break;
    ans.second = p.second;
  }
  //if(ans.first.length()<500)
    //cout<<"RESULT:"<<ans.first<<endl;

  if(n<0||n>=ans.first.length())
    return '0';
  else
    return ans.first[n];

}

int main()
{
  while(true){
    string expr;
    int n;
    cin>>expr>>n;
    if(expr=="0"&&n==0)
      break;
    cout << solve(expr,n) << endl;
  }
  return 0;
}

Measured memory_bytes: 5272
#include<iostream>
#include<iomanip>
#include<math.h>
using namespace std;
int main(){
	int n,a[5],b[5];
	double c[2]={-1,-1},d[2]={-1,-1},e,f;
	cin>>n;
	for(int u=0;u<n;u++){
		for(int i=0;i<5;i++)cin>>a[i];
		if(u){
			if(a[2]==b[2]&&a[1]!=b[1]){
				e=sqrt((a[3]-b[3])*(a[3]-b[3])+(a[4]-b[4])*(a[4]-b[4])+0.0);
				f=(a[0]-b[0])/60.0;
				if(c[a[2]]<e||(c[a[2]]==e&&d[a[2]]>f)){
					c[a[2]]=e,d[a[2]]=f;
				}
			}
		}
		for(int i=0;i<5;i++)b[i]=a[i];
	}
	for(int i=0;i<2;i++)
	cout<<fixed<<setprecision(10)<<c[i]<<" "<<d[i]<<endl;
	return 0;
}

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

using db  = double;
using ll  = long long;
using ull = unsigned long long;
using pII = pair <int, int>;
using pLL = pair <ll, ll>;

#define F                  first
#define S                  second
#define MP                 make_pair
#define PB                 push_back
#define deb(X)             cout << (X) << endl
#define ASH(X)             cout << (X) << " "
#define aLL(X)             X.begin(),X.end()
#define vLL(X)             array<ll,X>
#define s(X)               ((ll)(X).size())
#define deb1(x)            cout << #x << " " << x << endl;
#define deb2(x,y)          cout << #x << " " << x << " " << #y << " " << y << endl;
#define deb3(x,y,z)        cout << #x << " " << x << " " << #y << " " << y <<" "<< #z << " " << z << endl;
#define FOR(I,A,B)         for(ll I = (A); I <= (B); I++)
#define RFOR(I,B,A)        for(ll I = (B); I >=(A); I--)
#define mem0(X)            memset((X), 0, sizeof((X)))
#define mem1(X)            memset((X), -1, sizeof((X)))
#define BS(v,x)            binary_search(v.begin(),v.end(),x)
#define SORT(c)            (sort(c.begin(),c.end()))
#define Time               cerr<<"Time elapsed: "<<1.0*clock()/CLOCKS_PER_SEC<< "sec \n"
#define SORT_UNIQUE(c)     (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x)       (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASES int ___T;    cin >> ___T; for(int cs=1;cs<=___T;cs++)
#define IOS                ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);


/************************************************/

void Solve(){
  ll n,k;
    cin>>n>>k;
 vector<ll>A(n,0);
  FOR(i,0,n-1){
    cin>>A[i];
  }

  FOR(i,0,n-k-1){
    if(A[i]<A[i+k]){
      cout<<"Yes\n";
    }
    else{
      cout<<"No\n";
    }
  }
}

    int32_t main() {

        Solve();

    }




Measured memory_bytes: 4840
#include <iostream>

int main(void)
{
    int a, b, c;
    std::cin >> a >> b >> c;
    int total = a * 100 + b * 10 + c;
    bool flag = (total % 4) == 0;
    std::cout << (flag ? "YES" : "NO") << std::endl;
    return 0;
}


Measured memory_bytes: 256
{-# OPTIONS_GHC -O2 #-}
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.ByteString.Char8 as BSC8
main :: IO ()
main = do
  s <- BSC8.getLine
  BSC8.putStrLn $ solve s
solve :: BSC8.ByteString -> BSC8.ByteString
solve bs = if a == b then "Yes" else "No"
  where
    a = BSC8.take n       bs
    b = BSC8.drop (n + 1) bs
    n = (BSC8.length bs) `div` 2

Measured memory_bytes: 3692
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef unsigned long long int ll;

int main()
{
	string str;
	int k;
	cin>>str;
	cin>>k;
	char ans = str[0];
	for(int i = 0; i < min((int)k,(int)str.size()); i++){
		if(str[i] !='1'){
			ans = str[i];
			break;
		}
	}
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 256
package main

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

var stdin = bufio.NewScanner(os.Stdin)

func main() {
	stdin.Split(bufio.ScanWords)
	var K, A, B int
	K = nextInt()
	A = nextInt()
	B = nextInt()

	for i := A; i <= B; i++ {
		if i%K == 0 {
			fmt.Println("OK")
			os.Exit(0)
		}
	}
	fmt.Println("NG")
}

func nextInt() int {
	stdin.Scan()
	i, err := strconv.Atoi(stdin.Text())
	if err != nil {
		panic(err)
	}
	return i
}

Measured memory_bytes: 1760
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
//カッコイイ解法
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<long long> vec(n);
    for(int i=0;i<n;i++){
        int x;
        cin >> x;
        vec[i]=x;
    }
    int negative_count=0;
    for(int i=0;i<n;i++){
        if(vec[i]<0){
            negative_count++;
        }
    }
    long long count = 0;
    if(negative_count % 2 == 0){
        for(int i=0;i<n;i++){
            count += abs(vec[i]);
        //    cout<<"全部足す"<<endl;
        }
    }else{
        for(int i=0;i<n;i++){
            vec[i]=abs(vec[i]);
        }
        sort(vec.begin(),vec.end());
        count -= abs(vec[0]);
        for(int i=1;i<n;i++){
            count += abs(vec[i]);
        }
    }
    cout<< count<<endl;
}

Measured memory_bytes: 1024
///created: 29/May/2019 10:17:32

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
ll n, ans = 0;

void dfs(ll u, int s) {
	if (u > n) return;
	if (s == 7) ans++;
	dfs(u * 10 + 7, s | 1);
	dfs(u * 10 + 5, s | 2);
	dfs(u * 10 + 3, s | 4);
}

int main() {
	scanf("%lld", &n);
	dfs(0, 0);
	printf("%lld", ans);
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
typedef long long ll;

int main(){
  int n;
  while(cin>>n)
  {
    if(n==0) return 0;
    int sum = 0;
    int mx = 0, mn = 9999;
    FOR(i,0,n)
    {
      int in;
      cin>>in;
      sum += in;
      mx = max(mx,in);
      mn = min(mn,in);
    }
    sum -= mx;
    sum -= mn;
    cout << sum/(n-2) << endl;
  }
  return 0;
}

Measured memory_bytes: 3044
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
  N = int(input())

  if (N % 10) in (2, 4, 5, 7, 9):
    print('hon')
  elif (N % 10) in (0, 1, 6, 8):
    print('pon')
  else:
    print('bon')


if __name__ == '__main__':
  main()


Measured memory_bytes: 61864
#include<cstdio>
int n, w[101000];
long long sum;
int gcd(int a, int b){
    return b?gcd(b,a%b):a;
}
void Print(int ck){
    if(!ck)printf("First\n");
    else printf("Second\n");
}
int main(){
    int i, pv = 0, ck = 0;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&w[i]);
    }
    while(1){
        int c = 0;
        sum = 0;
        for(i=1;i<=n;i++){
            sum += w[i];
            if(w[i]&1)c++,pv=i;
        }
        if(sum%2!=n%2){
            Print(ck);
            return 0;
        }
        if(c!=1 || w[pv] == 1){
            Print(!ck);
            return 0;
        }
        w[pv]--;
        int g = 0;
        for(i=1;i<=n;i++)g = gcd(g,w[i]);
        for(i=1;i<=n;i++)w[i]/=g;
        ck = !ck;
    }
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <cmath>
#include <math.h>
using namespace std;
int main(void){
    long long x, y;
    cin >> x;
    y = floor(log2(x));
    long long k = pow(2,y+1) - 1;
    cout << k << endl;
    return 0;
}

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


int main() {
	ll d, t, s;
	cin >> d >> t >> s;
	ll dis = t*s;
	if(dis >= d) {
		cout << "Yes\n";
	}
	else{
		cout << "No\n";
	}
}

Measured memory_bytes: 3632
n, a, b = map(int, input().split())
num = 0
sum1 = 0
for num in range(n+1):
    s = str(num)
    sum2 = 0
    for i in range(len(s)):
        sum2 += int(s[i])
    if sum2 >= a and sum2 <= b:
        sum1 += num
print(sum1)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int[] r = new int[200000];
		
		int n = stdIn.nextInt();
		
		for (int i = 0; i < n; i++)
			r[i] = stdIn.nextInt();
		
		int ans = calcMaxDifference(r, n);
		System.out.println(ans);
	}
	
	public static int calcMaxDifference(int[] r, int n) {
		int max = r[1] - r[0];
		int rmin = r[0];
		
		for (int i = 1; i < n; i++) {
			max = (max > r[i] - rmin ? max : r[i] - rmin);
			rmin = (rmin < r[i] ? rmin : r[i]);
		}
		return max;
	}
}

Measured memory_bytes: 102256
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
    int N;
    cin >> N;
    int cnt = 0;
    for(int i = 0; i < N; i++){
        int a;
        cin >> a;
        if( a % 2 == 0){
            while(a > 1){
                if(a % 2 == 0){
                    a /= 2;
                    cnt++;
                }
                else 
                break;
            }
        }
    }
    cout << cnt << endl;
}

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

#define show(x) cerr << #x << " = " << x << endl ;
#define input_from_file freopen("input.txt","r",stdin)
#define output_to_file freopen("output.txt" , "w",stdout)
#define fastio ios_base::sync_with_stdio(0)
#define endl '\n'

const int M = 1e3+1 ,  N = 1 << 12; 
int ai[M] , ci[M] , dp[N];
int main()
{
	 #ifdef LOCAL
        input_from_file;
        output_to_file;
    #endif
	fastio;cin.tie(0);cout.tie(0);
	int n , m , x , y; cin >> n >> m ;
	for(int i = 0 ; i < m ; ++i)
	{
		cin >> ai[i] >> x ;
		for(int j = 0 ; j < x ; ++j)
		{
			cin >> y ;
			ci[i] |= (1 << (y - 1));
		}
	}
	int k = 1 << n ;
	fill(dp , dp + k , INT_MAX);
	dp[0] = 0;
	for(int mask = 0 ; mask < k ; ++mask)
	{
		if(dp[mask] == INT_MAX) continue;
		for(int i = 0 ; i < m ; ++i)
			dp[mask|ci[i]] = min(dp[mask | ci[i]] , dp[mask] + ai[i]);
	}
	cout << (dp[k-1] != INT_MAX ? dp[k-1] : -1);

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007
#define pb push_back
#define ll long long
#define ld long double
#define llu ll unsigned
#define ft first
#define sd second
using namespace std;
 
string to_string(string s){return '"'+s+'"';}string to_string(const char* s){return to_string((string)s);}string to_string(bool s){return to_string((int)s);}template <typename A, typename B>string to_string(pair<A, B> p){return "("+to_string(p.first)+", "+to_string(p.second)+")";}template<typename A>string to_string(A v){bool first=true;string res="{";for(const auto&x:v){if(!first){res+=", ";}first = false;res+=to_string(x);}res += "}";return res;}void debug_out(){cerr<<endl;}template<typename Head,typename... Tail>void debug_out(Head H,Tail... T){cerr<<" "<<to_string(H);debug_out(T...);}
#ifdef LOCAL
#define err(...)cerr<<"["<<#__VA_ARGS__<<"]:",debug_out(__VA_ARGS__)
#else
#define err(...) 42
#endif
 
const ld eps = 1e-12;
const int N = 1e5+9;

int col[750], g[750][750], c1, c2, a[2][750], n;

bool dfs(int u, int c) {
	if(col[u] == 0) {
		col[u] = c;
		if(c == 1) c1 ++; else c2 ++;
	} else if(col[u] != c) return false;
	else return true;
	for(int i=1; i<=n; i++) if(u != i && !g[u][i]) {
		if(!dfs(i, 1 + (c == 1))) return false;
	}
	return true;
}


signed main() {
 
    // freopen("out.txt","w",stdout); 
    ios::sync_with_stdio(false); cin.tie(0);
    
    int m; cin >> n >> m;
    for(int i=1; i<=m; i++) {
    	int u, v; cin >> u >> v;
    	g[u][v] = g[v][u] = 1;
    }
    bool flag = 0; a[1][0] = a[0][0] = 1;
    for(int i=1; i<=n; i++) {
    	if(col[i] == 0) {
    		c1 = 0, c2 = 0, flag ^= 1;
    		if(!dfs(i, 1)) {
    			return cout << "-1\n", 0;
    		}
    		memset(a[!flag], 0, (n+1) * sizeof (int));
	    	for(int j=0; j<n; j++) {
	    		if(a[flag][j]) {
		    		a[!flag][j + c1] = a[!flag][j + c2] = 1;
		    		err(flag, j, c1, c2);
	    		}

	    	}
    	}

    }
    for(int i=n/2; i>=0; i--) {
    	if(a[!flag][i]) return cout << (i * (i - 1) / 2 + (n - i) * (n - i - 1) / 2) << endl, 0;
    }

    return 0; 
    
}  


Measured memory_bytes: 2304
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
int main()
{
	int n,a,b;
	scanf("%d",&n);
	if(n==1)
	printf("Hello World\n");
	else
	{
		scanf("%d%d",&a,&b);
		printf("%d\n",a+b);
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,x) for(int i = 0; i < x; i++)
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
const ll N = 1e9+7;
const int n_max = 1e5+10;


void print() {
    cout << endl;
}
 
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail) != 0) cout << ' ';
    print(forward<Tail>(tail)...);
}
 
template <class T>
void print(vector<T> &vec) {
    for (auto& a : vec) {
        cout << a;
        if (&a != &vec.back()) cout << ' ';
    }
    cout << endl;
}
 
template <class T>
void print(vector<vector<T>> &df) {
    for (auto& vec : df) {
        print(vec);
    }
}
 

int main(){
	ll n,m; cin >> n >> m;
	vector<ll> a(n),sum(n+1);
	map<ll,ll> mp;
	sum.at(0) = 0;mp[0] = 1;
	rep(i,n){
		cin >> a.at(i);
		sum.at(i+1) = sum.at(i) + a.at(i);
		sum.at(i+1) %= m;
		mp[sum.at(i+1)]++;
	}
	
	auto choice_2 = [](ll x) -> ll{
		if(x <= 1)return 0;
		return x * (x-1) / 2;
	};
	
	ll res = 0;
	for(auto itr = mp.begin();itr != mp.end();itr++){
		res += choice_2((*itr).second);
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 5760
#include <iostream>
#include <string>
#include <cstring>

using namespace std;
int main() {
    char number[9];
    int a,kum[9],sum,c;
    sum = 0;
    cin >> number;
    a = strlen(number);
    c = atoi(number);
    for (int i = 0; i < a; ++i) {
        kum[i] = number[i] - '0';
        sum = sum + kum[i];
    }
    if(c % sum == 0){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

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

int memo[201][201];

void init(){
  
  for(int i=1;i<=200;i++){
    for(int j=1;j<=200;j++){
      memo[i][j] = __gcd( i, j );
    }
  }
  
}

signed main(){
  
  init();
  
  int K;
  cin>>K;
  
  int sum = 0;
  
  for(int i=1;i<=K;i++){
    for(int j=1;j<=K;j++){
      for(int k=1;k<=K;k++){
	sum += memo[memo[i][j]][k];
	//sum += __gcd(__gcd(i,j),k);
      }
    }
  }
  
  cout<<sum<<endl;
  
  return 0;
}


Measured memory_bytes: 3960
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<cassert>
#include<numeric>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
const int INF = 1001001001;
const long long LINF = 1001002003004005006ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int,int> P;

int main(){
    int n;
    cin >> n;
    ll a[n];
    rep(i,n)cin >> a[i];
    ll m = 1000;
    rep(i,n-1){
        if(a[i]<a[i+1]){
            ll c = m/a[i];
            m%=a[i];
            m+=c*a[i+1];
        }
    }
    cout << m << endl;
}

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <cstdio>
#include <set>
#include <map>
#include <list>
#include <cstdlib>
#include <queue>
#include <stack>
#include <bitset>

using namespace std;

#define MOD 1000000007
#define PI 3.1415926535897932
#define rep(i, n) for (int i = 0; i < n; i++)
#define repe(i, j, n) for (int i = j; i < n; i++)
#define repi(i, n) for (int i = 0; i <= n; i++)
#define repie(i, j, n) for (int i = j; i <= n; i++)
#define all(x) x.begin(), x.end()
#define println() cout << endl
#define P pair<int, int>
#define fi first
#define se second

typedef long long ll;

long long modinv(long long a, long long m)
{
    long long b = m, u = 1, v = 0;
    while (b)
    {
        long long t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0)
        u += m;
    return u;
}

void solve1()
{
    ll a, b; cin >> a >> b;
    a--;
    ll ans = 0;
    ll div = 2;
    while(1) {
        ll bitnum1 = b/div*div/2;
        bitnum1 = b%div >= div/2? bitnum1 + b%div - div/2 + 1:bitnum1;

        ll bitnum2 = a / div*div/2;
        bitnum2 = a % div >= div / 2 ? bitnum2 + a % div - div / 2 + 1: bitnum2;

        if(bitnum1 >= 0 && bitnum2 >= 0) {
            if((bitnum1 - bitnum2)%2) {
                ans += div/2;
            }
        }

    

      
        if(2*b < div) {
            break;
        }

        div *= 2;
    }

    cout << ans << endl;

}

//11 = 11//2*1 + 11mod1 + 1
//12 = 12//8*4 + 12mod4 + 1

int main()
{
    solve1();
}


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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;

const ll big = 1000000007;
const ll mod = 998244353;

ll n,m,k,T;
string s;

unordered_map<ll,ll> M;

ll const base = 123;

ll basep[40] = {0};

ll has1(ll mask){
    ll ans = 0;
    ll m2 = mask;
    ll r1 = 0;
    ll r2 = n-1;
    for(int c1 = 0; c1 < n; c1++){
        if(m2%2 == 0){
            ans += (s[c1]-'a'+1)*basep[r1];
            r1++;
        }
        else{
            ans -= (s[c1]-'a'+1)*basep[r2];
            r2--;
        }
        m2 /= 2;
    }
    return ans;
}


ll has2(ll mask){
    ll ans = 0;
    ll m2 = mask;
    ll r1 = 0;
    ll r2 = n-1;
    for(int c1 = 2*n-1; c1 >= n; c1--){
        if(m2%2 == 1){
            ans -= (s[c1]-'a'+1)*basep[r1];
            r1++;
        }
        else{
            ans += (s[c1]-'a'+1)*basep[r2];
            r2--;
        }
        m2 /= 2;
    }
    return ans;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("autput.txt","w",stdout);
    ll a,b,c,d;
    a = 1;
    for(int c1 = 0; c1 < 40; c1++){
        basep[c1] = a;
            a *= base;
    }

    cin >> n;
    cin >> s;

    for(ll c1 = 0; c1 < (1 << n); c1++){
        ll h = has1(c1);
        if(M.find(h) == M.end())M[h] = 0;
        M[h]++;
    }

    ll ans = 0;
    for(int c1 = 0; c1 < (1 << n); c1++){
        ll h = has2(c1);
        ll h2 = -h;
        if(M.find(h2) != M.end()){
            ans += M[h2];
        }
    }
    cout << ans << "\n";

    return 0;
}


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

#define mp make_pair
#define pb push_back
#define st first
#define nd second

typedef long long ll;
typedef pair < int , int > pp;
const int mod = 1e9 + 7;
const int N   = 4e3 + 3;

int M[N][N],BB[N],WW[N],PB[N],PW[N],B[N][N],W[N][N],A[N],H[N],n,m,i,j,t,x;
char c;

int f(int i, int j){
    if(i == n+2 || j == n+2) return mod;
    if(i == n+1 && j == n+1) return 0;
    int &r = M[i][j];
    if(r != -1) return r;
    return r = min(f(i+1,j) + W[i][j], f(i,j+1) + B[j][i]);
}

int main(){
    cin >> n;
    m = n+n;
    for(i=1;i<=m;i++){
        cin >> c >> x;
        if(c == 'B') BB[x] = i;
        else WW[x] = i;
        A[i] = x;
        H[i] = c == 'B' ? 0 : 1;
    }

    for(i=1;i<=m;i++){
        t = 0;
        for(j=1;j<i;j++)
            if(H[j] == H[i] && A[j] < A[i])
                t++;
        for(j=1;j<=n+1;j++){
            if(H[i] == 0) B[ A[i] ][j] = i-1-t;
            else W[ A[i] ][j] = i-1-t;
        }
    }

    for(i=1;i<=n+1;i++){
        for(j=1;j<=n;j++){
            W[j][i] -= PB[ WW[j] ];
            B[j][i] -= PW[ BB[j] ];
        }
        for(j=WW[i];j<=m;j++) PW[j]++;
        for(j=BB[i];j<=m;j++) PB[j]++;
    }

    memset(M , -1 , sizeof M);
    cout << f(1,1);
    return 0;
}

Measured memory_bytes: 128384
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

const int LEN=100005;
using namespace std;

typedef struct {
  char name[15];
  int t;
}process;

int head=0,tail=0;
process S[LEN];

void enqueue(process x){
  S[tail]=x;
  tail = (tail+1)%LEN;
}

process dequeue(){
  process x=S[head];
  head=(head+1)%LEN;
  return x;
}

int main(){
  int n,q,Time=0;
  scanf("%d %d",&n,&q);
  process r;
  for(int i=1;i<=n;i++){
    scanf("%s",S[i].name);
    scanf("%d",&S[i].t);
  }
  head=1,tail=n+1;
  while(head!=tail){
    r=dequeue();
    if(r.t>q){
      r.t-=q;
      Time+=q;
      enqueue(r);
    }
    else {
      Time+=r.t;
      printf("%s %d\n",r.name,Time);
    }
  }
  return 0;
}

Measured memory_bytes: 3144
#include<stdio.h>
int main(void){
    int a[10000];
    int i;
    for(i=0;i<10000;i++){
        scanf("%d\n",&a[i]);
        if(a[i]==0){
        	break;
        }
    }
    for(i=0;i<10000;i++){
    	if(a[i]==0){
    		break;
    	}
    	printf("Case %d: %d\n",i+1,a[i]);
    }
 
    return 0;
}


Measured memory_bytes: 2020
import sys
input = sys.stdin.readline

N=int(input())
A=list(map(int,list(input().strip())))

def next(A):
    B=[]
    for i in range(1,len(A)):
        B.append(abs(A[i]-A[i-1]))
    return B

A=next(A)

if len(A)<=3:
    while len(A)>1:
        A=next(A)
    print(A[0])
    sys.exit()

def in2(x):
    if x==0:
        return 0
    ANS=0
    while x%2==0:
        ANS+=1
        x//=2
    return ANS


if not (1 in A):
    LEN=len(A)
    SUM=0
    COMBI=0

    for i in range(LEN):
        if COMBI==0:
            SUM+=A[i]//2

        COMBI=COMBI+in2(LEN-1-i)-in2(i+1)

    if SUM%2==1:
        print(2)
    else:
        print(0)
else:
    LEN=len(A)
    SUM=0
    COMBI=0

    for i in range(LEN):
        if COMBI==0:
            SUM+=A[i]

        COMBI=COMBI+in2(LEN-1-i)-in2(i+1)

    if SUM%2==1:
        print(1)
    else:
        print(0)



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

int main ()
{
    long long n, ans=100, k=0 ;
    cin >> n ;

    //cout << ans + a*.01 ;
    for (int i=1 ;; i++){
        ans += ans/100 ;
        k++ ;
        if (ans >= n) break ;

    }
    cout << k ;
}

Measured memory_bytes: 3636
import java.util.*;

public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int c[] = new int[26];
        int s[][] = new int[n][26];
        
        for(int i = 0; i < 26; i++){
            c[i] = stdIn.nextInt();
        }
        
        for(int i = 0; i < n; i++){
            for(int j = 0; j < 26; j++){
                s[i][j] = stdIn.nextInt();
            }
        }
        
        /* 
        for(int i = 0; i < n; i++){
            int max = 0;
            int index = 0;
            for(int j = 0; j < 26; j++){
                if(s[i][j] > max){
                    max = s[i][j];
                    index = j;
                }
            }
            System.out.println(index + 1);
        }
        */
        
        for(int i = 1; i < n + 1; i++){
            System.out.println(i % 26 + 1);
        }
        
        //System.out.println("XXXXXXXX");
    }
}


Measured memory_bytes: 46452
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

use std::cmp::min;

fn main() {
    input! {
        n: usize,
        h: [i32; n],
    }

    let mut dp = vec![-1; n];
    dp[n - 1] = 0;

    for i in (0..(n - 1)).rev() {
        if i == n - 2 {
            dp[i] = dp[i + 1] + (h[i + 1] - h[i]).abs();
        } else {
            dp[i] = min(dp[i + 1] + (h[i + 1] - h[i]).abs(), dp[i + 2] + (h[i + 2] - h[i]).abs());
        }
    }
    println!("{}", dp[0]);
} 


Measured memory_bytes: 4352
#include <iostream>
using namespace std;
int main() {
    int a, b;
    cin >> a >> b;
    while (a != 0 || b != 0) {
        if (a < b) 
            cout << a << " " << b << "\n";
        else 
            cout << b << " " << a << "\n";
        cin >> a >> b;
    }
    return 0;
}


Measured memory_bytes: 3084
import sys
input = sys.stdin.readline
n = int(input())
a = []
b = []
for i in range(n):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)
a.sort()
b.sort()
if n % 2 == 1:
    am = a[n // 2]
    bm = b[n // 2]
    ans = abs(bm - am) + 1
else:
    am1 = a[n // 2 - 1]
    am2 = a[n//2]
    bm1 = b[n // 2 - 1]
    bm2 = b[n // 2]
    ans = bm1 + bm2 - (am1 + am2) + 1
print(ans)
    


Measured memory_bytes: 89868
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
const ll inf = (ll)1e9 + 7;
int main()
{
    ll i, j, n, a[200005], b[200005] = {0};
    cin >> n;
    for (i = 0; i < n; i++)
    {
        cin >> a[i];
        b[a[i]]++;
    }
    ll tot = 0;
    for (i = 1; i <= n; i++)
    {
        if (b[i] > 1)
        {
            tot += (b[i] * (b[i] - 1) / 2);
        }
    }
    //cout << tot;
    for (i = 0; i < n; i++)
    {
        if (b[a[i]] == 2)
        {
            cout << (tot - 1) << "\n";
        }
        else if (b[a[i]] < 2)
        {
            cout << tot << "\n";
        }
        else
        {
            j = b[a[i]];
            j = ((j - 1) * (j - 2) / 2) - (j * (j - 1) / 2);
            cout << (tot + j) << "\n";
        }
    }
    return 0;
}

Measured memory_bytes: 5760
a,b = gets.split.map(&:to_i)

chk = 4
ans = ((b+1)/2 - a/2) %2
40.times do
  x = (a-1)%chk
  y = b%chk
  x = x >= chk/2 ? x-(chk/2-1) : 0
  y = y >= chk/2 ? y-(chk/2-1) : 0
  ans += ((y-x) % 2 )*(chk/2)
  chk *= 2
end
p ans


Measured memory_bytes: 3836
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 100005;
ll read(){
	ll ans = 0;
	ll f = 1;
	char c = getchar();
	while(c<'0' or c>'9'){
		if(c=='-')f=-1;
		c = getchar();
	}
	while(c>='0' and c<='9'){
		ans = ans * 10 + c-'0';
		c=getchar();
	}
	return ans * f;
}
ll n;
ll a[N];
ll b[N];
ll ans;
int main(){
	//freopen("C.in","r",stdin);
	//freopen("C.out","w",stdout);
	n = read();
	for(int i=1;i<=n+1;i++){
		a[i]=read();
	}
	for(int i=1;i<=n;i++){
		b[i]=read();
	}
	for(int i=1;i<=n;i++){
		if(a[i]>=b[i]){
			ans += b[i];
		}else {
			ans+=a[i];
			b[i]-=a[i];
			if(a[i+1]>b[i])ans+=b[i],a[i+1]-=b[i];
			else ans+=a[i+1],a[i+1]=0;
		}
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include<algorithm>
#include <vector>
#include<string>
#include<cmath>
#include<cstdio>
using namespace std;
typedef long long ll;
#define max(x,y) (((x)>(y)) ? x:y)
#define min(x,y) (((x)<(y)) ? x:y)
#define FOR(a,b,c) for(b=(c);b<(a);b++)
#define ender {return 0;}
#define tosasuretu(a) (a*(a+1)/2)
inline long kaizyo(long);

int main() {
	int n, m;
	vector<int> a;
	cin >> n;
	a.push_back(0);
	int count = 0;
	for (int i = 0; i < n; i++) {
		cin >> m;
		a.push_back(m);
	}
	a.push_back(0);
	for (int i = 0; i < n; i++) {
		if (a[i + 1] == a[i]) {
			for (int j = 1; j < 10000; j++) {
				if (j != a[i] && j != a[i + 2]) {
					a[i + 1] = j;
					count++;
					break;
				}
			}
		}
	}
	cout << count;
	ender
}
inline long kaizyo(long x) {
	long ans = 1;
	for (int z = 0; z < x; z++) {
		ans *= (x - z);
	}
	return ans;
}




Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<deque>
#include<cmath>
#include<map>
#include<cstring>

using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LLINF = 1LL<<60;
#define P pair<ll, ll>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define print(x) cout << (x) << endl

class mint {
    long long x;
public:
    mint(long long x=0) : x((x%MOD+MOD)%MOD) {}
    mint operator-() const {
      return mint(-x);
    }
    mint& operator+=(const mint& a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator-=(const mint& a) {
        if ((x += MOD-a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator*=(const  mint& a) {
        (x *= a.x) %= MOD;
        return *this;
    }
    mint operator+(const mint& a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint& a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint& a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    // for prime MOD
    mint inv() const {
        return pow(MOD-2);
    }
    mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const {
        mint res(*this);
        return res/=a;
    }

    friend ostream& operator<<(ostream& os, const mint& m){
        os << m.x;
        return os;
    }
};
/* -- template -- */

int main() {
    int N, K; cin >> N >> K;
    double p[N];
    rep(i, N){
        cin >> p[i];
        p[i] = (p[i] * (p[i] + 1)) / (2 * p[i]);
    }
    double sum_p[N + 1];
    sum_p[0] = 0;
    rep(i, N)sum_p[i + 1] = sum_p[i] + p[i];
    double maxv = 0;
    rep(i, N - K + 1){
        maxv = max(maxv, sum_p[i + K] - sum_p[i]);
    }
    printf("%.12f", maxv);
}


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

int main(){
  int X,A,B;
  cin >> X >> A >> B;
  X -= A;
  int ans = X%B;
  cout << ans << endl;
}

Measured memory_bytes: 256
package main

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

var nextString func() string

func init() {
	nextString = newReadString(os.Stdin)
}

func main() {
	var (
		way = 0
		pre = 0
		ans = 1
		n   = nextInt()
	)

	for i := 0; i < n; i++ {
		now := nextInt()
		if i == 0 || now-pre == 0 {
		} else if way == 0 {
			way = sgn(now - pre)
		} else if sgn(now-pre) != way {
			ans++
			way = 0
		}
		pre = now
	}
	fmt.Println(ans)
}

func sgn(x int) int {
	if x == 0 {
		return 0
	} else if x > 0 {
		return 1
	}
	return -1
}

func nextInt() (result int) {
	result, _ = strconv.Atoi(nextString())
	return
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
		}
		return r.Text()
	}
}


Measured memory_bytes: 2176
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String args[]) {
		FastScanner scanner = new FastScanner();
		int n=scanner.nextInt();
		int C=scanner.nextInt();
		int[][] d=new int[C][C];
		int[][] c=new int[n][n];
		for(int i=0;i<C;i++) {
			for(int j=0;j<C;j++) {
				d[i][j]=scanner.nextInt();
			}
		}
		for(int i=0;i<n;i++) {
			for(int j=0;j<n;j++) {
				c[i][j]=scanner.nextInt()-1;
			}
		}
		int[][] cost=new int[3][C];
		for(int i=0;i<C;i++) {
			for(int x=0;x<n;x++) {
				for(int y=0;y<n;y++) {
					cost[(x+y)%3][i]+=d[c[x][y]][i];
				}
			}
		}
		int min=Integer.MAX_VALUE;
		for(int x=0;x<C;x++) {
			for(int y=0;y<C;y++) {
				for(int z=0;z<C;z++) {
					if(x==y||x==z||y==z)continue;
					int tmp=0;
					tmp+=cost[0][x];
					tmp+=cost[1][y];
					tmp+=cost[2][z];
					min=Math.min(min, tmp);
				}
			}
		}
		System.out.println(min);
	}
}
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}


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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
#if DEBUG
            ReadLine();
#endif
        }

        void Solve(ConsoleInput cin)
        {
            int n = cin.ReadInt;
            string a = cin.Read;
            string b = cin.Read;
            string c = cin.Read;

            int ans = 0;

            for (int i = 0; i < n; i++)
            {
                if (a[i] == b[i])
                {
                    if (a[i] == c[i])
                    {
                        continue;
                    }
                    else
                    {
                        ans += 1;
                    }
                }
                else
                {
                    if (a[i] == c[i])
                    {
                        ans += 1;
                    }
                    else if (b[i] == c[i])
                    {
                        ans += 1;
                    }
                    else
                    {
                        ans += 2;
                    }
                }
            }

            Console.WriteLine(ans);
        }

        class ConsoleInput
        {
            private readonly System.IO.TextReader _stream;
            private char _separator = ' ';
            private Queue<string> inputStream;

            public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
            {
                this._separator = separator;
                this._stream = stream;
                inputStream = new Queue<string>();
            }

            public string Read
            {
                get
                {
                    if (inputStream.Count != 0) return inputStream.Dequeue();
                    string[] tmp = _stream.ReadLine().Split(_separator);
                    for (int i = 0; i < tmp.Length; ++i)
                        inputStream.Enqueue(tmp[i]);
                    return inputStream.Dequeue();
                }
            }

            public string ReadLine { get { return _stream.ReadLine(); } }
            public int ReadInt { get { return int.Parse(Read); } }
            public long ReadLong { get { return long.Parse(Read); } }
            public double ReadDouble { get { return double.Parse(Read); } }
            public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
            public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
            public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
        }
    }
}


Measured memory_bytes: 13268
/*   ꧁༒☬महाकाल☬༒꧂ ꧁༒ঔमहाकालঔ༒꧂
                   
                   ঔৣ۝महाकालᴳᵒᵈ۝ঔৣ            
 
 */ 
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//template <typename T, typename cmp=less<T>> using oset =tree<T, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long 
#define mod 1000000007
#define inf 100000000000000000
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define _it iterator
#define all(_x) _x.begin(),_x.end()
#define f first
#define s second
#define pb push_back
void mahakal(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
	#endif
}
const ll N = 1e6+1;
#define ld long double
void solve(){
	ll a ;
	ld b ;
	cin>> a>> b ;
	ll c=b*100+1e-9;
	ll ans = a*c/100;
	cout<<ans<<endl;
}
int main(){
	//mahakal(),fast;
	ll t=1 ;
	// cin>> t;
	while(t--)solve();

	return 0;
}

Measured memory_bytes: 3644
/*
                                                  __          __
      /\   |   |     /\   |  | |  |     /\   | / |  )   /\   |  )
     /__\  |   |    /__\  |--| |  |    /__\  |<  |-<   /__\  |-<
    /    \ |__ |__ /    \ |  | \__/   /    \ | \ |__) /    \ |  \

*/

#import<bits/stdc++.h>
typedef long long ll;
#define num 1e9
#define root 10000
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define forll(i,a,b,c) for(int i=a; i<=b; i+=c)
#define forll2(i,a,b,c) for(int i=a; i>=b; i-=c)
#define pb(n) push_back(n)
#define i(n) insert(n)

using namespace std;

int main()
{
    io;
    int a,b,c;
    cin>>a>>b>>c;
  	int p;
    if(a%c==0){p=a/c;}
    else{p=(a/c)+1;}
    if(p<=b){cout<<"Yes\n";}
    else{cout<<"No\n";}
}


Measured memory_bytes: 3664
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input().split())

n, p = rli()
a = rli()

odd = 0
even = 0
for i in a:
    if(i % 2 == 0):
        even += 1
    else:
        odd += 1
ans = 2**max(0, odd-1)*2**(even)
if(p == 1 and odd == 0):
    ans = 0
print(ans)

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

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

int main(){
    int d[5];
    rep(i,5) cin>>d[i];
    int c[5];
    rep(i,5){
        c[i]=(d[i]-1)%10+1;
    }
    sort(c,c+5);
    int s=0;
    rep(i,5){
        if(d[i]%10!=0)d[i]=(d[i]/10+1)*10;
    }
    rep(i,5){
        s += d[i];
    }
    s -= 10-c[0] ;
    cout<<s<<endl;
}

Measured memory_bytes: 256