akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;
int main() {
  int i, j, r, c;
  int s[101][101] = {};
  cin >> r >> c;
  for(i = 0; i < r; i++) {
	for(j = 0; j < c; j++) {
	  cin >> s[i][j];
	}
  }
  for(i = 0; i < r; i++) {
	for(j = 0; j < c; j++) {
	  s[i][c] += s[i][j];
	  s[r][j] += s[i][j];
	  s[r][c] += s[i][j];
	}
  }
  for(i = 0; i < r + 1; i++) {
	for(j = 0; j < c + 1; j++) {
	  cout << s[i][j];
	  if(j < c) { cout << " "; }
	  else { cout << endl; }
	}
  }
  return 0;
}

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

public class Main {

	public static void main(String[] args) {

		FastScanner sc = new FastScanner();
		int N = sc.nextInt();
		int[] W = new int[N + 1];
		for (int i = 1; i <= N; i++)
			W[i] = sc.nextInt();
		int S1 = 0;
		int S2 = 0;
		int max = 0;
		for (int i = 1; i <= N; i++)
			max += W[i];
		int ans = max;

		for (int t = 1; t <= N; t++) {
			for (int i = 1; i <= t; i++) {
				S1 += W[i];
			}
			S2 = max - S1;
			ans = Math.min(ans, Math.abs(S1 - S2));
			S1 = 0;
			S2 = 0;
		}

		System.out.println(ans);
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}

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


Measured memory_bytes: 21204
#include <stdio.h>
#include <stdlib.h>

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

  int j = 0;
  int stac[99];
  char str[16];

  while(scanf("%s",str) != EOF){
    switch(*str){
    case '+':
      j--;
      stac[j-1] += stac[j];
      break;
    case '-':
      j--;
      stac[j-1] -= stac[j];
      break;
    case '*':
      j--;
      stac[j-1] *= stac[j];
      break;
    default:
      stac[j++] = atoi(str);
      break;  
    }
  }
  printf("%d\n",*stac);
  return 0;
}

Measured memory_bytes: 548
// inputに入力データ全体が入る
function Main(input) {
    // 1行目がinput[0], 2行目がinput[1], …に入る
    input = input.split("\n");
    let N = input[0];
    let mySet = new Set();
    for (let i = 1; i <= N; i++){
        mySet.add(input[i]);
    }
    console.log(mySet.size);

}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 57344
#include<cstdio>
int F[46];
int fib(int flag){
	if(flag<2){
		return 1;
	}else if(F[flag]){
		return F[flag];
	}else{
		return F[flag]=fib(flag-1)+fib(flag-2);
	}
}
int main(){
	int num;
	scanf("%d", &num);
	printf("%d\n", fib(num));
	return 0;
}


Measured memory_bytes: 2724
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define MAXN 2*100000+5
char s1[MAXN],s2[MAXN];
int a[30],b[30];
int main() {
	scanf("%s",s1),scanf("%s",s2);
	for(int i=0;s1[i];i++)
		a[s1[i]-'a']++;
	for(int i=0;s2[i];i++)
		b[s2[i]-'a']++;
	sort(a,a+30), sort(b,b+30);
	for(int i=0;i<30;i++)
		if(a[i]!=b[i]) {
			puts("No");
			return 0;
		}
	puts("Yes");
}

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

using ll = long long; 

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

  if (a==b && b!=c) {
    cout << "Yes" << endl;
  } 
  else if (b==c && a!=c) {
    cout << "Yes" << endl;
  } 
  else if (a==c && b!=c) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }

}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
#define swap(a, b, type) { type _tmp = a; a = b; b = _tmp; }
typedef long long ll;
typedef unsigned long long ull;

int main()
{
	string S;
	int len, cnt = 0;
	bool ans = true;

	cin >> S;
	len = S.length();

	if (S[0] != 'A') ans = false;
	if (S[1] < 'a' || 'z' < S[1]) ans = false;
	if (S[len - 1] < 'a' || 'z' < S[len - 1]) ans = false;

	repc(i, 2, len - 2) {
		if (S[i] == 'C') cnt++;
		else if (S[i] < 'a' || 'z' < S[i]) ans = false;
	}

	if (cnt != 1) ans = false;

	cout << (ans ? "AC" : "WA") << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

int main(){
    long int N;
    cin >> N;
    long int temp = 1+N;
    for(int i=2;i<=int(sqrt(N));i++){
        if(N%i==0){
            long int a = i;
            long int b = N/i;
            if(a+b<=temp) temp = a+b;
        }
    }
    cout << temp - 2 << endl;
    return 0;
}

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

int n, h;
vector<pair<int, bool>> at;

int main() {
	cin >> n >> h;
	for (int i = 0, a, b; i < n; i++) {
		cin >> a >> b;
		at.emplace_back(a, 1);
		at.emplace_back(b, 0);
	}
	sort(at.begin(), at.end(), [](auto &x, auto &y) {
		return x.first > y.first;
	});
	int rv = 0;
	for (int i = 0; h > 0; i++) {
		if (at[i].second) {
			rv += (h + at[i].first - 1) / at[i].first;
			break;
		} else {
			rv++;
			h -= at[i].first;
		}

	}
	cout << rv << endl;
}


Measured memory_bytes: 2548
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC160B
{
    class Program
    {
        static void Main(string[] args)
        {
            int X = int.Parse(Console.ReadLine());
            int count500 = 0;
            while (X >= 500)
            {
                X -= 500;
                count500 += 1;
            }
            int count5 = 0;
            while (X >= 5)
            {
                X -= 5;
                count5 += 1;
            }
            Console.WriteLine(1000 * count500 + 5 * count5);
        }
    }
}


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


int main() {
    string S;
    cin >> S;
    ll sum = 0;
    int n = S.size();
    if (n == 1) sum = stol(S);
    for (int bit = 0; bit < (1<<n-1); bit++) {
        string tmp = S;
        for (int i = 0; i < n-1; ++i) {
            if (bit & (1<<i)) {
                sum += stol(tmp.substr(n-i-1));
                tmp = tmp.erase(n-i-1);
            }
            if (i == n - 2) sum += stol(tmp);
        }
    }
    cout << sum << endl;
}


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

int main(){
    long long int n, m;
    cin >> n >> m;
    long long int ans;

    if(n*2 > m) ans = m/2;
    else{
        ans = n;
        m -= n*2;
        ans += m/4;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3584
import java.awt.geom.Point2D;
import java.util.Scanner;
public class Main {
	Scanner in = new Scanner(System.in);
	public static void main(String[] args) {
		new Main();
	}
	public Main() {
		new AOJ1032().doIt();
	}
	
	class AOJ1032{
		int n;
		Pair[] pair;
		int[] sx = {-1,0,1,-2,-2,-2,2,2,2,-1,0,1};
		int[] sy = {-2,-2,-2,-1,0,1,-1,0,1,2,2,2};
		void doIt(){
			while(true){
				int x = in.nextInt();
				int y = in.nextInt();
				if(x==0&&y==0)return;
				n = in.nextInt();
				pair = new Pair[n];
				for(int i=0;i<n;i++)pair[i] = new Pair(in.nextInt(), in.nextInt());
				System.out.println(solve(x, y)?"OK":"NA");
			}
		}
		
		boolean dfs(int x,int y,int index){
//			System.out.println(x+" "+y+" "+index);
			if(index==n)return true;
			for(int i=0;i<sx.length;i++){
				int nx = x+sx[i];
				int ny = y+sy[i];
				if(nx<0||nx>=10||ny<0||ny>=10)continue;
//				System.out.println(nx+" "+ny);
//				System.out.println(new Point2D.Double(nx, ny).distance(new Point2D.Double(x,y)));
				if(new Point2D.Double(nx, ny).distance(new Point2D.Double(pair[index].x,pair[index].y))<1.5){
					if(dfs(nx, ny, index+1))return true;
				}
			}
			return false;
		}
		
		boolean solve(int x,int y){
			if(dfs(x, y, 0))return true;
			return false;
		}
		
		class Pair{
			int x,y;
			public Pair(int x,int y) {
				this.x = x;
				this.y =y;
			}
		}
	}
	
}

Measured memory_bytes: 18196
x, y, a, b, c = map(int, input().split())
v = []
l = list(map(int, input().split()))
for i in range(a):
    v.append([l[i], 1])
l = list(map(int, input().split()))
for i in range(b):
    v.append([l[i], 2])
l = list(map(int, input().split()))
for i in range(c):
    v.append([l[i], 3])
v.sort(reverse=True)
res = 0
cnt = [0, 0, 0]
for i in range(len(v)):
    t = v[i][1]
    if cnt[0] == x and t == 1:
        continue
    if cnt[1] == y and t == 2:
        continue
    if sum(cnt) == x + y:
        break
    cnt[t - 1] += 1
    res += v[i][0]
print(res)

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

using namespace std;

#define pb push_back
#define mp make_pair
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long LL;
typedef pair<int, int> PII;

int a[11];


int main() {
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    int i = 0;
    while (n > 0) {
        a[i] = n%10;
        n/=10;
        i++;
    }
    forn (i, 1) {
        if (a[i] == a[i+1] && a[i] == a[i+2] ||
            a[i+1] == a[i+2] && a[i+1] == a[i+3]) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
   int n,m,i,j;
   j=0;
   scanf("%d", &n);
   char str[n];
   scanf("%s", str);
   m=n;
   while(m>0){
     m=m-2;
   }
   if(m==-1){
     printf("No");
   }
   else{
     for(i=0;i<n/2;i++){
        if(str[i]==str[i+n/2]){
           j=j+1;
        }
        else{
           j=j;
        }
     }
     if(j==n/2){
        printf("Yes");
     }
     else{
        printf("No");
     }
   }   
}

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

int main(){
  int i,j;
  char c[3][3];
    
  for (i=0;i<3;i++){
    for (j=0;j<3;j++){
  		cin >> c[i][j];
    }
  }
  for (i=0;i<3;i++){
    for (j=0;j<3;j++){
      if (i==j){
        cout << c[i][j];
      }
    }
  }
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <functional>
#include <climits>

using namespace std;

int main() {
    int n, val = 0;
    cin >> n;
    vector<int> v(n), c(n), s(n);
    for (size_t i = 0; i < n; i++)
    {
        cin >> v[i];
    }
    for (size_t i = 0; i < n; i++)
    {
        cin >> c[i];
    }
    for (size_t i = 0; i < n; i++)
    {
        s[i] = v[i] - c[i];
    }
    for (size_t i = 0; i < n; i++)
    {
        if(s[i] > 0) {
            val += s[i];
        }
    }
    cout << val << endl;
    
}


Measured memory_bytes: 256
macro_rules !input {(source =$s :expr ,$($r :tt ) *) =>{let mut iter =$s .split_whitespace () ;let mut next =||{iter .next () .unwrap () } ;input_inner !{next ,$($r ) *} } ;($($r :tt ) *) =>{let stdin =std ::io ::stdin () ;let mut bytes =std ::io ::Read ::bytes (std ::io ::BufReader ::new (stdin .lock () ) ) ;let mut next =move ||->String {bytes .by_ref () .map (|r |r .unwrap () as char ) .skip_while (|c |c .is_whitespace () ) .take_while (|c |!c .is_whitespace () ) .collect () } ;input_inner !{next ,$($r ) *} } ;}
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 ) *} } ;}
macro_rules !read_value {($next :expr ,($($t :tt ) ,*) ) =>{($(read_value !($next ,$t ) ) ,*) } ;($next :expr ,[$t :tt ;$len :expr ] ) =>{(0 ..$len ) .map (|_ |read_value !($next ,$t ) ) .collect ::<Vec <_ >>() } ;($next :expr ,chars ) =>{read_value !($next ,String ) .chars () .collect ::<Vec <char >>() } ;($next :expr ,usize1 ) =>{read_value !($next ,usize ) -1 } ;($next :expr ,$t :ty ) =>{$next () .parse ::<$t >() .expect ("Parse error" ) } ;}

fn main() {
   input! {n:usize}
   let ans = match n % 11 {
      0 => (n / 11) * 2,
      1...6 => (n / 11 + 1) * 2 - 1,
      _ => (n / 11 + 1) * 2,
   };
   println!("{}", ans);
}


Measured memory_bytes: 4352
use std::io;

fn main() {
    let scan = std::io::stdin();
    let mut line = String::new();
    let _ = scan.read_line(&mut line);
    let vec: Vec<&str> = line.split_whitespace().collect();
    let joined_number = vec.join("").parse::<f32>().unwrap();
    let sqrted = joined_number.sqrt() as i32;
    if sqrted * sqrted == (joined_number as i32) {
        println!("Yes");
    } else {
        println!("No");
    }
}



Measured memory_bytes: 4352
//zdj
#include<cstdio>
#include<cstring>
char s[100010],c[120];
signed main()
{
	scanf("%s",s),c[98]=0,c[100]=2,c[112]=1,c[113]=3;int l(strlen(s)),ll(l>>1);
	for(register int i(0);i<=ll;i++)
		if(c[s[i]]^((c[s[l-i-1]]+2)%4))
			return puts("No"),0;
	return puts("Yes"),0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long dp[2097160],n,a[25][25],mod=1000000007;
long long f(long long mask,long long jum)
{
	if(mask==(1<<n)-1) return 1;
	if(dp[mask]!=-1) return dp[mask];
	long long res = 0;
	for(int i=0;i<n;i++)
	{
		if(a[jum][i] && !(mask&(1<<i)))
		{
			res+=f(mask|(1<<i),jum+1)%mod;
			res%=mod;
		}
	}
	return dp[mask] = res%mod;
}
int main()
{
	scanf("%lld",&n);
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			scanf("%lld",&a[i][j]);
		}
	}
	for(int i=0;i<=(1<<n);i++)
	{
		dp[i] = -1;
	}
	printf("%lld\n",f(0,0));
	return 0;
}

Measured memory_bytes: 16640
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)

#define Rep(j,n) for(int j=i+1;j<(int)(n);++j)

#define int long long

using namespace std;

signed main()
{
    bool maxtrue=true;
    int a,b,c;
    cin>>a>>b>>c;
    cout<<((a*c<b)?c:b/a);
    return 0;
}



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

#define rep(i, a, b) for (int i = a; i < (int)(b); ++i)
#define rrep(i, a, b) for (int i = b - 1; i >= (int)(a); --i)

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;

constexpr int MOD = 1000000007;

int pow(int x, int p) {
    if (p == 0) { return 1; }
    if (p == 1) { return x; }
    if (p % 2) { return x * pow(x, p - 1); }
    int sub = pow(x, p / 2);
    return sub * sub;
}

vi hdivide(int i, int h) {
    vi hlines = {0};
    rep(j, 0, h - 1) {
        if ((i / pow(2, j)) % 2 == 1) { hlines.push_back(j + 1); }
    }
    hlines.push_back(h);
    return hlines;
}

vvi divide(const vvi& grid, const vi& hlines, int h, int w) {
    int hg = hlines.size() - 1;
    vvi choko(hg, vi(w, 0));

    rep(x, 0, w) {
        rep(i, 0, hg) {
            int num = 0;
            rep(y, hlines[i], hlines[i + 1]) { num += grid[y][x]; }
            choko[i][x] = num;
        }
    }
    return choko;
}

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

    int h, w, k;
    cin >> h >> w >> k;

    vvi grid(h, vi(w, 0));
    rep(i, 0, h) {
        rep(j, 0, w) {
            char c;
            cin >> c;
            if (c == '1') { grid[i][j] = 1; }
        }
    }

    int ans = INT_MAX;
    rep(i, 0, pow(2, h - 1)) {
        vi hlines = hdivide(i, h);

        int hg = hlines.size() - 1;
        vvi choko = divide(grid, hlines, h, w);

        bool possible = true;
        rep(y, 0, hg) {
            rep(x, 0, w) {
                // cout << choko[y][x];
                if (choko[y][x] > k) { possible = false; }
            }
            // cout << endl;
        }
        // cout << endl;
        if (!possible) { continue; }

        int tmp = hg - 1;
        vi cnt(hg, 0);

        rep(x, 0, w) {
            bool safe = true;
            rep(y, 0, hg) {
                if (cnt[y] + choko[y][x] > k) {
                    safe = false;
                    break;
                }
            }
            if (!safe) {
                ++tmp;
                rep(y, 0, hg) { cnt[y] = choko[y][x]; }
            } else {
                rep(y, 0, hg) { cnt[y] += choko[y][x]; }
            }
        }
        ans = min(ans, tmp);
    }

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

Measured memory_bytes: 384
#include<cstdio>

using namespace std;

int main(){
    int n;
    scanf("%d", &n);
    int p[n];
    int flag[n];
    for(int i = 0; i < n; i++){
        scanf("%d", &p[i]);
        if (p[i] == i + 1) flag[i] = 1;
        else flag[i] = 0;
    }
    int i = 0;
    int count = 0;
    while (i < n){
        if (flag[i] == 1){
            flag[i] = 0;
            flag[i+1] = 0;
            count++;
            i++; 
        }
        i++;
    }
    if (flag[n-1] == 1){
        count++;
    }
    printf("%d\n", count);
    


    
    
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <queue>
using namespace std;

using ll = long long;

const ll INF = (1LL << 50);

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

    vector<ll> a(3 * N);
    for (int i = 0; i < 3 * N; i++) {
        cin >> a[i];
    }

    priority_queue<ll, vector<ll>, greater<ll>> pre_q;
    priority_queue<ll> suf_q;

    vector<ll> pre_sum(3 * N, 0),
               suf_sum(3 * N, 0);
    ll sum = 0;
    for (int i = 0; i < 3 * N; i++) {
        if (pre_q.size() < N) {
            pre_q.push(a[i]);
            sum += a[i];
        } else if (pre_q.top() < a[i]) {
            sum -= pre_q.top(); pre_q.pop();
            pre_q.push(a[i]);
            sum += a[i];
        }
        if (pre_q.size() == N) pre_sum[i] = sum;
        else pre_sum[i] = -INF;
    }

    sum = 0;
    for (int i = 3 * N - 1; i >= 0; i--) {
        if (suf_q.size() < N) {
            suf_q.push(a[i]);
            sum += a[i];
        } else if (suf_q.top() > a[i]){
            sum -= suf_q.top(); suf_q.pop();
            suf_q.push(a[i]);
            sum += a[i];
            suf_sum[i] = sum;
        }
        if (suf_q.size() == N) suf_sum[i] = sum;
        else suf_sum[i] = INF;
    }

    ll ans = -INF;
    for (int i = 0; i < 3 * N - 1; i++) {
        ans = max(ans, pre_sum[i] - suf_sum[i + 1]);
    }
    cout << ans << endl;

    return 0;
}

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

using namespace std;

#define int long long 

signed main(){
	int n;
	cin>>n;
	int h[n+10];
	int maxn=0;
	int sum=0;
	for (int i = 1; i <= n; ++i)
	{
		/* code */
		cin>>h[i];
	}
	for(int i=2;i<=n+1;i++){
		//cin>>h[i];
		if(h[i]<=h[i-1]){
			sum++;
		}else{
			maxn=max(maxn,sum);
			sum=0;
		}
	}
	cout<<maxn;
	
	return 0;
}

Measured memory_bytes: 1024
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long K = sc.nextLong();
        long ans = 0;
        if(K==0) {
            System.out.println(N*N);
            return;
        }
        for(int i = (int)K+1; i<=N; i++) {
            System.err.println((N)/i * (i-K) +" , "+ Math.max(N%i-(K-1), 0));
            ans += (N)/i * (i-K) + Math.max(N%i-(K-1), 0);
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 40000
#include<bits/stdc++.h>
#include<math.h>
#include <stdio.h>
#include<vector>
#include<deque>
#include<stdlib.h>
#include <algorithm>
#include<set>
#include <limits>
#include<iomanip>
#include<string>
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
#define llMAX numeric_limits<long long>::max()
#define intMAX numeric_limits<int>::max()
#define ll long long
#define d_5 100000
#define d9_7 1000000007
ll n,a,b;
vector<ll> h;
 bool judge(ll T){
   vector<ll> h2 = h;
   rep(i,n){
     h2[i]=max((ll)0,h2[i]-T*b);
   }
   ll cnt=0;
  rep(i,n){
    cnt+=(h2[i] +a-b-1)/(a-b);
  }
  if(cnt>T){
    return false;
  }else{
    return true;
  }
 }
int main(void){
  cin >> n>>a>>b;
  ll tmp;
  rep(i,n){
    cin>>tmp;
    h.push_back(tmp);
  }
  sort(h.begin(),h.end(),greater<ll>());
  ll tmax=(h[0]+b-1)/b;
  ll tmin=1;
  while(tmax!=tmin){
    if(judge((tmax+tmin)/2)==true){
      tmax=(tmax+tmin)/2;
    }else{
      tmin=(tmax+tmin)/2 +1;
    }
  }
  cout<<tmin<<endl;
  return 0;
}

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

using namespace std;

int main() {
  int n, a, b;
  int passed = 0;
  int overseas = 0;
  string s;

  cin >> n >> a >> b >> s;

  for (int i=0; i<n; i++) {
    if (s[i] == 'a') {
      if (passed < a + b) {
        cout << "Yes" << endl;
        passed += 1;
      } else {
        cout << "No" << endl;
      }
    } else if (s[i] == 'b') {
      if (passed < a + b && overseas < b) {
        cout << "Yes" << endl;
        passed += 1;
        overseas += 1;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }

  return 0;
}

Measured memory_bytes: 896
n, c, k =map(int, input().split())
t = []
for _ in range(n):
    t.append(int(input()))

t.sort()

passenger = 0
bus = 1
departure = t[0] + k

for i in range(n):
    if passenger < c and departure >= t[i]:
            passenger += 1
    else:
            bus += 1
            passenger= 1
            departure = t[i] + k
print(bus)


Measured memory_bytes: 50392
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
from itertools import product
from collections import defaultdict
def resolve():
    h,w,n=map(int,input().split())
    D=defaultdict(int)
    for _ in range(n):
        a,b=map(int,input().split())
        for i,j in product(range(a-1,a+2),range(b-1,b+2)):
            if(1<=i<=h and 1<=j<=w):
                D[(i,j)]+=1

    ans=[0]*10
    for k,v in D.items():
        i,j=k
        if(i==1 or i==h or j==1 or j==w): continue
        ans[v]+=1
    ans[0]=(h-2)*(w-2)-sum(ans)
    print(*ans,sep='\n')
resolve()

Measured memory_bytes: 152184
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

// https://gist.githubusercontent.com/shibh308/f7ab83aa58b95322f0c5a353121bdecb/raw/b19dcf74b08f80f601d7a5792f2578b6ff9155bf/template.cpp
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;

#define dump(x)  cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl

#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl

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

#define FOREACH(x,a) for(auto& (x) : (a) )

#define SCOUT(x) cout<<(x)<<" "
#define ENDL cout<<endl

#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl

#define ALL(obj) (obj).begin(),(obj).end()

#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class... Tail>
void CINT(istream& cins, Tail&&... tail){
    return;
}
template <class Head,class... Tail>
void CINT(istream& cin, Head&& head,Tail&&... tail){
    cin>>head;
    CINT(cin, move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(cin,__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(cin,__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(cin,__VA_ARGS__)

template <class T = ll>
T IN(){T x;cin>>x;return (x);}

template <class Head>
void VT(Head head){}
template <class Head,class Seco,class... Tail>
void VT(Head&& head,Seco&& seco,Tail&&... tail){
    seco.resize(head);
    VT(head,move(tail)...);
}
void VT2(){}
template <class Head,class... Tail>
void VT2(Head&& head,Tail&&... tail){
    VECCIN(head);
    VT2(move(tail)...);
}

template <class Head>
void VT3(Head&& head){}
template <class Head,class Seco,class... Tail>
void VT3(Head&& head,Seco&& seco,Tail&&... tail){
    seco[head]=IN();
    VT3(head,move(tail)...);
}

#define VCEACH(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);VT2(__VA_ARGS__);
#define VCREP(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);REP(i,n)VT3(i,__VA_ARGS__);

#define P pair<int,int>
#define V vector<int>
#define M map<int,int>
#define S set<int>
#define PQ priority_queue<int>
#define PQG priority_queue<int,V,greater<int>>

#define pb(a) push_back(a)
#define mp make_pair

class CRally {
public:
    void solve(std::istream& cin, std::ostream& cout) {
        CIN(n);
        V x(n);
        VECCIN(x);
        ll m=LINF;
        REP(i,100){
            ll res=0;
            REP(j,n){
                res += (x[j]-i)*(x[j]-i);
            }
            m=min(res,m);
        }
        COUT(m);
    }
};

int main() {
	CRally solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>
#include <cmath>

using namespace std;

#define int long long

#define rep(i, n) for (int i=0;i<(int)n;++i)
#define rep1(i, n) for (int i=1;i<=(int)n;++i)
#define unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using ll=long long;
using vi=vector<int>;
using pii=pair<int, int>;

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); };

bool chmin(int&a,int b){return a>b?(a=b,true):false;}
bool chmax(int&a,int b){return a<b?(a=b,true):false;}
int read(){int a;scanf("%lld",&a);return a;}

const int inf = TEN(9) + 10;
const int mod = TEN(9) + 7;

int Q;

signed main()
{
	cin >> Q;

	int x = 0, mn = 0, S = 0;

	priority_queue<int> small;
	priority_queue<int, vi, greater<int>> big;

	int sz = 0;
	
	rep(_, Q) {
		int t; cin >> t;

		if (t == 1) {
			sz++;
			int a, b; cin >> a >> b;

			S += b;

			if (small.empty()) {
				small.push(a);
				x = a;
			} else {
				if (big.empty()) {
					mn += abs(a - small.top());
				} else {
					if (sz % 2) {
						unless (small.top() <= a and a <= big.top()) {
							mn += min(abs(a - small.top()), abs(a - big.top()));
						}
					} else {
						mn += abs(a - small.top());
					}
				}

				if (small.top() >= a) {
					small.push(a);
				} else {
					big.push(a);
				}

				if (small.size() >= big.size() + 2) {
					big.push(small.top()); small.pop();
				}

				while (big.size() >= small.size() + 1) {
					small.push(big.top()); big.pop();
				}

				if (big.size() > small.size()) return 1;

				x = small.top();
			}
		} else {
			printf("%lld %lld\n", x, mn + S);
		}
	}
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

typedef pair<int, int> ii;
typedef pair<ll, ll> pll;

int main( int argc, char *argv[] ) {
	int a, b ,c;
	cin >> a >> b >> c;
	if ( a + b >= c )
		cout << "Yes" << "\n";
	else
		cout << "No" << "\n";

	return 0;
}


Measured memory_bytes: 256
def main():
    from bisect import bisect_left, bisect_right
    from itertools import accumulate
    import sys

    input = sys.stdin.readline

    N, M, V, P = map(int, input().split())
    *A, = sorted(map(int, input().split()))
    acc = (0,) + tuple(accumulate(A))

    def is_ok(mid):
        x = A[mid]
        ika = bisect_right(A, x)
        rest = max(0, V - ika)
        if rest >= P:
            # 上位P-1に毎回加算して、
            # rest-(P-1)人に対し、最大値を上げないようにして、均等に割り振る
            rng = N - ika - (P - 1) # 加算先候補数
            times = V - (P - 1) - ika # M人のjudgeがtimes回加算する

            range_sum = acc[mid + 1 + rng] - acc[mid + 1]
            to_sub = A[mid + rng] * rng - range_sum
            to_dist = M * times - to_sub

            if to_dist <= 0:
                return A[N - P] <= x + M
            else:
                to_add = (to_dist + rng - 1) // rng
                return max(A[N - P], A[mid + rng] + to_add) <= x + M

        else:
            return A[N - P] <= x + M

    def binary_search():
        ok = N - 1
        ng = -1
        while abs(ok - ng) > 1:
            mid = (ok + ng) // 2
            if is_ok(mid):
                ok = mid
            else:
                ng = mid
        return ok

    idx = binary_search()
    print(N - bisect_left(A, A[idx]))


if __name__ == '__main__':
    main()


Measured memory_bytes: 15028
#include <bits/stdc++.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++)
typedef long long ll;
typedef pair<ll,ll> P;

int main() {
  int n;
  cin>>n;
  vector<string>a(n);
  set<string>memo;
  string s="Yes";
  char c;
  cin>>a[0];
  memo.insert(a[0]);
  c=a[0].at(a[0].size()-1);
  rep2(i,1,n) {
    cin>>a[i];
    if(memo.count(a[i])){
      s="No";
    }
    memo.insert(a[i]);
    if(c!=a[i].at(0)){
      s="No";
    }
    c=a[i].at(a[i].size()-1);
  }
  cout<<s<<endl;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
#define INF (1e10)
using namespace std;
long long int a[10000005]={0};
long long int h[10000005]={0};
long long int rslt,m;
    
long long int ans(long long int n)
{
    if(n==m) return 0;
    if(n>m) return INF;
    if(a[n] != -1) return a[n];
    a[n]=min(ans(n+1)+abs(h[n]-h[n+1]),ans(n+2)+abs(h[n]-h[n+2]));
    return a[n];
}
int main()
{
    cin>>m;
    memset(a,-1,sizeof a);
    for(int i=1; i<=m; i++)
    {
        cin>>h[i];
    }
    cout<<ans(1);
    //cout<<rslt;
}


Measured memory_bytes: 81024
n, m = map(int, raw_input().split())
p = [-1] + map(int, raw_input().split())
edge = {i: [] for i in range(1, n+1)}
for i in range(m):
    x, y = map(int, raw_input().split())
    edge[x].append(y)
    edge[y].append(x)
ans = 0
used = [False] * (n+1)
for i in range(1, n+1):
    if used[i]:
        continue
    used[i] = True
    que = [i]
    S = set([i])
    T = set([p[i]])
    while que:
        u = que.pop(0)
        for v in edge[u]:
            if used[v]:
                continue
            que.append(v)
            used[v] = True
            S.add(v)
            T.add(p[v])
    ans += len(S & T)
print ans

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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

int main(){
  string s;cin>>s;
  int n = s.size();

  bool f=true;
  rep(i, (n-1)/2) if(s[i]!=s[(n-1)/2-1-i])f=false;
  for(int i=(n+3)/2-1;i<n;i++)if(s[i]!=s[n-1-i])f=false;

  if(f)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using pii = pair<int, int>;
 
template <typename T> T inf;
template <> const int inf<int> = 1e9;
template <> const ll inf<ll> = 1e18;
 
int main() {
    int N, H, W;
    cin >> N >> H >> W;
    vector<int> imos(N * (W + 1));
    for(int i = 0; i < N; ++i) {
        int x; cin >> x;
        int p = i * W + (i & 1 ? -x : x);
        p = max(0, min(p, W * (N - 1)));
        for(int i = 0; i < W; ++i) {
            imos[i + p]++;
        }
    }
    int cnt = 0;
    for(int i = 0; i < N * W; ++i) {
        cnt += imos[i] == 0;
    }
    cout << cnt * H << endl;
}



Measured memory_bytes: 3144
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,count=0,count1=0;
    string s;
    cin>>s;
    for(i=0;i<s.size();i++)
    {
        if(s[i]=='A')
        {
            count++;
        }
        else if(s[i]=='B')
        {
            count1++;
        }
    }
    if(count==s.size() || count1==s.size() )
    {
        cout<<"No";
    }
    else
        cout<<"Yes";
}


Measured memory_bytes: 256
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
l = LI()
l.sort()
print(sum(l[0:2]))

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

int main(){
  int n;
  string s;
  cin>>n>>s;
  int ans=1;
  for(int i=0;i<n-1;i++){
    if(s[i]!=s[i+1]) ans++;
  }
  cout<<ans<<endl;
}
  

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

using namespace std;

#define pb push_back
#define sz(x) ((ll)x.size())
#define all(x) x.begin(), x.end()
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;
typedef unsigned long long ul;

const int mn = 1e5 + 5;
const int mod = 1e9 + 7;

void bye() {
	puts("-1");
	exit(0);
}

int n;
char s[205][205];

stack<int> st;
int vis[205];
int pos[205];

void dfs(int x, int fa) {
	if (vis[x] == -1) {
		if ((sz(st) - pos[x]) % 2) {
			bye();
		}
		return;
	}
	vis[x] = -1;
	pos[x] = sz(st);
	st.push(x);
	for (int i = 1; i <= n; i++) {
		if (i != fa && s[x][i] == '1' && vis[i] != 1) dfs(i, x);
	}
	st.pop();
	vis[x] = 1;
}

int dist[205][205];

int main() {
	//cin.sync_with_stdio(0);
#ifdef LOCAL
	freopen("../1.txt", "r", stdin);
	//freopen("my.out", "w", stdout);
	size_t bg = clock();
#endif

	scanf("%d", &n);
	for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
	dfs(1, 0);
	memset(dist, 1, sizeof dist);
	for (int i = 1; i <= n; i++) {
		dist[i][i] = 0;
		for (int j = 1; j <= n; j++) {
			if (s[i][j] == '1') dist[i][j] = 1;
		}
	}
	for (int k = 1; k <= n; k++) {
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= n; j++) {
				dist[i][j] = min(dist[i][k] + dist[k][j], dist[i][j]);
			}
		}
	}
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			if (dist[i][j] < 1e7)
				ans = max(dist[i][j], ans);
		}
	}
	printf("%d\n", ans + 1);


#ifdef LOCAL
	size_t ed = clock();
	printf("time: %f\n", (double) (ed - bg) / CLOCKS_PER_SEC);
#endif
	return 0;
}

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

int main() {
  vector<vector<int>> A(3,vector<int>(3));
  vector<vector<bool>> B(3,vector<bool>(3,0));
  rep(i,3)rep(j,3) cin >> A[i][j];
  int N,cnt=0;
  cin >> N;
  vector<int> b(N);
  rep(i,N) cin>> b[i];
  string ans="No";
  rep(k,N){rep(i,3)rep(j,3){
   if(A[i][j]==b[k]){
     B[i][j]=1;
     cnt++;
   }
  }
  }
  if(cnt>6) ans = "Yes";
  else if(cnt>2){
    vector<bool> temp(8,1);
    rep(i,3)rep(j,3) temp[i] = (temp[i] && B[i][j]);
    rep(j,3)rep(i,3) temp[3+j] = (temp[3+j] && B[i][j]);
    rep(i,3) temp[6] = (temp[6] && B[i][i]);
    rep(i,3) temp[7] = (temp[7] && B[2-i][i]);
    rep(i,8) if(temp[i]==1)ans="Yes";
  }
  
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 3616
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>
#include <numeric>
#include <string.h>
#include <sys/time.h>
#include <random>


#define fs first
#define sc second

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

int N, a[50], b[50];
int finalRes = 1000000;


int check(int *indexes, int n){
    int index = 0;
    vector<P> eve, od;
    for(int i = 0; i < N; i++){
        if(index < n && indexes[index] == i){   // 奇数番目に入るもの
            if(i % 2 == 1){
                od.push_back(P(a[i], i));
            }
            else{
                od.push_back(P(b[i], i));
            }
            index++;
        }
        else {                                  // 偶数番目に入るもの
            if(i % 2 == 1){
                eve.push_back(P(b[i], i));
            }
            else{
                eve.push_back(P(a[i], i));
            }
        }
    }

    sort(eve.begin(), eve.end());
    sort(od.begin(), od.end());


    bool ok = true;
    vector<P> total;
    for(int i = 0; i < N; i++){
        if(i % 2 == 0){
            total.push_back(eve[i/2]);
        }
        else{
            total.push_back(od[i/2]);
        }
    }
    for(int i = 1; i < N; i++){
        if(total[i].fs < total[i-1].fs){
            ok = false;
            break;
        }
    }
    if(ok){
        vector<int> dest(N, 0);
        for(int i = 0; i < N; i++){
            dest[total[i].sc] = i;
        }
        int res = 0;
        for(int i = 0; i < N; i++){
            for(int j = N-1; j >= i+1; j--){
                if(dest[j-1] > dest[j]){
                    swap(dest[j-1], dest[j]);
                    res++;
                }
            }
        }
        finalRes = min(res, finalRes);
    }
}

void recursive_comb(int *indexes, int s, int rest, int n) {
    if (rest == 0) {
        check(indexes, n);
    } else {
        if (s < 0) return;
        recursive_comb(indexes, s - 1, rest, n);
        indexes[rest - 1] = s;
        recursive_comb(indexes, s - 1, rest - 1, n);
    }
}

// nCkの組み合わせに対して処理を実行する
void foreach_comb(int n, int k) {
    int indexes[k];
    recursive_comb(indexes, n - 1, k, k);
}


int main(){
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> a[i];
    }
    for(int i = 0; i < N; i++){
        cin >> b[i];
    }

    foreach_comb(N, N/2);

    if(finalRes == 1000000){
        cout << -1 << endl;
    }
    else{
        cout << finalRes << endl;
    }




    return 0;
}


Measured memory_bytes: 384
n=input()

s=0
yakusu=0



for i in range(1,int(n)+1):
    s=0
    if i%2!=0:
        for k in range(1,i+1):
            if i%k==0:
                s+=1    
    if s==8:
        yakusu+=1         

print(yakusu)

Measured memory_bytes: 9084
#include <stdio.h>
#define N 100
int main(){
  char sa[N], sb[N], sc[N];
  int a=0, b=0, c=0, s=0;
  scanf("%s", sa);
  scanf("%s", sb);
  scanf("%s", sc);

  while(1){
    switch(s){
    case 0 :
      if(sa[a] == '\0'){
        printf("A\n");
        return 0;
      } else {
        switch(sa[a]){
        case 'a' : s = 0; break;
        case 'b' : s = 1; break;
        case 'c' : s = 2; break;
        }
        a++;
      } break;
    case 1 :
      if(sa[b] == '\0'){
        printf("B\n");
        return 0;
      } else {
        switch(sb[b]){
        case 'a' : s = 0; break;
        case 'b' : s = 1; break;
        case 'c' : s = 2; break;
        }
        b++;
      } break;
    case 2 :
      if(sc[c] == '\0'){
        printf("C\n");
        return 0;
      } else {
        switch(sc[c]){
        case 'a' : s = 0; break;
        case 'b' : s = 1; break;
        case 'c' : s = 2; break;
        }
        c++;
      } break;
    }
  }
}

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

/* using */
using namespace std;

/* main constructor */
struct Fast
{
    Fast()
    {
        std::cin.tie(0);
        ios::sync_with_stdio(0);
        //cout << fixed << setprecision(12);
    }
} fast;

/* template */
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}

/* define */
#define REP(i, x, n) for (int i = x; i < (int)(n); ++i)
#define RREP(i, x, n) for (int i = x - 1; i >= (int)(n); --i)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) REP(i, 1, n + 1)
#define rrep(i, n) RREP(i, n, 0)
#define each(i, n) for (auto &i : n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define eunique(x) \
    sort(all(x));  \
    (x).erase(unique(all(x)), (x).end())
#define int long long
#define mp make_pair

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

/* const */
const int inf = 1e9 + 7;

/* main */
signed main(void)
{
    double n;
    cin >> n;
    int ans = pow((int)sqrt(n), 2);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long   signed int LL;
typedef long long unsigned int LU;
#define incID(i, l, r) for(LL i = (l)    ; i <  (r); ++i)
#define incII(i, l, r) for(LL i = (l)    ; i <= (r); ++i)
#define decID(i, l, r) for(LL i = (r) - 1; i >= (l); --i)
#define decII(i, l, r) for(LL i = (r)    ; i >= (l); --i)
#define inc(i, n)  incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec(i, n)  decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))
#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
template<typename T> bool setmin  (T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmax  (T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
LL mo(LL a, LL b) { assert(b > 0); a %= b; if(a < 0) { a += b; } return a; }
LL fl(LL a, LL b) { assert(b > 0); return (a > 0 ? a / b : (a - b + 1) / b); }
LL ce(LL a, LL b) { assert(b > 0); return (a < 0 ? a / b : (a + b - 1) / b); }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
#define bit(b, i) (((b) >> (i)) & 1)
#define BC __builtin_popcountll
#define SC static_cast
#define SI(v) SC<int>(v.size())
#define SL(v) SC<LL >(v.size())
#define RF(e, v) for(auto & e: v)
#define ef else if
#define UR assert(false)

// ---- ----

LL r, d, x;

int main() {
	cin >> r >> d >> x;
	
	inc(i, 10) {
		x = r * x - d;
		cout << x << endl;
	}
	
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>

using namespace std;

int H,W,sum[101][101],sx,sy,f[101][101][101],ans;
char str[101];

inline int get(int l,int r,int u,int d){return sum[d][r]-sum[d][l-1]-sum[u-1][r]+sum[u-1][l-1];}

int main(){
	scanf("%d%d",&H,&W);
	for(int i=1;i<=H;++i){
		scanf("%s",str+1);
		for(int j=1;j<=W;++j){sum[i][j]=sum[i-1][j]+sum[i][j-1]-sum[i-1][j-1]+(str[j]=='o');if(str[j]=='E')sx=i,sy=j;}
	}
	for(int u=0;u<sx;++u)for(int d=0;d<=H-sx;++d){
		int U=max(sx-u,d+1),D=min(sx+d,H-u);if(U>D)continue;
		for(int l=0;l<sy;++l)for(int r=0;r<=W-sy;++r){
			int L=max(sy-l,r+1),R=min(sy+r,W-l);if(L>R)continue;
			ans=max(ans,f[d][l][r]);
			if(l+r<sy-1)f[d][l+1][r]=max(f[d][l+1][r],f[d][l][r]+get(sy-l-1,sy-l-1,U,D));
			if(l+r<W-sy)f[d][l][r+1]=max(f[d][l][r+1],f[d][l][r]+get(sy+r+1,sy+r+1,U,D));
			if(u+d<H-sx)f[d+1][l][r]=max(f[d+1][l][r],f[d][l][r]+get(L,R,sx+d+1,sx+d+1));
			if(u+d<sx-1)f[d+0][l][r]=max(f[d+0][l][r],f[d][l][r]+get(L,R,sx-u-1,sx-u-1));
		}
	}
	printf("%d",ans);
}

Measured memory_bytes: 4224
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
const int INF=101;

int main()
{
	int N,r=0,x=INF;
	cin>>N;
	for(int i=0;i<N;i++)
	{
		int a;cin>>a;
		r+=a;
		x=a%10==0?x:min(x,a);
	}
	if(r%10==0)printf("%d\n",x==INF?0:r-x);
	else printf("%d\n",r);
}


Measured memory_bytes: 256
#include<cmath>
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<map>
#include<queue>
#include<set>
#include<vector>
#include<bitset>
#define int long long
using namespace std;
const int maxn=100005,mod=1e9+7;
int n,a,b;
inline int read()
{
	int x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9')
	{
		if(ch=='-')
			f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9')
	{
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}
inline void write(int a)
{
	if(a<0)
	{
		putchar('-');
		write(-a);
	}
	else
	{
		if(a>=10)
			write(a/10);
		putchar(a%10+'0');
	}
}
signed main()
{
	cin>>n>>a>>b;
	int a1=n/(a+b)*a,a2=min(n%(a+b),a);
	cout<<a1+a2;
	return 0;
}

Measured memory_bytes: 256
#pragma target("avx")
#pragma optimize("O3")
#include<bits/stdc++.h>
using ll = int_fast64_t;
using P = std::pair<ll,ll>;
using PP = std::pair<ll,P>;
using V = std::vector<ll>;
template<typename T> using pq = std::priority_queue<T>;
template<typename T> using rpq = std::priority_queue<T, std::vector<T>, std::greater<T>>;

#define REP(i,b,e) for(ll i=b; i<e; i++)
#define ALL(vec) vec.begin(),vec.end()
#define PRINT(vec) printf("[ ");for(auto &i:vec)printf("%ld ",i);puts("]");
#define SCAN(vec) for(auto &i:vec)scanf("%ld",&i)
#define fi first
#define se second

const int MOD = 1e9+7;
const ll INF = 1e18;
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

int main(){
        ll n;
        scanf("%ld", &n);

        std::string ans;
        while(n){
                n--;
                ans += 'a' + (n%26);
                n /= 26;
        }
        std::reverse(ALL(ans));
        std::cout << ans << '\n';
        return 0;
}

Measured memory_bytes: 3684
#include<bits/stdc++.h>
typedef long long int lli;

#define em emplace_back
#define rep(i,j,n) for(lli i=j;i<n;i++)
#define repf(i,a,j,n) for(lli i=j,a=0;i<n;i++,a++)
#define repg(i,j,n) for(int i=j;i>n;--i)
using namespace std;

void dbg(vector<long long int > v){
  for(long long int i = 0 ; i<v.size(); ++i){
   cerr<<v[i]<<" ";
  }
  cerr<<endl;
}
void prt(vector<long long int > v){
  for(long long int i = 0 ; i<v.size() ; ++i){
   cout<<v[i]<<" "; 
  }
  cout<<endl;
}
 
void solve(){
    string s;
    cin>>s;
    lli n = s.size();
    if(s[n-1]=='s'){
        cout<<s<<"es";
    }else{
        cout<<s<<"s";
    }
}
 
 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    cout<<"\n";
    
 
    return 0;
}

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

int main()
{
	int A,B;
	cin >> A >> B;
	int ans = 0;
	int temp = 1;
	while(1)
	{
		if (temp >= B)
		{
			cout << ans << endl;
			return 0;
		}
		ans++;
		temp = temp - 1 + A;
	}
}

Measured memory_bytes: 256