akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <cmath>
#include <cstring>
#include <assert.h>
#include <utility>
#include <tuple>
#include <array>
#include <bitset>
#include <cstdlib>

using int64 = long long;

static int N;
static int64 K;

static std::vector<int64> w, d;

bool f(int64 x) {
    int64 num = 0;
    for (int i = 0; i < N; i++) {
        if (x >= w[i]) {
            num += 1 + (x - w[i]) / d[i];
        }
        if (num >= K) return true;
    }
    return false;
}

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

    std::cin >> N >> K;

    w.resize(N);
    d.resize(N);
    for (int i = 0; i < N; i++) {
        std::cin >> w[i] >> d[i];
    }

    int64 lb = 0,
          ub = 1LL << 62;
    while (ub - lb > 1) {
        int64 mid = (ub + lb) / 2;

        if (f(mid)) ub = mid;
        else lb = mid;
    }

    std::cout << ub << std::endl;

    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using ll=long long;
using vi=vector<int>;
using pii=pair<int,int>;
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)
#define ITR(i,b,e) for(auto i=(b);i!=(e);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define SZ(c) ((int)c.size())
#define CONTAIN(c,x) (c.find(x)!=end(c))
#define INSEG(l,x,r) ((l)<=(x)&&(x)<(r))
#define dump(...)
#define pb push_back
#define _ 0
const signed INF_=1001001001; const long long INF=1001001001001001001LL;
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    ITR(i,begin(v),end(v))os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    ITR(i,begin(v),end(v)) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a,const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a,const U &b){return a>b?a=b,1:0;}
template<class T> using heap=priority_queue<T,vector<T>,greater<T>>;
struct before_main_function {
    before_main_function() {
        cin.tie(0); ios::sync_with_stdio(false);
        cout << setprecision(15) << fixed;
        #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

signed main() {
    int N, M, X, Y;
    cin >> N >> M >> X >> Y;
    int mx = -INF, mn = INF;
    vi x(N), y(M);
    cin >> x >> y;
    sort(ALL(x)), sort(ALL(y));
    REP(i, N) {
        chmax(mx, x[i]);
    }
    mx++;
    REP(i, M) {
        chmin(mn, y[i]);
    }
    if (mx <= mn && X < mx && mn <= Y) {
        cout << "No War" << endl;
    } else {
        cout << "War" << endl;
    }
    return (0^_^0);
}



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


int main()
{
	int X;
	scanf("%d",&X);
	if(X == 0){
		printf("0");
		return 0;
	}
	
	int gohyaku = X / 500;
	X = X%500;
	int go = X / 5;
	
	printf("%d",gohyaku*1000+go*5);
	
	
	
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <cmath>
#include <numeric>
#include <iomanip>


#define log(x) cout<<x<<endl
#define pb push_back
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
using namespace std;


// <<fixed<<setprecision(6)<<


int gcd(lint x, lint y){
  return y==0 ? x:gcd(y,x % y);
}


int combi(int n, int r){
  int num = 1;
  for(int i = 1; i <= r; i++){
    num = num * (n - i + 1) / i;
  }
  return num;
}


int main(){
  int k;
  lint count=0;
  cin>>k;
  for (int i = 1; i <= k; i++){
    for (int j = 1; j <= k; j++){
      for (int n = 1; n <= k; n++){
        lint a=gcd(i,j);
        lint b=gcd(a,n);
        count+=b;
      }
    }
  }
  cout<<count;
}

Measured memory_bytes: 3188
s=input()
if (0<=int(s[:2])<=99 and 1<=int(s[2:])<=12) and not(0<=int(s[2:])<=99 and 1<=int(s[:2])<=12):
    print("YYMM")
elif (0<=int(s[2:])<=99 and 1<=int(s[:2])<=12) and not((0<=int(s[:2])<=99 and 1<=int(s[2:])<=12)):
    print("MMYY")
elif (0<=int(s[:2])<=99 and 1<=int(s[2:])<=12) and (0<=int(s[2:])<=99 and 1<=int(s[:2])<=12):
    print("AMBIGUOUS")
else:
    print("NA")

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

int main(){
    int i,n,m,q,ans=0;
    cin >> n >> m >> q;
    vector<int> a(q),b(q),c(q),d(q);
    for(i=0;i<q;i++){
        cin >> a.at(i) >> b.at(i) >> c.at(i) >> d.at(i);
    }
    vector<int> A(n,1);
    A.at(n-1)=0;
    while(true){
        if(A.at(n-1)==m){
            int unchi=0;
            for(i=0;i<n;i++){
                if(A.at(n-1-i)==m){unchi++;}
                else break;
            }
            if(unchi==n)break;
            else{
                A.at(n-1-unchi)++;
                for(i=0;i<unchi;i++){
                    A.at(n-1-i)=A.at(n-1-unchi);
                }
            }
        }
        else A.at(n-1)++;
    int tmp=0;
        for(i=0;i<q;i++){
            if(A.at(b.at(i)-1)-A.at(a.at(i)-1)==c.at(i))
            tmp += d.at(i);
        }
        if(ans<tmp) ans=tmp;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3612
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main
{
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    public  static void main(String args[])
    {
        FastReader obj = new FastReader();
        int a = obj.nextInt(),b = obj.nextInt();
        System.out.println(a*b);
    }
}


Measured memory_bytes: 32644
let id x = x

let split_string ?(pattern="") = Str.split @@ Str.regexp pattern

let ss = List.rev @@ split_string @@ Scanf.scanf "%s\n" id

let () =
  let b_cnt = List.length @@ List.filter (fun s -> s = "B") ss in
  let sum = ss |> List.mapi (fun i s -> if s = "B" then i else 0) |> List.fold_left (+) 0 in
  print_int (sum - (b_cnt * (b_cnt - 1) / 2));
  print_newline ()

Measured memory_bytes: 34176
import math
from functools import reduce
import itertools
import numpy as np

def solve():
    n = int(input())
    num = list(range(1,10))
    bit = 0
    for i in num:
        for j in num:
            if i * j == n:
                print("Yes")
                bit = 1
                break
        if bit == 1:
            break
    if bit == 0:
        print("No")
    return 0

if __name__ == "__main__":
    solve()


Measured memory_bytes: 16364
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <numeric>
#include <cmath>

using namespace std;
typedef long long ll;

int main(int argc, const char * argv[]) {
    int N; cin >> N;
    auto compare = [](const pair<int, int>& lhs, const pair<int, int>& rhs) {
        return lhs.first > rhs.first;
    };
    priority_queue<pair<int, int>, vector<pair<int, int>>, decltype(compare)> queue(compare);
    for (int i = 0; i < N; i++) {
        int Ai; cin >> Ai;
        queue.push(make_pair(Ai, i+1));
    }
    for (int i = 0; i < N-1; i++) {
        auto top = queue.top();
        queue.pop();
        cout << top.second << " ";
    }
    cout << queue.top().second << endl;

    return 0;
}

Measured memory_bytes: 1780
//ｺｯwwｺｯwwｺｹｯwwwｺｯwwｺｹｯwwwｺｹｯｺｯwwwｺｯwwｺｯwwｺｹｯwwwｺｯwwｺｹｯwwwｺｹｯｺｯwwwｺｹｰｰｰｰｯ!!!wwwwwｺｯwwｺｯwwｺｹｯwwwｺｯwwｺｹｯwwwｺｹｯｺｯwwwｺｯwwｺｯwwｺｹｯwwwｺｯwwwｺｹｯwwwｺｹｯｺｯwwwｺｹｰｰｰｰｯ!!!wwwwwｺｹｯｺｯｯｺｰｰｰｰ!!!!!!wwwwwwwwwww
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int T = sc.nextInt();
        int[] t = new int[n];
        for(int i = 0 ; i < n ; i++){
            t[i] = sc.nextInt();
        }
        sc.close();
        int yono = T;
        for(int i = 0 ; i < n - 1 ; i++){
            if(t[i + 1] - t[i] < T){
                yono += t[i + 1] - t[i];
            }else{
                yono += T;
            }
        }
        System.out.println(yono);
    }
}

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

/* メモリ食い過ぎ注意 */
#define int long long

typedef long long ll;

ll gcd(ll a, int b)
{
    if (a < b)
        gcd(b, a);
    if (b == 0)
        return a;
    int r;
    while ((r = a % b))
    {
        a = b;
        b = r;
    }
    return b;
}

/* define const */
const ll INF = (1ll << 60);
const ll MOD = (ll)1e9 + 7;
/* end defineing */

signed main()
{
    int n;
    int a[100001];
    bool f[100001] = {};
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    int next = 1;
    int current = 1;
    bool ff = false;
    int cnt = 0;
    while (1)
    {
        if (current == 2)
        {
            // cout << next << endl;
            ff = true;
            break;
        }
        if (f[current] == true)
        {
            // cout << "aa" << endl;
            break;
        }
        f[current] = true;
        current = a[current];
        cnt++;
    }
    if (ff)
        cout << cnt << endl;
    else
        cout << -1 << endl;
}


Measured memory_bytes: 1152
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

//２点間の距離
double distance(double x1, double y1, double x2, double y2) {
    double diffx = abs(x1 - x2), diffy = abs(y1 - y2);
    return(sqrt(diffx*diffx + diffy*diffy));
}

//条件
//2
bool isBInclude(double x1, double y1, double r1, double x2, double y2, double r2) {
    return(distance(x1, y1, x2, y2) < r1 - r2);
}
//-2
bool isAInclude(double x1, double y1, double r1, double x2, double y2, double r2) {
    return(distance(x1, y1, x2, y2) < r2 - r1);
}
//1
bool isIntersect(double x1, double y1, double r1, double x2, double y2, double r2) {
    return(distance(x1, y1, x2, y2) <= r1 + r2);
}
//0
bool isFar(double x1, double y1, double r1, double x2, double y2, double r2) {
    return(distance(x1, y1, x2, y2) > r1 + r2);
}


int main(void) {
    int num; cin >> num;
    
    for(int r = 0; r < num; r++) {
        double x1, y1, r1, x2, y2, r2;
        cin >> x1 >> y1 >>  r1 >>  x2 >>  y2 >> r2;
        if(isBInclude(x1, y1, r1, x2, y2, r2)) cout << "2" << endl;
        else if(isAInclude(x1, y1, r1, x2, y2, r2)) cout << "-2" << endl;
        else if(isIntersect(x1, y1, r1, x2, y2, r2)) cout << "1" << endl;
        else if(isFar(x1, y1, r1, x2, y2, r2)) cout << "0" << endl;
    }
    return(0);
}

Measured memory_bytes: 1228
#include <bits/stdc++.h>
using namespace std;
int main() {
    int A,B;
    cin >> A >> B;
    if(A > 12){
        cout << B << endl;
    }else if(13 > A && A > 5){
        cout << B/2 << endl;
    }else{
        cout << 0 << endl;
    }
}

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

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

  vector<int> Log(N);
  for (int i=0; i<N; i++) {
    cin >> Log.at(i);
  }
  
  vector <pair<int,int>> P(N);
  for (int i=0; i<N; i++){
    P.at(i) = make_pair(Log.at(i), i+1);
  }
  
  sort(P.begin(), P.end());
  
  int first;
  vector<int> order(N);
  for (int i=0; i<N; i++) {
    tie(first, order.at(i)) = P.at(i);
    cout << order.at(i);
    if (i < N-1) {
      cout << " ";
    }
    if (i == N-1) {
      cout << endl;
    }
  }
}

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

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

int main() {
    int n, ans = 0;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    sort(a.rbegin(), a.rend());
    rep(i, n) {
        if (i % 2 == 0)
            ans += a[i];
        else
            ans -= a[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3568
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <math.h>
#include <string>
#include <string.h>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <set>
#include <map>
#include <stdlib.h>
#include <iomanip>

using namespace std;

#define ll long long
#define vi vector<int>
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pi 3.14159265359


int main() {
	ll A,B,C;
	ll sum;
	cin >> A >> B >> C;
	REP(i, B+1) {
		sum = A * i % B;
		if (sum == C) {
			cout << "YES";
			break;
		}
		if (i == B) {
			cout << "NO";
			break;
		}
	}
	return 0;
}

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

int gcd(int x, int y)
{
    if(y==0)
       return x;

    return gcd(y, x%y);
}

int main()
{
    int x, y;
    cin >> x >> y;

    int g= gcd(x,y);

    cout << (x+1)+(y+1)-(g+1) << endl;

    return 0;
}



Measured memory_bytes: 3100
use std::io::*;
use std::str::FromStr;

#[allow(unused_macros)]
macro_rules! scan {
  ($e:expr; $t:ty) => {
    $e.get::<$t>()
  };
  ($e:expr; $($t:ty), *) => {
    ($($e.get::<$t>(),)*)
  }
}

struct Scanner<R: BufRead> {
  reader: R,
  iter: std::vec::IntoIter<String>
}

#[allow(dead_code)]
impl<R: BufRead> Scanner<R> {
  fn new(reader: R) -> Scanner<R> {
    Scanner { reader, iter: vec![String::new()].into_iter() }
  }
  fn new_line(&mut self) {
    let mut line = String::new();
    self.reader.read_line(&mut line).ok();
    self.iter = line.trim().split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>().into_iter();
  }
  fn get<T: FromStr>(&mut self) -> T {
    self.iter.next().unwrap().parse().ok().unwrap()
  }
  fn get_as_vec<T: FromStr>(&mut self) -> Vec<T> {
    self.iter.clone().map(|v| v.parse().ok().unwrap()).collect()
  }
  fn get_line(&mut self) -> String {
    let mut line = String::new();
    self.reader.read_line(&mut line).ok();
    line.trim().to_string()
  }
}

struct Dice {
  label: Vec<i32>,
}

impl Dice {
  fn new(dice: Vec<i32>) -> Dice {
    Dice { label: dice }
  }
  fn top(&self) -> i32 {
    self.label[0]
  }
  fn east(&mut self) {
    let tmp = self.label[0];
    self.label[0] = self.label[3];
    self.label[3] = self.label[5];
    self.label[5] = self.label[2];
    self.label[2] = tmp;
  }
  fn west(&mut self) {
    let tmp = self.label[0];
    self.label[0] = self.label[2];
    self.label[2] = self.label[5];
    self.label[5] = self.label[3];
    self.label[3] = tmp;
  }
  fn north(&mut self) {
    let tmp = self.label[0];
    self.label[0] = self.label[1];
    self.label[1] = self.label[5];
    self.label[5] = self.label[4];
    self.label[4] = tmp;
  }
  fn south(&mut self) {
    let tmp = self.label[0];
    self.label[0] = self.label[4];
    self.label[4] = self.label[5];
    self.label[5] = self.label[1];
    self.label[1] = tmp;
  }
}

fn main() {
  let cin = stdin();
  let cin = cin.lock();
  let mut sc = Scanner::new(cin);
  sc.new_line();
  let dice: Vec<i32> = sc.get_as_vec();
  sc.new_line();
  let s = scan!(sc; String);
  let mut dice = Dice::new(dice);
  for c in s.chars() {
    match c {
      'S' => dice.south(),
      'N' => dice.north(),
      'E' => dice.east(),
      'W' => dice.west(),
      _ => {}
    };
  }
  println!("{}", dice.top());
}



Measured memory_bytes: 5032
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int n;
	cin >> n;
	long int a[100005];
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	sort(a,a+n);
	long int x = 0;
	long int y = 0;
	long int z = 0;
	long int w = 0;
	for(int i=0;i<n-1;i++){
		if(a[i]==a[i+1]){
			x = a[i];
		}
	}
	for(int i=0;i<n-1;i++){
		if(a[i]==a[i+1] && x!=a[i]){
			y = a[i];
		}
	}
	for(int i=0;i<n-3;i++){
		if(a[i]==a[i+3]){
			z = a[i];
			w = a[i];
		}
	}
	cout << max(x*y,z*w) << endl;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define int long long
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(a) a.size()
#define re return 
#define MP make_pair
#define pb push_back
#define pii pair<int,int>
#define se second
#define fi first
using namespace std;
bool visited[200005];
vector<int> frd[200005];
int ret;
int ans=-1;
void dfs(int x){
	visited[x]=1;
	ret++;
	for(int i=0;i<sz(frd[x]);i++) 
		if(!visited[frd[x][i]])
			dfs(frd[x][i]);
}
int n,m;
signed main(){
	ios_base::sync_with_stdio(0);
	cin>>n>>m;
	while(m--){
		int a,b;
		cin>>a>>b;
		a--,b--;
		frd[a].pb(b),frd[b].pb(a);
	}
	for(int i=0;i<n;i++){
		ret=0;
		dfs(i);
		ans=max(ans,ret);
	}
	cout<<ans;
	re 0;
}

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

int main() {
    ios::sync_with_stdio(0);
    
    int n, m;
    cin >> n >> m; 
    vector<int> a(1000100, 0);
    for (int i = 1; i <= n; i++) {
        cin >> a[i]; 
    }

    long long s = accumulate(a.begin()+1, a.begin()+n+1, 0);
    if (n - s >= 0) cout << n - s << "\n";
    else cout << -1 << "\n";
}

Measured memory_bytes: 7204
#include<bits/stdc++.h>
using namespace std;
#define int long long
struct node{
  int key;
  node *left,*right,*p;
  node(){}
  node(int key):key(key){left=right=p=NULL;};
};
node *root;
void insert(node z){
  node *y=NULL;
  node *x=root;
  while(x!=NULL){
    y=x;
    if(z.key<x->key) x=x->left;
    else x=x->right;
  }
  z.p=y;
  if(y==NULL) root=new node(z);
  else if(z.key<y->key) y->left=new node(z);
  else y->right=new node(z);
}
bool find(int z){
  node *x=root;
  while(x!=NULL){
    if(z==x->key) return true;
    if(z<x->key) x=x->left;
    else x=x->right;
  }
  return false;
}
void inorderTreeWalk(node *v){
  if(v==NULL) return;
  inorderTreeWalk(v->left);
  cout<<" "<<v->key;
  inorderTreeWalk(v->right);
}
void preorderTreeWalk(node *v){
  if(v==NULL) return;
  cout<<" "<<v->key;
  preorderTreeWalk(v->left);
  preorderTreeWalk(v->right);
}
signed main(){
  int n;
  cin>>n;
  root=NULL;
  for(int i=0;i<n;i++){
    string s;
    cin>>s;
    //cout<<(root==NULL?-1:root->key)<<endl;
    if(s=="print"){
      inorderTreeWalk(root);
      cout<<endl;
      preorderTreeWalk(root);
      cout<<endl;
      continue;
    }
    int x;
    cin>>x;
    if(s=="insert"){
      insert(node(x));
    }
    if(s=="find"){
      cout<<(find(x)?"yes":"no")<<endl;
    }
  }
}


Measured memory_bytes: 21868
N = int(input())
S = list(input())
S2=[]
R = 0
G = 0
B = 0

for x in range(N):
    if S[x] =="R":
        R +=1
        S2.append(["R",R])
    elif S[x] =="G":
        G +=1
        S2.append(["G",G])
    else:
        B +=1
        S2.append(["B",B])
ans =0
a = 0
b =0
for x in range(N):
    i = S2[x][0]
    for y in range(x,N):
        j = S2[y][0]
        if j != i:
            if j =="R":
                a =R-S2[y][1]+1
            elif j =="G":
                a =G-S2[y][1]+1
            else:
                a =B-S2[y][1]+1
            for z in range(x,N):
                k = S2[z][0]
                if k != i and k != j:
                    if k =="R":
                        b =R-S2[z][1]+1
                    elif k =="G":
                        b =G-S2[z][1]+1
                    else:
                        b =B-S2[z][1]+1
                    break
            else:
                b = 0
            break
    else:
        a = 0
    ans +=a*b
subn =0
for x in range(N):
    i = S2[x][0]
    for y in range(x,N):
        j = S2[y][0]   
        if j != i:
            d = y-x
            if y+d<N:
                if i!= S2[y+d][0] and j!=S2[y+d][0]:
                    subn +=1
            else:
                break
print(ans-subn)

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



int main() {
  
  int K;
  scanf("%d", &K);
  
  if(K%2==0 || K%5==0){
    printf("-1\n");
    return 0;
  }

  int K1 = K%10;

  map<int,vector<int>> Table;
  Table[1] = {7,6,5,4,3,2,1,0,9,8};
  Table[3] = {9,2,5,8,1,4,7,0,3,6};
  Table[7] = {1,8,5,2,9,6,3,0,7,4};
  Table[9] = {3,4,5,6,7,8,9,0,1,2};
  
  int X = 0;
  int X1;
  int S = 0;
  


  while(!(X==0 && S>0)){
    X1 = X%10;
    X += K*Table[K1][X1];
    X /=10;
    S++;
  }

  printf("%d\n", S);

  return 0;
}




Measured memory_bytes: 3776
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<cassert>
#include<complex>//real().imag().
#include<cctype>
#include<algorithm>
#include<iomanip>
#include<stack>
#include<queue>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<string>
#include<utility>
#include<iterator>
#define pii pair<int,int>
#define make_pair mp
using namespace std;
typedef long long ll;
int n,t;
int a[100005],pre[100005];
bool cmp(int a,int b)
{
    return a>b;
}
int main()
{
    // freopen("D:\\in.txt","r",stdin);
    // freopen("D:\\out.txt","w",stdout);
    //ios::sync_with_stdio(false);
    //system("pause");
    cin>>n>>t;
    int minn=10000000009;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        minn=min(a[i],minn);
        pre[i]=a[i]-minn;
    }
    sort(pre,pre+n,cmp);
    int cnt=1,idx=1;
    while(pre[idx]==pre[idx-1]&&idx<n)
    {
        cnt++;
        idx++;
    }
    cout<<cnt<<endl;
    return 0;
}



Measured memory_bytes: 1024
arr = []
line = gets.chomp.split
line[1..-1].each{|str| arr << [str[0, 2].to_i * 60 + str[3, 2].to_i, str[6, 2].to_i * 60 + str[9, 2].to_i]}
arr2 = Array.new(arr.length){[0, 0]}

gets.to_i.times{
    ar = []
    line = gets.chomp.split
    line[1..-1].each{|str| ar << [str[0, 2].to_i * 60 + str[3, 2].to_i, str[6, 2].to_i * 60 + str[9, 2].to_i]}
    arr.each_with_index{|item, i| ar.each{|st, et| arr2[i][0] += 1 if item[0] >= st && item[1] <= et}}
}

gets.to_i.times{
    ar = []
    line = gets.chomp.split
    line[1..-1].each{|str| ar << [str[0, 2].to_i * 60 + str[3, 2].to_i, str[6, 2].to_i * 60 + str[9, 2].to_i]}
    arr.each_with_index{|item, i| ar.each{|st, et| arr2[i][1] += 1 if item[0] >= st && item[1] <= et}}
}

sum = 0
arr2.each{|ar| sum += ar.min}
puts sum



Measured memory_bytes: 8904
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(auto i=0;i<n;++i)
#define REPR(i,n) for(auto i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(auto i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(n,v) {int tmp;for(int i=0;i<n;++i){scanf("%d",&tmp);v.push_back(tmp);}}

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

using namespace std;

typedef pair<int,int> pii;

bool dp[110][10010];

int main(){

  int n;
  cin >> n;
  vector<int> s(n);
  REP(i,n){
    cin >> s[i];
  }

  dp[0][0] = true;
  for(int i = 0; i < n; ++i){
    for(int j = 0; j <= n * 100; ++j){
      if(j - s[i] >= 0){
        dp[i+1][j] = max(dp[i][j-s[i]], dp[i][j]);
      }else{
        dp[i+1][j] = dp[i][j];
      }
    }
  }

  int ans = 0;
  REP(i,n*100+1){
    if(dp[n][i] && i % 10 != 0)
    ans = max(ans, i);
  }

  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
int a[3005],x,y,n;
vector<int>e[3005];
int dfs(int x,int fa)
{
    for(int i=0;i<e[x].size();i++) if(e[x][i]!=fa&&a[x]>a[e[x][i]]&&!dfs(e[x][i],x)) return 1;
    return 0;
}
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    for(int i=1;i<n;i++) scanf("%d%d",&x,&y),e[x].push_back(y),e[y].push_back(x);
    for(int i=1;i<=n;i++) if(dfs(i,0)) printf("%d ",i);
}

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

#define trace(...) __f( #__VA_ARGS__ , __VA_ARGS__ )
template <typename Arg1>
void __f( const char* name , Arg1&& arg1 ) {
        cerr << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f( const char* na , Arg1&& arg1 , Args&&... args ) {
        const char* c = strchr( na + 1 , ',' );
        cerr.write( na , c - na ) << " : " << arg1 << " , ";
        __f( c + 1 , args... );
}
#define endl "\n"
#define all(V) V.begin(),V.end()
#define Unique(V) sort(all(V)),V.erase(unique(all(V)),V.end())
#define IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long int LL;
typedef pair <int,int> pii;
const int MOD = 1e9 + 7;
const int inf = 1e9;
const double EPS = 1e-9;
const double PI = acos(-1.0);
const long long INF = 1e18;
const int N = 1e5 + 5;

LL a , b , c , d;

LL lcm( LL x , LL y ) {
        return x/__gcd( c , d ) * y;
}
LL solve( LL x ) {
        return x/d + x/c - x/lcm(c,d);
}
int main( ) {
        IO;
        #ifdef LOCAL
            //freopen( "input.txt" , "r" , stdin );
        #endif // LOCAL
        cin >> a >> b >> c >> d;
        LL x = solve( b ) - solve( a - 1 );
        cout << b - a + 1 - x << endl;
        return 0;
}










Measured memory_bytes: 256
#include <iostream>
#include <vector>

using namespace std;

int main() {
    int N, M; cin >> N >> M;
    vector<int> sum(M);

    for (int i = 0; i < N; i++) {
        int K; cin >> K;
        for (int j = 0; j < K; j++) {
            int A; cin >> A;
            sum[A - 1]++;
        }
    }

    int ans = 0;
    for (int i = 0; i < M; i++) {
        if (sum[i] == N) ans++;
    }

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

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stack>
#include <numeric>
typedef long long ll;
using namespace std;
const int MOD = (int)1e9 + 7;
const ll INF = (ll)1e18 + 7;
#define int long long
#define vint vector<int>
#define pint pair<int,int>
#define pb(a) push_back(a)
#define all(v) v.begin(),v.end()
#define dbg(x) cerr << #x << " = " << (x) << endl
#define yn(b) cout << ((b) ? "Yes" : "No") << endl
#define YN(b) cout << ((b) ? "YES" : "NO") << endl

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

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

	int a, b, c;
	cin >> a >> b >> c;
	cout << min(min(a + b, b + c), c + a) << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())

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

using namespace std;
int main(void)
{
  map<int,char> itoc;
  REP(i,26) itoc[i]=i+'A';
  REP(i,26) itoc[i+26]=i+'a';
  map<char,int> ctoi;
  REP(i,26) ctoi[i+'A']=i;
  REP(i,26) ctoi[i+'a']=i+26;
  for(;;){
    int n;
    cin >> n;
    if(!n) return 0;
    vector<int> key;
    key.resize(n);
    REP(i,n) cin >> key[i];
    string code;
    cin >> code;
    REP(i,code.size())
      code[i]=itoc[(ctoi[code[i]]-key[i%key.size()]+52)%52];
    cout << code << endl;
  }
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<long>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvb = vector<vector<bool>>;
using vvc = vector<vector<char>>;
using vvl = vector<vector<long>>;
using pii = pair<int, int>;
using pil = pair<int, long>;
using pll = pair<long, long>;
#define fix20 cout << fixed << setprecision(20)
#define YES cout << "Yes" << endl
#define NO cout << "No" << endl
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define REP(i,s,t) for(int i=s; i<t; i++)
#define RNG(i,s,t,u) for(int i=s; i<t; i+=u)
#define MOD 1000000007
#define all(vec) vec.begin(), vec.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main(){
  long D;
  cin >> D;
  vector<long> c(26);
  rep(i,26) cin >> c.at(i);
  vector<vector<long>> s(D,vector<long>(26));
  rep(i,D){
    rep(j,26) cin >> s.at(i).at(j);
  }
  
  //vector<long> t(D);
  vector<long> lastday(26,-1);

  long ans = 0;
  rep(i,D){
    vector<long> tmpscore(26,ans);
    rep(j,26){
      tmpscore.at(j) += s.at(i).at(j);
      rep(k,26){
        if(j != k){
          tmpscore.at(j) -= (i - lastday.at(k))*c.at(k);
        }
      }
    }

    long day = 0;
    long maxi = tmpscore.at(0);
    rep(j,26){
      if(tmpscore.at(j) > maxi){
        maxi = tmpscore.at(j);
        day = j;
      }
    }
    ans = maxi;
    cout << day+1 << endl;
    lastday.at(day) = i;
  }

}

Measured memory_bytes: 3720
// luogu-judger-enable-o2
// luogu-judger-enable-o2
// luogu-judger-enable-o2
#pragma GCC optimize(3)
#include<bits/stdc++.h>
#define pos(x) ((x)/block)
using namespace std;
inline char get_char(){
    static char buf[5000001],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,5000000,stdin),p1==p2)?EOF:*p1++;
}
inline int read() {
    char ch;
   int x=0,ff=1;
    do {
        ch=get_char();
    } while((ch<'0'||'9'<ch)&&ch!='-');
    if(ch=='-')ff=-1,ch=get_char();
    while('0'<=ch&&ch<='9') {
        x=10*x+ch-'0';
        ch=get_char();
    }
    return x;
}
inline int writeint(int a,int first) {
    if(a<0) {
        putchar('-');
        writeint(-a,0);
        return 0;
    }
    if(a) {
        writeint(a/10,0);
        putchar(a%10+48);
    }
    if(first&&(!a))putchar('0');
    return 0;
}
int n,q,a[500005],cnt[1000005],block,ans[500005],anss;
struct Query{
    int l,r,id;
    bool operator <(const Query qk) const {
        return pos(l)^pos(qk.l)?pos(l)<pos(qk.l):pos(l)&1?r<qk.r:r>qk.r;
    }
}qy[500005];
inline void Add(register int x){
    if(!cnt[a[x]])++anss;
    ++cnt[a[x]];
}
inline void Del(register int x){
    --cnt[a[x]];
    if(!cnt[a[x]])--anss;
}
int main(){
    n=read();
    q=read();
    for(register int i=1;i<=n;i++)a[i]=read();
    block=n/sqrt(q);
    for(register int i=1;i<=q;i++){
        qy[i].l=read(),qy[i].r=read();
        qy[i].id=i;
    }
    sort(qy+1,qy+q+1);
    register int l=1,r=0;
    for(register int i=1;i<=q;i++){
        while(l>qy[i].l)Add(--l);
        while(r<qy[i].r)Add(++r);
        while(l<qy[i].l)Del(l++);
        while(r>qy[i].r)Del(r--);
        ans[qy[i].id]=anss;
    }
    for(register int i=1;i<=q;i++)writeint(ans[i],1),putchar('\n');
    return 0;
}

Measured memory_bytes: 20364
// 2020-09-28 19:19:45
// clang-format off
#include <bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = long long;
using ld = long double;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
using P = pair<int, int>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }
// #include <atcoder/convolution>
// #include <atcoder/dsu>
// #include <atcoder/fenwicktree>
// #include <atcoder/lazysegtree>
// #include <atcoder/math>
// #include <atcoder/maxflow>
// #include <atcoder/mincostflow>
// #include <atcoder/modint>
// #include <atcoder/scc>
// #include <atcoder/segtree>
// #include <atcoder/string>
// #include <atcoder/twosat>
// #include <atcoder/all>
// using namespace atcoder;

// clang-format on
void answer() {
  string s;
  cin >> s;
  int n = s.size();
  if (n <= 3) {
    if (n == 2 && s == "10") {
      cout << "1 2" << '\n';
    } else if (n == 3 && s == "110") {
      cout << "1 2" << '\n';
      cout << "2 3" << '\n';
    } else {
      cout << "-1" << '\n';
    }
    return;
  }
  vector<int> a(n + 1);
  rep(i, n) a[i + 1] = s[i] - '0';
  if (a[1] == 0 || a[n - 1] == 0 || a[n] == 1) {
    cout << "-1" << '\n';
    return;
  }
  REPC(i, 1, n / 2) if (a[i] != a[n - i]) {
    cout << -1 << '\n';
    return;
  }
  vector<int> p(n + 1, 0);
  int ci = 1, ni = 2;
  while (ni <= n / 2 + 1) {
    if (a[ni - 1]) {
      p[ci] = ni;
      ci = ni;
    } else {
      p[ni] = ci;
    }
    ni++;
  }
  while (ni <= n) p[ni++] = ci;
  REPC(i, 1, n) if (p[i] > 0) cout << i << ' ' << p[i] << '\n';
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

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

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

  vector<long long> L(2);
  L.at(0) = 2;
  L.at(1) = 1;

  if (N >= 2) {
    for (int i = 2; i <= N; i++) {
      long long num = L.at(i - 1) + L.at(i - 2);
      L.push_back(num);
    }
  }
  cout << L.at(N) << endl;

  return 0;
}


Measured memory_bytes: 256
def F(a,b):
 A,B=len(a),len(b)
 r=[0]*A
 for i in range(A):
  f=1
  for j in range(min(A-i,B)):
   if len(set([a[i+j],b[j],'?']))>2:f=0;break
  r[i]=f
 return r+[1]
def T(ix):
 i1,i2,i3=ix;ab,bc,ac=M[i1][i2],M[i2][i3],M[i1][i3];A,B,C=map(len,[S[i]for i in ix]);q=A+B+C
 for l in range(A+1):
  if ab[l]!=0:
   for r in range(l,A+B+1):
    if (B<r-l or bc[r-l]==1) and ac[min(A,r)]==1:q=min(q,max(A,l+B,r+C))
 return q
S=[input()for i in'abc']
M=[[F(S[i],S[j]) if i!=j else []for j in range(3)]for i in range(3)]
print(min([T(i)for i in [(0,1,2),(0,2,1),(1,0,2),(1,2,0),(2,1,0),(2,0,1)]]))

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

int main(){
    int A,B,C,D;
    cin >> A >> B >> C >> D;
    int start,end;
    if (A < C) start = C; //max
    else start = A;

    if (B < D) end = B; //min
    else end = D;

    if(end-start < 0) cout << 0 << endl;
    else cout << end-start << endl;
    return 0;
}

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

int main(){

  ll a,b=0;
  cin>>a>>b;
	
  ll sum=0;
  ll today=0;
  rep(i,b){
  
  cin>>today;
  sum+=today;
  
  }
  
  if(a<sum)cout<<-1<<endl;
  else cout<<a-sum<<endl;

}

Measured memory_bytes: 3632
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
 


public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static         Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);   cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static int K,N;
	static long mod =1000000007;
	public static void main(String[] args) {
			int N=sc.nextInt();
			int M=sc.nextInt();
			
			
			
			
			int v[]=new int[N];
			int a,b;
			for(int i=0;i<M;i++) {
				a=sc.nextInt();
				b=sc.nextInt();
				
					v[a-1]++;
					v[b-1]++;
				
				
			}
			for(int i:v) {
				p(i);
			}
			
			
	}

	
	//static ArrayList<Integer> cc = new ArrayList<>(10001);
	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	public static int gcd(int a, int b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
}
	


Measured memory_bytes: 21844
#[allow(dead_code)]
fn is_whitespace(c: &char) -> bool {
    c.is_whitespace()
}

#[allow(dead_code)]
fn is_eol(c: &char) -> bool {
    ['\r', '\n'].contains(c)
}

#[allow(unused_macros)]
macro_rules! input {
    ($var:ident, $($r:tt)*) => {
        input_inner!{$var, $($r)*}
    };

    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        #[allow(unused_mut, unused_variables, bare_trait_objects)]
        let mut next = move |f: &Fn(&char)->bool| -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|f(&c))
                .take_while(|c|!f(&c))
                .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)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $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 ; eol ]) => {
        $next(&is_eol).split(' ').map(|x| x.parse::<$t>().unwrap()).collect::<Vec<_>>()
    };

    ($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, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

    ($next:expr, parser) => {
        $next
    };

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

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap, HashSet};

#[allow(dead_code)]
struct Edge {
    from: usize,
    to: usize,
}

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;
#[allow(dead_code)]
const M: usize = 1_000_000_007;

fn main() {
    input! {
        L: f64,
    }

    println!("{}", L * L * L / 3.0 / 3.0 / 3.0);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#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 ll = long long;
using vec = vector<ll>;
using vec2 = vector<vector<ll>>;
ll inf = pow(2,62);

int main(){
    string n;
    cin >> n;
    ll l = n.size();
    ll ans = 0;
    rep(i,l){
        char c = n.at(i);
        //cout << c << endl;
        ll o = (ll)c - 48;
        //cout << o << endl;
        ans += o;
        //cout << ans << endl;
    }
    if(ans == 0){
        cout << "Yes" << endl;
    }
    else if(ans % 9 == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}


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

using namespace std;

#define allof(x) (x).begin(), (x).end()

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;



int main(){
    cin.tie(0);
    cin.sync_with_stdio(0);

    string ans;

    ll num;
    cin >> num;

    if(num == 0){
        cout << 0;
        return 0;
    }

    for(ll a = 0; num; a++){
        if(num % (2ll << a)){
            ans += "1";
            if(a % 2){
                num += 1ll << a;
            } else {
                num -= 1ll << a;
            }
        } else {
            ans += "0";
        }
    }

    reverse(allof(ans));

    cout << ans;
}


Measured memory_bytes: 256
S = input()
def saiki(i,s):
    if i == 3:
        if eval(s) == 7:
            print(str(s) + "=7")
            exit()
        else:
            return
    saiki(i+1,s+"+"+S[i+1])
    saiki(i+1,s+"-"+S[i+1])

saiki(0,S[0])



Measured memory_bytes: 3060
# 解説AC 復習しよう
a, b, c, d = map(int, input().split())
dp = [[0] * (d + 1) for i in range(c + 1)]
dp[a][b] = 1
mod = 998244353
for i in range(a, c + 1):
    for j in range(b, d + 1):
        if i > a or j > b:
            dp[i][j] = dp[i][j - 1] * i + dp[i - 1][j] * j - dp[i - 1][j - 1] * (i - 1) * (j - 1)
            dp[i][j] %= mod
print(dp[c][d])

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

#define ll            long long
#define pb            push_back
#define si            set <int>
#define F             first
#define S             second
#define mii           map<int ,int >
#define msi           map<string,int >
#define mis           map<int , string>
#define fr(i,a,b)     for(int  i=a;i<=b;i++)
#define loop(i,n)     for(int i=0;i<n;i++)
#define all(v)        v.begin(),v.end()
#define vi            vector<int >
#define vii           vector<pair<int , int >>
#define vs            vector<string>
#define sz(x)         (int )x.size()
#define M             1000000007
#define mp            make_pair
#define input(arr,n)  loop(i,n) cin>>arr[i]
#define output(arr,n) loop(i,n) cout<<arr[i]<<" "
#define mod           998244353
#define sof           sizeof
using namespace std;
int gcd(int a,int b){
  if(b==0)return a;
  return gcd(b,a%b);
}

bool isPrime(int num){
    
    if(num==2) return true;
    if(num<2 || num%2==0) return false;
    for(int i = 3; i*i <=num; i+=2) {
       if(num % i == 0) {
          
          return false;
       }
    }
    return true;
   
}

bool comp(const pair<int,int> &a,const pair<int,int> &b){
  return a.F>b.F;
}

vector<vector<int>> L(3005,vector<int>(3005,-1));
string a,b;


const int N = 1e5+2;
vector<int> adj_list[N];

int dp[N];
bool visited[N]={false};


void recursive_func(int source){
  visited[source]=true;
  dp[source]=0;

  for(auto neighbour:adj_list[source]){    
    if( !visited[neighbour] ){
      recursive_func(neighbour);
    }
    dp[source]=max( dp[source], 1+dp[neighbour]);
  }
}

void solve(){
  
  int n,m;
  cin>>n>>m;
  int x,y;
  loop(i,m){
    cin>>x>>y;
    adj_list[x].push_back(y);
  }

  for(int i=1;i<=n;i++){
    if(!visited[i])
      recursive_func(i);
  }

  int ma=0;
  for(int i=1;i<=n;i++){
    
    ma=max(dp[i],ma);
  }
  cout<<ma;

}




signed main()   
{
  ios_base::sync_with_stdio(false);
  cin.tie(0); 
  cout.tie(0);
  #ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout); 
  #endif  

  int t;
  t=1;
  //cin>>t;
  loop(i,t){

      solve();
      if(i<t-1) cout<<"\n";
  }

  
  
  //directed graph
    



}
  


  




Measured memory_bytes: 47700
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll a,b,c,ma,ans=0;
    scanf("%lld %lld %lld %lld",&a,&b,&c,&ma);
    for(int i=0;i<=a;i++)
    {
        for(int j=0;j<=b;j++)
        {
            for(int k=0;k<=c;k++)
            {
                if((i*500+j*100+k*50)==ma)
                    ans++;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
A,B,K = map(int,input().split())

if A < B:
    tmp = A
    A = B
    B = tmp

numA = []
for i in range(A+1,0,-1):
    if A % i == 0 :
        numA.append(i)

count = 0
for j in range(len(numA)):
    if B % numA[j] == 0:
        count += 1
        if count == K:
            print(numA[j])
            break

Measured memory_bytes: 3064
#pragma GCC optimize("Ofast")
#include<stdio.h>
int main(void)
{
    switch(getchar_unlocked())
    {
      case '2': puts("14"); return 0;
      case '3': puts("39"); return 0;
      case '4': puts("84"); return 0;
      case '5': puts("155"); return 0;
      case '6': puts("258"); return 0;
      case '7': puts("399"); return 0;
      case '8': puts("584"); return 0;
      case '9': puts("819"); return 0;
      default: switch(getchar_unlocked())
      {
        case '0': puts("1110"); return 0;
        default: puts("3");
      }
    }
    return 0;
}


Measured memory_bytes: 1528
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <vector>

#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>

using namespace std;

typedef long long LL;

#define dump(c) { for (auto it = c.begin(); it != c.end(); ++it) if (it == c.begin()) cout << *it; else cout << ' ' << *it; cout << endl; } 


int main()
{
    string S;
    int N, K;
    cin >> N >> K >> S;

    int ans = 0;
    for (int i = 0; i < N; ++i) {
        if (S[i] == 'L') {
            if (0 < i && S[i-1] == 'L') {
                ++ans;
            }
        } else {
            if (i < N-1 && S[i+1] == 'R') {
                ++ans;
            }
        }
    }

    ans = min(ans + 2 * K, N-1);

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define N 1000005
#define ll long long int 	
#define MP make_pair
#define pb push_back
#define ppb pop_back
#define sp " "
#define endl "\n"
#define fi first
#define se second
#define ii pair<int,int>
#define lli pair<ll,ll>
#define fast cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
#define fast2 freopen ("badhair.gir","r",stdin);freopen ("badhair.cik","w",stdout);
#define mod 1000000007
#define fs(x,y) for(int i=1;i<=y;i++) cin>>x[i]
#define fo(i,x,y) for(int i=x;i<=y;i++)
#define INF 1000000000005
using namespace std;

ll n,m,ar[N],sum;

priority_queue<ll> pq;


int main()
{
	fast;
	cin>>n>>m;
	fs(ar,n);
	fo(i,1,n)
		pq.push(ar[i]);

	while(m--)
	{
		ll x=pq.top();
		pq.pop();
		pq.push(x/2);
	}
	while(pq.size())
	{
		sum+=pq.top();
		pq.pop();
	}
	cout<<sum;
}



/*     cd onedrive\desktop\kod
cls

Sinav:21-22 aralik
Aciklama: Muhtemelen 25 aralik
*/

Measured memory_bytes: 2168