akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define MAXN	10005
#define P	998244353
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
long long dp[2][MAXN], ans[MAXN];
long long fac[MAXN], inv[MAXN];
int both, either;
char x[MAXN], y[MAXN];
void update(long long &x, long long y) {
	x = (x + y) % P;
}
long long power(long long x, long long y) {
	if (y == 0) return 1;
	long long tmp = power(x, y / 2);
	if (y % 2 == 0) return tmp * tmp % P;
	else return tmp * tmp % P * x % P;
}
long long getc(long long x, long long y) {
	return fac[x] * inv[y] % P * inv[x - y] % P;
}
int main() {
	scanf("%s\n%s", x + 1, y + 1);
	int l = strlen(x + 1);
	for (int i = 1; i <= l; i++) {
		if (x[i] == '1' && y[i] == '1') both++;
		if (x[i] == '1' && y[i] == '0') either++;
	}
	fac[0] = 1;
	for (int i = 1; i <= l; i++)
		fac[i] = fac[i - 1] * i % P;
	inv[l] = power(fac[l], P - 2);
	for (int i = l - 1; i >= 0; i--)
		inv[i] = inv[i + 1] * (i + 1) % P;
	for (int i = 0; i <= either; i++)
		dp[0][i] = fac[i] * fac[i] % P;
	ans[0] = dp[0][either];
	for (int k = 1, now = 1, last = 0; k <= both; k++, now ^= 1, last ^= 1) {
		memset(dp[now], 0, sizeof(dp[now]));
		dp[now][0] = 0;
		for (int i = 1; i <= either; i++) {
			update(dp[now][i], dp[now][i - 1] * i * i);
			update(dp[now][i], dp[last][i] * i * k);
		}
		ans[k] = dp[now][either];
	}
	long long finalans = 0;
	for (int i = 0; i <= both; i++)
		update(finalans, getc(both, i) * getc(both + either, both - i) % P * fac[both - i] % P * fac[both - i] % P * ans[i] % P);
	cout << finalans << endl;
	return 0;
}

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

typedef long long ll;

int main(){
  int k;
  cin>>k; 
  vector<ll> a;
  for(int i = 1; i<= 9; i++) a.push_back(i);
  while (1) {
    if(k <= a.size()) {
      cout << a[k-1] << endl;
      return 0;
    }
    k -= a.size();
    vector<ll> old;
    swap(old, a);
    for(ll x : old){
      for(int i = -1; i <= 1; i++){
	int d = x%10 + i;
	if (d < 0 || d > 9) continue;
	ll nx = x*10 + d;
	a.push_back(nx);
      }
    }
  }
  return 0;
}


Measured memory_bytes: 4672
a,b,k = map(int, input().split())

Takahashi = 0
Aoki = 0

Takahashi = a - k

if Takahashi <= 0:
    Aoki = b + Takahashi
    Takahashi = 0
    if Aoki <= 0:
        Aoki = 0
else:
    Aoki = b

print(Takahashi , Aoki)

Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<map>
#define st(n) sort(n.begin(), n.end())
using namespace std;
int gcd(int a, int b) {
    if(a % b == 0)
        return b;
    else
        return gcd(b, a % b);
}
int main() {
    int h, w, c, mod;
    bool ok = false;
    cin >> h >> w >> c;
    mod = gcd(h, w);
    cout << (h / mod) * (w / mod) * c << endl;
}


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

const int MOD = 1e9 + 7;
const int MAXN = 1e5;
int dp[MAXN][2];
vector<vector<int>> to(MAXN);


ll dfs(int v, bool isBlack, int parent=-1){
	if(dp[v][isBlack] > 0) return dp[v][isBlack];
	
	ll res = 1;
	for( auto u : to[v] ){
		if( u == parent ) continue;
		
		ll tmp = 0;
		tmp = (tmp + dfs(u,false,v) ) % MOD;
		if(!isBlack) tmp = (tmp + dfs(u,true,v) ) % MOD;
		
		res = (res * tmp) % MOD;
	}
	
	return dp[v][isBlack] = res;
}

int main(){
	int n;
	cin >> n;
	//vector<vector<int>> to(n);
	
	rep(i,n-1){
		int x,y;
		cin >> x >> y;
		--x; --y;
		to[x].push_back(y);
		to[y].push_back(x);
	}
	
	cout << ( dfs(0,true) + dfs(0,false) ) % MOD << endl;
	return 0;
}

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

int main() {
  string S;
  cin >> S;
  int ans = 0;
  for (int i = 1; i <= S.size(); i++) {
    for (int j = 0; j <= S.size() - i; j++) {
      bool flag = true;
      string subs = S.substr(j, i);
      for (int k = 0; k < i; k++)
        if (subs[k] != 'A' && subs[k] != 'C' && subs[k] != 'G' && subs[k] != 'T')
          flag = false;
      if (flag) ans = i;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define sz(v) v.size()
#define INF 1000000009
// aよりもbが大きいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmax(T &a, const T& b) {
  if (a < b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}
// aよりもbが小さいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmin(T &a, const T& b) {
  if (a > b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}

int main(){
  ll N, R;
  cin >> N >> R;
  if(N >= 10){
    cout << R << endl;
  }
  else{
    cout << R + 100 * (10 - N) << endl;
  }
}

Measured memory_bytes: 256
package main

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

func rotN(n int, s string) string {
  rs := []rune(s)
  for i, r := range rs {
    r = ((r - 'A' + rune(n)) % 26) + 'A'
    rs[i] = r
  }
  return string(rs)
}

func main() {
  buf := bufio.NewReaderSize(os.Stdin, 1024*1024)
  nTemp := readLine(buf)
  n, err := strconv.ParseInt(nTemp, 10, 64)
  checkErr(err)
  s := readLine(buf)
  fmt.Fprintf(os.Stdout, "%v\n", rotN(int(n), s))
}

func readLine(reader *bufio.Reader) string {
  str, _, err := reader.ReadLine()
  if err == io.EOF {
    return ""
  }
  return strings.TrimRight(string(str), "\n\r")
}

func checkErr(err error) {
  if err != nil {
    panic(err)
  }
}


Measured memory_bytes: 768
x1,y1,x2,y2=(int(i) for i in input().split())
dx = x2-x1
dy = y2-y1
x3 = x2 - dy
y3 = y2 + dx
dx = x3-x2
dy = y3-y2
x4 = x3 - dy
y4 = y3 + dx
print(x3,y3,x4,y4)

Measured memory_bytes: 3060
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, double> pid;
typedef pair<double, int> pdi;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

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

	int ans = 1;
	int X;
	cin >> X;
	rep(i, 2, sqrt(X) + 1)
	{
		int p = i;
		while (p*i <= X)
		{
			p *= i;
			chmax(ans, p);
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
# frozen_string_literal: true

class Sunuke

  attr_reader :count

  def initialize
    @count = 0
  end

  def call(numbers)
    if numbers.all?(&:even?)
      @count += 1
      call(numbers.map {|n| n / 2 })
    else
      numbers
    end
  end

end

_n = gets
numbers = gets.split(" ").map(&:to_i)
sunuke = Sunuke.new
sunuke.call(numbers)
print sunuke.count


Measured memory_bytes: 1788
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>

using namespace std;

long long num2 = 1, num3=0;
int minn = 9999999;

bool IsPrime(long long num)
{


	if (num < 2) return false;
	else if (num == 2) return true;
	//else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

	double sqrtNum = sqrt(num);

	if (ceil(sqrtNum) == floor(sqrtNum)) {
		num2 *= (int)sqrtNum;
		string st = to_string(num2);
		cout << st.length() << endl;

		getchar();
		getchar();
		return 0;
	}


	for (long i = 2; i <= sqrtNum; i += 1)
	{
		if (num % i == 0)
		{
			// 素数ではない
		//	cout << "i->" << i << endl;
			num2 *= i;
		//	cout << "num2->" << num2 << endl;
			string str2 = to_string(num2);
			cout << "str2.length->" << str2.length() << endl;

			string str1 = to_string(num/i);
		//	cout << "num->" << num/i << endl;
		//	cout << "str1.length->" << str1.length() << endl;

			int size = str2.length() - str1.length();
			//minn = min(minn, abs(size) );
			if (minn > abs(size)) {
				minn = abs(size);
				if (str2.length() > str1.length()) {
					num3 = str2.length();
				}else
				if (str2.length() < str1.length()) {
					num3 = str1.length();
				}
				else {
					num3 = str2.length();
				}
			}

			IsPrime(num / i);
			return false;
		}
	}

	// 素数である
	//cout << "素数->" << num << endl;
	
	//string str2 = to_string(num);
	//cout << "str2.length->" << str2.length() << endl;

	//num3 = num;
	return true;
}

int digits(long long number) {
	int digit = 0;

	while (number != 0) {
		number = number / 10;
		++digit;
	}
	return digit;
}

int main() {
	int i, j, k;
	long long  n;

	cin >> n;

	int keta = digits(n);

	double sqrtNum = sqrt(n);
	 

	for (long long i = 1; i <= sqrtNum; i++) {

		long long b = n / i;

		if (i*b != n) continue;

		int maxn = max(i, b);

		if (i == 1) continue;

		keta = min(keta, digits(maxn));

	}

	cout  << keta << endl;

	getchar();
	getchar();
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
using namespace std;
using namespace boost::range;
using boost::irange;

using ll = int64_t;
constexpr char LN = '\n';
template<class T> bool chmax(T& a, const T& b) {if(a<b){a=b;return true;}else{return false;}}
template<class T> bool chmin(T& a, const T& b) {if(b<a){a=b;return true;}else{return false;}}

#ifdef LOCAL
template<class H> void dump_(const char* s, H h) {cout<<s<<"="<<h<<LN; }
template<class H, class... T> void dump_(const char* s, H h, T... t) {for(;*s!=',';++s){cout<<*s;}cout<<"="<<h<<",";dump_(++s,t...);}
#define dump(...) dump_(#__VA_ARGS__, __VA_ARGS__)
#else
#define dump(...)
#endif

struct init_ {init_(){ 
    cin.tie(nullptr); ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
}} init_;

template<class C> C scan(size_t n) {C c(n);for(auto& v:c){cin>>v;}return c;}
template<class C> C scan(size_t n, size_t m) {C vss(n);for(auto& vs:vss){vs.resize(m);for(auto& v:vs){cin>>v;}}return vss;}

template<class R> struct Joined { const R& r; const char* s; };
template<class R> Joined<R> joined(const R& r, const char* s = " ") {return{r,s};}
template<class R> ostream& operator<<(ostream& out, Joined<R> j) {bool f=true;for(const auto& v:j.r){if(f){f=false;}else{out<<j.s;}out<<v;}return out;}

template<class T> using matrix = vector<vector<T>>;
template<class T> matrix<T> make_matrix(size_t n, size_t m, const T& init = T()) {matrix<T> vss(n);for(auto& vs:vss){vs.resize(m,init);}return vss;}
template<class T> ostream& operator<<(ostream& out, Joined<matrix<T>> j) {bool a=true;for(const auto& vs:j.r){if(a){a=false;}else{out<<LN;}bool f=true;for(const auto& v:vs){if(f){f=false;}else{out<<j.s;}out << v;}}return out;}

int main() {
    double L;
    cin >> L;
    cout << pow(L / 3, 3) << LN;
}


Measured memory_bytes: 512
#include <stdio.h>

int main(int argc, char const *argv[]){
	long int A,B,K;
	scanf("%ld%ld%ld",&A,&B,&K);
	for(int i = 0;i < K; ++i){
		if(i % 2){
			B /= 2;
			A += B;
		}
		else{
			A /= 2;
			B += A;
		}
	}
	printf("%ld %ld\n",A,B);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
using namespace std;
int main(){
 string str;
  cin >> str;
  int n = str.size();
  bool check = true;
  for(int i = 0;i<n;i++){
    if(str[2]==str[3]&&str[4]==str[5])
      check = true;
    else check = false;
  }
  if(check)
    cout << "Yes\n";
  else cout << "No\n";
  
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
typedef long long ll;
#define MOD 1000000007
#define rep(i, n) for(int i=0; i<(n); ++i)

int H, W, K;
vector<string> field;

int count(int br, int bc)
{
	int cnt = 0;
	int row = 0, bitr = br;
	while (bitr > 0) {
		if (bitr & 1) {
			int bitc = bc, col = 0;
			while (bitc > 0) {
				if (bitc & 1) {
					if (field[row][col] == '#') ++cnt;
				}
				bitc = bitc >> 1; ++col;
			}
		}
		bitr = bitr >> 1; ++row;
	}
	return cnt;
}

int main()
{
	cin >> H >> W >> K;
	field.resize(H);
	rep(i, H) cin >> field[i];

	int ans = 0;
	for (int br = 0; br < (1 << H); ++br) {
		for (int bc = 0; bc < (1 << W); ++bc) {
			if (count(br, bc) == K) ++ans;
		}
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3136
#include <cstdio>
#include <string>
using namespace std;
int main(){
  int n;
  char str[100];
  while(scanf("%d", &n) && n){
    sprintf(str, "%o", n);
    for(int i = 0; str[i] != '\0'; ++i){
      if(str[i] >= '4') str[i]++;
      if(str[i] >= '6') str[i]++;
    }
    printf("%s\n", str);
  }
  return 0;
}

Measured memory_bytes: 1044
import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;


void main() {
    int n, k;
    scan(n, k);

    writeln(n % k == 0 ? 0 : 1);
}




























void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}


Measured memory_bytes: 256
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef long long int64;
int NM[12][13];
int a[] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096};
int main() {
	int N, M, X, tmp, ans = 100000000;
	cin >> N >> M >> X;
	rep(i, N) {
		rep(j, M+1) {
			cin >> tmp;
			NM[i][j] = tmp;
		}
	}
	int n[13];
	for (int i = 1; i < a[N]; ++i) {
		memset(n, 0, sizeof(n));
		for (int k = 0; k < N; ++k) {
			if ((i & a[k]) != 0) {
				for (int j = 0; j < M+1; ++j) {
					n[j] += NM[k][j];
				}
			}
		}
		int judge = 1;
		for (int k = 1; k < M+1; ++k) {
			if (n[k] < X) judge = 0;
		}
		if (judge == 1) {
			if (ans > n[0]) ans = n[0];
		}
	}
	if (ans == 100000000) cout << "-1" << "\n";
	else cout << ans << "\n";

	return 0;
}


Measured memory_bytes: 3532
#include <bits/stdc++.h>
using namespace std;
 
typedef unsigned long long  ULL;
typedef long long LL;
 
#define pb push_back
#define mp make_pair
#define reset(a, b) memset(a, b, sizeof(a))
#define rep(i,b) for(int i=0; i<b; i++)
#define F first 
#define S second
 
 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    int T;
//    cin>>T;
    T=1;
    while(T--){
       
       int n;
       cin>>n;
      float f= 2*n*(M_PI);
       cout<<f;
    }
    
    return 0;
}

Measured memory_bytes: 3804
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll x,z;
    double y;
    cin>>x>>y;
    z=y*100+0.1;
    ll num;
    num=(ll)x*z/100;
    cout<<num<<endl;
    return 0;
}


Measured memory_bytes: 3708
#include<bits/stdc++.h>
#define PI 3.141592653589793238462
using namespace std;
typedef long long ll;
typedef long double db;
typedef pair<pair<int,int>,int> ppp;
char c[1005][1005];
int n,m,sx,sy,nx,ny,dx[4]={0,0,1,-1},dy[4]={1,-1,0,0},dis[1005][1005];
void bfs(){
    priority_queue<ppp> q;
    q.push({{0,sx},sy});dis[sx][sy]=0;
    while(!q.empty()){
        int v=-q.top().first.first,x=q.top().first.second,y=q.top().second;q.pop();
        if(x==nx&&y==ny) {cout<<v<<endl;exit(0);}
        for(int i=0;i<4;i++){
            int px=x+dx[i],py=y+dy[i];
            if(px>n||px<1||py>m||py<1||c[px][py]=='#'||dis[px][py]<=v) continue;
            q.push({{-v,px},py});dis[px][py]=v;
        }
        for(int i=x-2;i<=x+2;i++){
            for(int j=y-2;j<=y+2;j++){
                if(i>n||i<1||j>m||j<1||c[i][j]=='#'||dis[i][j]<=v+1) continue;
                q.push({{-v-1,i},j});dis[i][j]=v+1;
            }
        }
    }
}
int main(){
    cin>>n>>m>>sx>>sy>>nx>>ny;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            cin>>c[i][j];
        }
    }
    memset(dis,0x3f,sizeof(dis));
    bfs();cout<<-1<<endl;
} 

Measured memory_bytes: 8752
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res

def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

n = I()
a = LI()
if n == 1:
    print(0)
    quit()
for i in range(n):
    a[i] -= i+1
a.sort()
b = a[n>>1]
ans = 0
for i in a:
    ans += abs(i-b)
if n%2:
    b = a[(n>>1)+1]
    ans_ = 0
    for i in a:
        ans_ += abs(i-b)
    if ans > ans_:
        ans = ans_
    b = (a[(n>>1)+1]+a[n>>1])>>1
    ans_ = 0
    for i in a:
        ans_ += abs(i-b)
    if ans > ans_:
        ans = ans_
print(ans)


Measured memory_bytes: 79184
/*
  Contest 076
  B - Addition and Multiplication
  Rakesh Kumar --> 11/09/2020
 */

#include <bits/stdc++.h>

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(0); std::cout.tie(0);

    int n = 0, k = 0;
    std::cin >> n >> k;

    unsigned long long int total = 1;
    while (n--) {
        if ((total << 1) < (total + k))
            total <<= 1;
        else
            total += k;
    }
    std::cout << total << std::endl;

    return 0;
}


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


int main() {
	int n,m,l=1,r=1<<30;
	cin>>n>>m;
	for(int i=0;i<m;i++){
		int L,R;
		cin>>L>>R;
		if(l<L){
			l=L;
		}
		if(R<r){
			r=R;
		}
	}
	cout << ( l<=r ? r-l+1:0);
	return 0;
}

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

int main()
{
  string s;
  cin >> s;
  map<char, int> mp;
  rep(i, s.size()){
    mp[s[i]]++;
  }
  string ans = "Yes";
  rep(i, s.size()){
    if(mp[s[i]] % 2) ans = "No";
  }
  
  cout << ans << endl;
    
  return 0;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(a) (a).begin(), (a).end()
typedef vector<int> vi;
const int INF = 1LL << 60; //10e18+10e17ちょっとくらい
const int MOD = 1000000007;
const int MAX_N = 200100;

signed main()
{
    //  以降 cin の入力元が 'input.txt' になる
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());
    double L;
    cin >> L;
    L /= 3.;
    cout << setprecision(20) << L * L * L << endl;

    return 0;
}

Measured memory_bytes: 256
n,a,b = gets.chomp.split(" ").map(&:to_i);
i = 0
s = []
sum = 0
n.times do
  i += 1
  if i <= 99
    if i / 10 + i % 10 >= a && i / 10 + i % 10 <= b
      s << i
    end
  elsif i <= 999
    if i / 100 + i / 10 % 10 + i % 100 % 10 >= a && i / 100 + i / 10 % 10 + i % 100 % 10 <= b
      s << i
    end
  elsif i <= 9999
    if i / 1000 + i / 100 % 10 + i / 10 % 100 % 10 + i % 1000 % 100 % 10 >= a && i / 1000 + i / 100 % 10 + i / 10 % 100 % 10 + i % 1000 % 100 % 10 <= b
      s << i
    end  
  elsif i == 10000
    if 1 >= a && 1 <= b
      s << i
    end
  end
end
s.each {|x| sum += x}
puts sum


Measured memory_bytes: 1916
object Main {
	def main(args: Array[String]): Unit = {
		val in = new java.util.Scanner(System.in)   
		rec(in)
	}
	
	def rec(in:java.util.Scanner){
	  val a = in.nextInt()
	  val b = in.nextInt()
	  if(a==0 && b==0) return
	  else if(a > b) println(b + " "+ a)
	  else println(a +" " + b)
	  rec(in)
	}
}

Measured memory_bytes: 54512
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using u64 = uint_fast64_t;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
template<class T1, class T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true;} return false; }
template<class T1, class T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return true;} return false; }
inline int popcount(int x) {return __builtin_popcount(x);}
inline int popcount(long long x) {return __builtin_popcountll(x);}
void print() { cout << "\n"; }
template<class T, class... Args>
void print(const T &x, const Args &... args) {
    cout << x << " ";
    print(args...);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int N; cin >> N;
    vector<int> L(N),R(N);
    int maxlen = 0;
    int maxL = -1, maxLnum = 0;
    int minR = MOD, minRnum = 0;
    rep(i,N) {
        cin >> L[i] >> R[i];
        R[i]++;
        if (chmax(maxL,L[i])) maxLnum = i;
        if (chmin(minR,R[i])) minRnum = i;
        chmax(maxlen,R[i]-L[i]);
    }

    if (maxLnum == minRnum) {
        cout << maxlen - maxL + minR << ln;
        return 0;
    }
    int ans = 0;
    rep(i,N) {
        if (i == maxLnum or i == minRnum) continue;
        chmax(ans,R[i]-L[i]);
    }
    ans += max(0,minR - maxL);
    vector<int> idx(N);
    iota(all(idx),0);
    sort(all(idx),[&](int i, int j){return L[i] < L[j];});
    multiset<int> dic;
    rep(i,N) {
        if (i == minRnum) continue;
        dic.emplace(R[i]);
    }
    chmax(ans,R[minRnum] - L[minRnum] + max(0,*dic.begin() - L[maxLnum]));
    rep(i,N) {
        int u = idx[i];
        if (u == maxLnum or u == minRnum) continue;
        dic.erase(R[u]);
        chmax(ans,max(0,R[minRnum] - L[u]) + max(0,*dic.begin() - L[maxLnum]));
    }

    cout << ans << ln;
}

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

int main() {
  int N; cin >>N;
  long long x; cin >>x;
  vector<long long> a(N);
  for (int i=0;i<N; ++i) cin >>a[i];
  sort(a.begin(),a.end());
  
  int ans =0;
  for (int i =0;i<N;++i){
    if (x>=a[i]) ++ans,x-=a[i];
    else break;
  }
  if (ans == N && x) --ans;
  cout <<ans <<endl;
}

  

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <stdlib.h>
#include <vector>
#include <climits>
#include <math.h>
#include <map>
#include <set>
using namespace std;
#define Endl '\n'
int main()
{
    string s;
    cin>>s;
    if (s=="ABC")
    {
        cout<<"ARC";
    }
    else
        cout<<"ABC";
}

Measured memory_bytes: 3624
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int A = in.nextInt();
		int B = in.nextInt();
		int C = in.nextInt();
		in.close();
		if (A + B >= C) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

}

Measured memory_bytes: 22740
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split(' ')))
a.sort()

candidates = [(a[i], min(a[-1] - a[i], a[i])) for i in range(n-1)]
candidates.sort(key=lambda x: x[1])

# print(candidates)
print(a[-1], candidates[-1][0])



Measured memory_bytes: 66216
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 510000;
ll dy[8] = {0,1,0,-1,1,-1,1,-1};
ll dx[8] = {1,0,-1,0,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-7;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << "\n";}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << a << " " << b << " " << c << "\n";
}
const int mod = 1e9 + 7;
//const int mod = 998244353;

ll t[5] = {5,7,5,7,7};

int main(){
	while(1){
		ll n; cin >> n;
		if(!n) break;
		vs s(n);
		rep(i,n) cin >> s[i];
		rep(i,n){
			ll now = 0;
			ll rest = 5;
			for(ll j=i; j<n; j++){
				if(s[j].size() > rest) break;
				else if(s[j].size() == rest){
					now++;
					if(now < 5) rest = t[now];
				}else{
					rest -= s[j].size();
				}
				if(now == 5) break;
			}
			if(now == 5){
				cout << i+1 << endl;
				break;
			}
		}
	}
}


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

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

  if (a + b >= c) {
    cout << b + c << endl;
  } else {
    cout << b + (a + b) + 1 << endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <math.h>
typedef long long ll;
using namespace std;

int main()
{
	int n, m;
	cin >> n >> m;
	if (n == m) cout << "Yes" << endl;
	else cout << "No" << endl;
}

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

X, Y = [], []
for i in range(int(f / 100 + 0.9)):
    for j in range(int(f / 100 + 0.9)):
        x = 100 * a * i + 100 * b * j
        if x <= f:
            X.append(x)

for i in range(int(f / c + 0.9)):
    for j in range(int(f / d + 0.9)):
        y = c * i + d * j
        if y <= f:
            Y.append(y)

X = list(set(X))
Y = list(set(Y))

res = [0, 0]
p = e / (100 + e) # 最大濃度
maxP = 0 # ありうる最大濃度
for x in X:
    for y in Y:
        if x + y > 0 and x + y <= f: # 質量制約
            if y / (x + y) <= p: # 溶けるかどうか
                # res.append([x, y])
                if y / (x + y) >= maxP:
                    res[0] = x + y
                    res[1] = y
                    maxP = y / (x + y)
    
print(*res)


Measured memory_bytes: 51852
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        while(true) {
            int H = stdIn.nextInt();
            int W = stdIn.nextInt();
            int i;
            int j;
            if(H == 0 && W == 0) {
                break;
            }
            for(i = 0; i < H; i++) {
                for(j = 0; j < W; j++) {
                    System.out.print("#");
                }
            System.out.println("");
            }
            System.out.println("");
        }
    }
    
}


Measured memory_bytes: 34664
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
using ll=long long;
constexpr ll mod=1000000007;
constexpr int inf=1000000000;
constexpr ll linf=1000000000000000000;

int main(){
    int n;
    cin>>n;
    map<ll,int> mp;
    mp[0]=1;
    ll s=0;
    ll ans=0;
    rep(i,n){
        ll a;
        cin>>a;
        s+=a;
        ans+=mp[s];
        ++mp[s];
    }
    cout<<ans<<endl;
}


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

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
    int n;
    cin >> n;
    int A[2][n];
    for(int i=0;i<2;i++){
        for(int j=0;j<n;j++){
            cin >> A[i][j];
        }
    }
    int ans=0;
    for(int i=0;i<n;i++){
        int tmp=0;
        for(int a=0;a<=i;a++) tmp+=A[0][a];
        for(int b=i;b<n;b++) tmp+=A[1][b];
        ans=max(ans,tmp);
    }
    cout << ans << endl;
}

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

using namespace std;

typedef long long ll;
typedef vector<int> pi;
typedef pair<int,int> vi;

#define F first
#define S second
#define PB push_back
#define MK make_pair
#define REP(i, a, b) for (int i=a; i < b; i++)


bool sort_by(vi c, vi d){
	return c.S < d.S;
}

int main() {
	ll N, K;
	cin >> N >> K;
	ll ans=0, modulo=pow(10, 9)+7;
	ll low_number=0, high_number = 0;
	REP (i, 0, K){
		low_number += i;
		high_number += (N-i);
	}
	
	ans += (high_number - low_number + 1);
	ans %= modulo;
	REP(i, K, N+1){
		low_number += i;
		high_number += (N-i);
		ans += (high_number - low_number + 1);
		ans %= modulo;
	}
	cout << ans;
		
		

}


Measured memory_bytes: 3644
def s_in():
    return input()

def n_in():
    return int(input())

def l_in():
    return list(map(int, input().split()))

class Interval():
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i-1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)

        res = self.sum_li[min(self.n-1, b-1)]
        if a > 0:
            res -= self.sum_li[a-1]
        return res

N, R = l_in()

print(R + 100*max((10-N), 0))


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()
ll d1[4] = {1, -1, 0, 0};
ll d2[4] = {0, 0, 1, -1};

int main(){
    ll N, M; cin >> N >> M;
    vector<vector<pair<ll,ll>>> G(N+1);
    rep(i, 0, M){
        ll v, u, w;
        w = 1;
        cin >> v >> u;
        G[u].push_back({v, w});
        G[v].push_back({u, w});
    }

    ll srt = 1;
    vector<ll> d(N+1, 1e18);
    VL path(N+1, -1);
    
    /* dijkstra's scope */{
        priority_queue<pair<ll,ll>, vector<pair<ll,ll>>, greater<pair<ll,ll>>> que;
        que.push({0, srt});
        d[srt] = 0;
        while(!que.empty()){
            auto q = que.top();
            que.pop();
            if(q.first > d[q.second]) continue;
            for(auto g : G[q.second]){
                if(d[g.first] <= q.first + g.second) continue;
                d[g.first] = q.first + g.second;
                path[g.first] = q.second;
                que.push({d[g.first], g.first});
            }
        }
    }

    rep(i, 2, N+1){
        if(path[i] == -1){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    rep(i, 2, N+1){
        cout << path[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 19548
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <random>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

i64 n, k;
vector<i64> h;
int main() {
  cin >> n >> k;
  read_n(h, n);
  i64 ans = 0;
  for (i64 i = 0; i < n; ++i) {
    ans += h[i] >= k;
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 1024
count=int(input())
aBuilding = [[0 for j in range(10)] for i in range(3)]
bBuilding = [[0 for j in range(10)] for i in range(3)]
cBuilding = [[0 for j in range(10)] for i in range(3)]
dBuilding = [[0 for j in range(10)] for i in range(3)]

for i in range(count):
    b,f,r,v = map(int,input().split())
    if b ==1:
        aBuilding[f-1][r-1]+=v
    elif b ==2:
        bBuilding[f-1][r-1]+=v        
    elif b ==3:
        cBuilding[f-1][r-1]+=v
    elif b ==4:
        dBuilding[f-1][r-1]+=v

def printInfo(building):
    for i in range(3):
        for x in range(10):
            print('',end=' ')
            print(building[i][x] , end='')
        print('')
printInfo(aBuilding)
print('####################')
printInfo(bBuilding)
print('####################')
printInfo(cBuilding)
print('####################')
printInfo(dBuilding)


Measured memory_bytes: 5640
#include <bits/stdc++.h>
using namespace std;
int main() {
	long long n,i;
	string s,s1="",s2="";
	cin>>s;
	n=s.size();
	for(i=0;i<n;i++)
	{
	    if(i<=(n/2)-1) s1+=s[i];
	    else if(i>=(n+1)/2) s2+=s[i];
	}
	if(s1==s2)cout<<"Yes";
	else cout<<"No";
	//cout<<s1<<" "<<s2;
	return 0;
}


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

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

// MOD
const int64_t MOD = 1e9 + 7;
struct Fp {
  int64_t x;
  Fp() : x(0) {}
  Fp(int y) : x(y >= 0 ? y % MOD : (MOD - (-y) % MOD) % MOD) {}

  Fp &operator+=(const Fp &p) {
    x = (x + p.x) % MOD;
    return *this;
  }
  Fp &operator*=(const Fp &p) {
    x = x * p.x % MOD;
    return *this;
  }
  Fp operator+(const Fp &rhs) const { return Fp(*this) += rhs; }
  Fp operator*(const Fp &rhs) const { return Fp(*this) *= rhs; }
};

Fp operator+(const int x, const Fp &rhs) { return Fp(x) += rhs; }
Fp operator*(const int x, const Fp &rhs) { return Fp(x) *= rhs; }

ostream &operator<<(ostream &out, const Fp &p) {
  out << p.x;
  return out;
}

Fp modpow(const int a, const int x) {
  // a ^ x (mod MOD)
  if (x == 0) return Fp(1);
  Fp half = modpow(a, x / 2);
  return ((x % 2 == 1) ? (Fp(a) * half * half) : (half * half));
}

int main(){
  string L;
  cin >> L;

  int N = L.length();
  Fp ret;

  int bitcount = 0;
  REP(i,N) {
    if (L[i] == '1') {
      ret += modpow(2, bitcount) * modpow(3, N - i - 1);
      bitcount++;
    }
  }
  ret += modpow(2, bitcount);

  cout << ret << endl;
  return 0;
}



Measured memory_bytes: 512
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
#define MAXN 100000
int a[MAXN+5],n,app[MAXN+5];
int pos=1;
long long ans;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		app[i]=(a[i]>0);
		ans+=a[i]/2;
		a[i]%=2;
	}
	for(int i=1;i<=n;i++)
	if(a[i]&&a[i-1])ans++,a[i]=0,a[i-1]=0;
	else if(a[i-1]&&app[i])a[i]=1,a[i-1]=0;
	printf("%lld",ans);
}

Measured memory_bytes: 1024
import java.util.Scanner

object Main extends App{
  val sc = new Scanner(System.in)

  val s = sc.next

  val res = s match{
    case "Sunny" => "Cloudy"
    case "Cloudy" => "Rainy"
    case "Rainy" => "Sunny"
    case _ => ???
  }

  println(res)

}

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

//////全探索したいときに開けよ////////
/*vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;

void setfspattern_core(int floor,int number,int degree){
  if(floor==degree){
    fspattern.at(fspcnt) = fspattern_draft;
    fspcnt++;
  }else{
    rep(i,number){
      fspattern_draft.at(floor) = i;
      setfspattern_core(floor+1,number,degree);
    }
  }
}

void setfspattern(int number,int degree){
  int64_t array_num = 1;
  rep(i,degree){
    array_num *= number;
  }
  fspattern = vector<vector<int>>(array_num,vector<int>(degree));
  fspattern_draft = vector<int>(degree);
  setfspattern_core(0,number,degree);
}*/

//////nCrのmodを求めたいときに開けよ/////////
//int64_t univMod = 1000000007;
//int64_t factnum = 100000
//vector<int64_t> modfact(factnum);
//vector<int64_t> modinvfact(factnum);

/*void setmodfact(){
  for(int i=0;i<factnum;i++){
    if(i == 0){
      modfact.at(i) = 1;
    }else{
      modfact.at(i) = (modfact.at(i-1)*i)%univMod;
    }
  }
}

int64_t calcmodpower(int64_t a,int64_t n){
  int64_t res = 1;
  while(n != 0){
    if(n & 1){
      res = (res * a) % univMod;
    }
    a = (a*a) % univMod;
    n = n >> 1;
  }
  return res;
}

int64_t calcinverse(int64_t n){
	return calcmodpower(n,univMod-2);
}

void setmodinvfact(){
  for(int i=0;i<factnum;i++){
    if(i==0){
      modinvfact.at(i) = 1;
    }else{
      modinvfact.at(i) = calcmodpower(modfact.at(i),univMod-2);
    }
  }
}

int64_t calcmodcomb(int64_t n,int64_t r){
  return (((modfact.at(n)*modinvfact.at(r))%univMod)*modinvfact.at(n-r))%univMod;
}

int64_t calcmodpositive(int64_t n){
  return (n + ((abs(n)+univMod-1)/univMod)*univMod)%univMod;
}
  
    */


/*
int64_t calcGCD(int64_t a,int64_t b){
	int64_t p = a;
	int64_t q = b;
	int64_t c = a%b;
	while(c != 0){
		p = q;
		q = c;
		c = p%q;
	}
	return q;
}
*/

int main(){
  int64_t n;
  cin >> n;
  int64_t a = -1,b = -1,c = -1;
  positiverep(i,3500){
    positiverep(j,3500){
      int64_t cchild = i*j*n;
      int64_t cmother = (4*i*j)-(n*i)-(n*j);
      if(cmother > 0 && cchild % cmother == 0){
        a = i;
        b = j;
        c = cchild / cmother;
        break;
      }
    }
  }
  
  cout << a << " " << b << " " << c << endl;
}
                                               
                                               
  
  


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

int main(){
  int N;
  cin >> N;
  int p[N], cnt = 0;
  for(int i = 0; i < N; i++){
    cin >> p[i];
    if(p[i] != i+1){
      cnt++;
    }
    // cout << cnt
  }

  if(cnt <= 2){
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
	int n,l;
	string s[100];
	string ans;
	
	cin >> n >> l;

	for (int i = 0; i < n; i++) {
		cin >> s[i];
	}
	sort(s, s + n);


	for (int i = 0; i < n; i++) {
		ans += s[i];
	}

	cout << ans << endl;
	
	return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (ll i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define FORI(i,v) for (auto i = v.begin(); i != v.end(); i++)
#define ALL(v) v.begin(), v.end()
#define CHMIN(x,y) x = min(x, y)
#define CHMAX(x,y) x = max(x, y)
#define YES(b) cout << ((b) ? "YES" : "NO") << endl
#define Yes(b) cout << ((b) ? "Yes" : "No") << endl
#define DOUBLE(d) cout << fixed << setprecision(15) << (d) << endl

const int MAX = 1e5+10;

int N;
int A[MAX], B[MAX];

bool check(vi& p) {
    int i = 0, x = p[0];
    REP (k, p.size()-1) {
        if (x == 0) return true;
        int y = p[x];
        swap(p[0], p[x]);
        i = x;
        x = y;
    }
    return false;
}

bool solve() {
    vii ba;
    REP (i, N) ba.push_back(ii(B[i], A[i]));
    sort(ALL(ba));
    REP (i, N) {
        A[i] = ba[i].second;
        B[i] = ba[i].first;
    }

    vii a;
    REP (i, N) a.push_back(ii(A[i], i));
    sort(ALL(a));
    sort(A, N+A);
    REP (i, N) if (A[i] > B[i]) return false;
    vi p;
    REP (i, N) p.push_back(a[i].second);
    if (check(p)) return true;

    REP (i, N-1) {
        if (A[i+1] <= B[i]) return true;
    }
    return false;
}

int main() {
    cin >> N;
    REP (i, N) cin >> A[i];
    REP (i, N) cin >> B[i];
    Yes(solve());
}

Measured memory_bytes: 6000
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter

val br = BufferedReader(InputStreamReader(System.`in`))
val pw = PrintWriter(System.out)
fun main(args : Array<String>) {
    func()
    pw.flush()
}

fun func() {
    // 回答をここに書く
    val (A, B) = listOfLong()
    println(if(B % A == 0L) A+B else B - A)
}

// 入力取得
fun next() = br.readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun listOfString() = next().split(" ")
fun listOfInt() =listOfString().map { it.toInt() }
fun listOfLong() =listOfString().map { it.toLong() }

// 約数のList
fun divisor(value : Long) : List<Long> {
    val max = Math.sqrt(value.toDouble()).toLong()
    return (1..max)
        .filter { value % it == 0L }
        .map { listOf(it, value / it) }
        .flatten()
        .sorted()
}

// 範囲内の素数を取得
// fromだけ指定すると戻り値の個数で素数判定ができる
fun prime(from : Long, to : Long = from) : List<Long> {
    return (from..to).filter { i ->
        val max = Math.sqrt(i.toDouble()).toLong()
        (2..max).all { j ->  i % j != 0L }
    }
}

// 素因数分解
fun decom(value : Long) : List<Long>{
    if (value == 1L) return listOf(1)
    val max = Math.sqrt(value.toDouble()).toLong()
    return prime(2, max).filter { value % it == 0L }
}

// 最大公約数
fun gcd(a : Long, b : Long) : Long {
    return if (a % b == 0L) b else gcd(b, a % b)
}

// 文字列を入れ替え
fun swap(base : String, a : String, b : String) : String {
    return base.map {
        when (it) {
            a.toCharArray()[0] -> b
            b.toCharArray()[0] -> a
            else -> it.toString()
        }
    }.joinToString()
}

fun println(value : Any) {
    pw.println(value)
}

Measured memory_bytes: 35792
#include <cstdio>
#include <algorithm>

int main()
{
	int n;
	scanf("%d", &n);
	int ans = 0;
	for (int i = 0; i < n; ++i)
	{
		int a;
		scanf("%d", &a);
		if (i % 2 == 0 && a % 2 != 0)
		{
			ans += 1;
		}
	}
	printf("%d\n", ans);
	return 0;
}


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

//定数
const long long MOD1=1000000007;
const long long MOD2=998244353;
const long double PI=3.1415926535897932;
const long long MAXLL=9223372036854775807;
const long long INF=2305843009213693951;
const long long dx[]={0,1,0,-1,1,-1,1,-1};
const long long dy[]={1,0,-1,0,1,1,-1,-1};

//型名省略
#define ll long long
#define ull unsigned long long
#define ld long double
#define uld unsigned long double
#define pll pair<long long,long long>
#define tll(n) array<long long,(int)(n)>
#define pcc pair<char,char>
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vp vector<pair<long long,long long>>
#define vt(n) vector<array<long long,(int)(n)>>
#define umap unordered_map
#define uset unordered_set
#define Lqueue priority_queue<long long>
#define Squeue priority_queue<long long,vector<long long>,greater<long long>>
#define Fi first
#define Se second
#define mp make_pair
#define eb emplace_back

//マクロ
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rbf(a,x) for(auto& a:x)
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s);i<(long long)(n);i++)
#define bitrep(i,s,n) for(long long i=(s);i<(1LL<<(n));i++)
#define Maxe(x) *max_element((x).begin(),(x).end())
#define Mine(x) *min_element((x).begin(),(x).end())
#define Size(x) ((long long)(x).size())
#define lin(s) getline(cin,(s))

//Yes,No
void Yes(bool a){cout<<(a?"Yes":"No")<<endl;}
//YES.NO
void YES(bool a){cout<<(a?"YES":"NO")<<endl;}

//MAX,MIN
template<class T,class U> auto max(T a,U b){return a>b?a:b;}
template<class T,class U> auto min(T a,U b){return a<b?a:b;}

//最大公約数,最小公倍数
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a,long long b){return a/gcd(a,b)*b;}

//累乗
template<typename t>
constexpr t mypow(t a,long long b){
    if(b==0)return 1;
    if(a==0)return 0;
    t x=1;
    while(b>0){
        if(b&1LL)x*=a;
        a*=a;
        b>>=1LL;
        }
    return x;
}
#define pow mypow

//chmin,chmax
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}

//組み合わせ O(r)
template<typename t>
constexpr t nCr(t n,long long r){
    if(r==0)return 1;
    if(n==0)return 0;
    if(n<r)return 0;
    t x=1;
    for(long long i=1;i<=r;i++){
        x*=n-i+1;
        x/=i;
    }
    return x;
}

//main関数
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n,l;
    cin>>n>>l;
    if(l>=0)cout<<n*(n+1)/2+n*(l-1)-l<<endl;
    else if(l+n-1>=0) cout<<n*(n+1)/2+n*(l-1)<<endl;
    else cout<<n*(n+1)/2+n*(l-1)-(l+n-1)<<endl;
}

Measured memory_bytes: 3640
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
#define PII pair<int,int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
using namespace std;
inline int read(){
	int x=0,f=1;char c=getchar();
	while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar();}
	while(c>='0'&&c<='9') { x=(x<<3)+(x<<1)+(c^48); c=getchar();}
	return f==1?x:-x;
}
inline void print(int x){
	if(x<0) x=~x+1,putchar('-');
	if(x>=10) print(x/10);
	putchar((x%10)|48);
}
int k;
int main(){
	k=read();
	for(int i=1;i<=k;++i) printf("ACL");
	return 0;
}

Measured memory_bytes: 3760
//   _/                _/                 _/_/_/   _/
//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
// _/     _/    _/   _/     _/    _/  _/_/_/     _/
//_/     _/    _/   _/     _/    _/  _/    _/   _/
// _/_/   _/_/       _/_/   _/_/      _/_/     _/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=1e9;
const ll INF=5e18;
typedef pair<int,int> P;
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  int n,m;
  cin >> n >> m;
  cout << n*m << endl;
}


Measured memory_bytes: 3180
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;
const int MAX_N = 100005;

int n;
vector<int> g[MAX_N];
bool used[MAX_N];
ll dp[MAX_N][2];

void dfs(int u)
{
	used[u] = true;
	dp[u][0] = 1;
	dp[u][1] = 1;
	for (int v : g[u])
		if (!used[v])
		{
			dfs(v);
			dp[u][0] = (dp[u][0] * (dp[v][0] + dp[v][1])) % MOD;
			dp[u][1] = (dp[u][1] * dp[v][0]) % MOD;
		}
}

int main()
{
	ios::sync_with_stdio(false);
	cin >> n;
	for (int i = 0; i < n - 1; i++)
	{
		int u, v;
		cin >> u >> v;
		u--; v--;
		g[u].push_back(v);
		g[v].push_back(u);
	}

	dfs(0);
	cout << ((dp[0][0] + dp[0][1]) % MOD) << endl;
}

Measured memory_bytes: 10752