akhauriyash/Code-Regression huggingface dataset:
const int isDebugMode = 1;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
struct edge{long long to,cost;};
const int inf = 1 << 27;
const long long INF = 1LL << 60;
const int COMBMAX = 1001001;
const long long MOD = 1000000007;
const long long dy[] = {-1, 0, 0, 1};
const long long dx[] = {0, -1, 1, 0};
string abc = "abcdefghijklmnopqrstuvwxyz";
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define eachdo(v, e) for (const auto &e : (v))
#define all(v) (v).begin(), (v).end()
#define lower_index(v, e) (long long)distance((v).begin(), lower_bound((v).begin(), (v).end(), e))
#define upper_index(v, e) (long long)distance((v).begin(), upper_bound((v).begin(), (v).end(), e))
long long mpow(long long a, long long n, long long mod = MOD){long long res = 1; while(n > 0){if(n & 1)res = res * a % mod; a = a * a % mod; n >>= 1;} return res;}
void pt(){cout << endl; return;}
template<class Head> void pt(Head&& head){cout << head; pt(); return;}
template<class Head, class... Tail> void pt(Head&& head, Tail&&... tail){cout << head << " "; pt(forward<Tail>(tail)...);}
void dpt(){if(!isDebugMode) return; cout << endl; return;}
template<class Head> void dpt(Head&& head){if(!isDebugMode) return; cout << head; pt(); return;}
template<class Head, class... Tail> void dpt(Head&& head, Tail&&... tail){if(!isDebugMode) return; cout << head << " "; pt(forward<Tail>(tail)...);}
template<class T> void debug(T v){if(!isDebugMode) return; rep(i, v.size()) cout << v[i] << " " ; cout << endl;}
template<class T> void debug2(T v){if(!isDebugMode) return; rep(i, v.size()){rep(j, v[i].size()) cout << v[i][j] << " " ; cout << endl;}}
template<class T1, class T2> inline bool chmin(T1 &a, T2 b){if(a > b){a = b; return true;} return false;}
template<class T1, class T2> inline bool chmax(T1 &a, T2 b){if(a < b){a = b; return true;} return false;}
template<class T1, class T2> long long recgcd(T1 a, T2 b){return a % b ? recgcd(b , a % b) : b;}
bool valid(long long H, long long W, long long h, long long w) { return 0 <= h && h < H && 0 <= w && w < W; }

int main(){
    ll N; cin >> N;
    vector<ll> a(N);
    rep(i, N) cin >> a[i];
    sort(all(a));
    reverse(all(a));
    ll ans = 0;
    if(N % 2 == 0){
        ans += a[0];
        for(ll i = 1; i < N / 2; i++)
            ans += a[i] * 2;
    }else{
        ans += a[0];
        for(ll i = 1; i < N / 2; i++)
            ans += a[i] * 2;
        ans += a[N / 2];
    }
    pt(ans);
    return 0;
}

Measured memory_bytes: 4840
#include<bits/stdc++.h>
#define boost std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)

using namespace std;
using LL = long long;

constexpr int MAXN = 505;
constexpr LL M = 998244353;

template <typename T> inline void read(T &x) {
    int f = 1; x = 0;
    char ch = getchar();
    while (!isdigit(ch)) f = (ch == '-') ? -1 : 1, ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
    x *= f;
}


int main() {
    boost;
    int n, m, k, t;
    int a, b, c;
    cin >> a >> b >> c;
    swap(a, b), swap(a, c);
    cout << a << " " << b << " " << c << endl;
    return 0;
}

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

int main() {
  int n;
  std::cin >> n;
  std::vector<int> x(n, 0);
  
  for (int i = 0; i < n; i++) {
    std::cin >> x.at(i);
  }
  
  int j = 0;
  
  for (int step = 0; step < n; step++) {
    if(x.at(j) == 2) {
      std::cout << step + 1 << std::endl;
      return 0;
    }
    
    j = x.at(j) - 1;
  }
  
  std::cout << -1 << std::endl;
  
  return 0;
}


Measured memory_bytes: 640
import java.util.*;

public class Main { 
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String o="No";
		long a=sc.nextLong();
      long b=sc.nextLong();
      long c=sc.nextLong();
        if((a==b&&b!=c)||(a==c&&b!=c)||c==b&&a!=c)o="Yes";
      	System.out.println(o);
    }
    
}

Measured memory_bytes: 22228
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int MOD = 1000000007;
const ll INF = 1LL << 60;

int main()
{
   cin.tie(0);
   ios::sync_with_stdio(false);
   int n;
   cin >> n;
   map<int, int> m;
   for (int i = 1; i <= 100; i++)
   {
      for (int j = 1; j <= 100; j++)
      {
         for (int k = 1; k <= 100; k++)
         {
            int num = i * i + j * j + k * k + i * j + j * k + k * i;
            m[num]++;
         }
      }
   }
   for(int i = 1; i <= n;i++) {
      cout << m[i] << endl;
   }
}

Measured memory_bytes: 5368
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    private static BigInteger Max = new BigInteger("1000000000000000000");
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        BigInteger[] input = new BigInteger[N];

        for(int i = 0; i < N; i++){
            input[i] = new BigInteger(sc.next());
        }
        BigInteger result = BigInteger.ONE;
        for(BigInteger temp : input){
            result = LCM(result , temp);
        }
        if(result.compareTo(Max) >= 0)result = Max;
        System.out.println(result.toString());


    }

    private static BigInteger GCD(BigInteger a, BigInteger b){
	    return a.gcd(b);
    }

    private static BigInteger LCM(BigInteger a, BigInteger b){
        if(b.compareTo(Max) >= 0){
            return Max;
        }else{
            return a.multiply(b).divide(GCD(a,b));
        }

    }
}

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

int main(){
  string s;
  cin >> s;
  if((s.at(2) == s.at(3)) && (s.at(4) == s.at(5))) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 3616
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <bitset>
#define pb push_back
#define YES cout<<"YES"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define No cout<<"No"<<endl
#define INF (1<<10)
#define MOD 1000000007
typedef long long ll;
using namespace std;

ll beki(ll a, ll b){
  if(b==0)return 1;
  if(b%2==0) return beki((a*a)%MOD,b/2)%MOD;
  return (a*beki((a*a)%MOD,(b-1)/2))%MOD;
}

int main(){
  int n,k;
  ll num[100005];
  ll ans=0;

  cin>>n>>k;

  for(int i=k;i>=1;i--){
    ll t=beki(k/i,n);
    num[i]=t;
  }

  for(int i=k;i>=1;i--){
    int t=2;
    while(i*t<=k){
      num[i]=(num[i]+MOD-num[i*t])%MOD;
      t++;
    }
    ans+=i*num[i];
    ans%=MOD;
  }

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


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

public class Main {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
            int num = scn.nextInt();
            int k  =  scn.nextInt();
            int arr[] = new int[num];
            for(int i = 0 ; i < num;i++){
                arr[i]= scn.nextInt();
            }
//        int num = 6;
//        int arr[] = {30, 10, 60, 10, 60, 50};

        int dp[] = new int[num];
        Arrays.fill(dp, (int) 2e9);
        System.out.println(minCostJump(arr, dp,k));


    }

    private static int minCostJump(int[] arr, int[] dp,int k) {
        dp[0]=0;
        int n  = arr.length;
        for(int i=0;i<n;i++) {
            for (int j = 1; j <= k; j++) {
                if (i + j < n)
                    dp[i + j] = Math.min(dp[i + j], (dp[i] + Math.abs(arr[i + j] - arr[i])));
            }
        } return dp[arr.length-1];
    }
}

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

using namespace std;

int main() {
	string s, t;
	cin >> s >> t;
	int s_basket[26] = { 0 };
	for (int i = 0; i < s.size(); i++)
	{
		s_basket[s[i] - 'a']++;
	}
	int t_basket[26] = { 0 };
	for (int i = 0; i < t.size(); i++)
	{
		t_basket[t[i] - 'a']++;
	}
	string s_new = "";
	for (int i = 0; i < 26; i++)
	{
		for (int j = 0; j < s_basket[i]; j++)
		{
			s_new += (char)(i + 'a');
		}
	}
	string t_new = "";
	for (int i = 25; 0 <= i; i--)
	{
		for (int j = 0; j < t_basket[i]; j++)
		{
			t_new += (char)(i + 'a');
		}
	}
	if (t_new.compare(s_new) > 0) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

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

int main(){
    long long int n,m;
    long long int ans=0;
    cin>>n>>m;
    long long int diff=m/2-n;
    if(diff<=0)ans=m/2;
    else{
        ans+=n;
        m-=n*2;
        ans+=(m/4);
    }
    cout<<ans<<endl;
    //cout<<diff/4<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using Graph=vector<vector<pair<int,int>>>;
#define INF 1000000000000000000
#define MOD 1000000007

int main(){
  ll N,P;
  cin>>N>>P;
  map<ll,int> m;
  ll i=2;
  while(P>1){
    if(i>=1000000){
      break;
    }
    if(P%i==0){
      m[i]++;
      P/=i;
    }else{
      i++;
    }
  }
  if(P>1){
    m[P]++;
  }

  ll ans=1;
  for(auto p:m){
    for(int i=0;i<p.second/N;i++){
      ans*=p.first;
    }
  }
  cout<<ans<<endl;
}


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

# define p(s) std::cout << s << endl;
# define printIf(j,s1,s2) cout << (j ? s1 : s2) << endl;
# define YES(j) cout << (j ? "YES" : "NO") << endl;
# define Yes(j) std::cout << (j ? "Yes" : "No") << endl;

# define INF (int)10e9

int main()
{

    int n,k;cin >> n >> k;

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

    int min_gap=1e9;
    for(int i=0;i<=n-k;i++){
        min_gap=min(h[i+k-1]-h[i],min_gap);
    }
    p(min_gap)
}

Measured memory_bytes: 640
h,w=map(int,input().split())
field=[]
new=False
black=[]
for i in range(h):
	b=[]
	a=input()
	for j in range(w):
		if a[j]=="#":
			b.append(1)
			black.append([i,j])
		else:
			b.append(0)
	field.append(b)
ans=0
while len(black):
	black_new=[]
	q=len(black)
	for k in range(q):
		i,j=black[k][0],black[k][1]
		if i!=0 and field[i-1][j]==False:
			field[i-1][j]=True
			black_new.append([i-1,j])
		if i!=h-1 and field[i+1][j]==False:
			field[i+1][j]=True
			black_new.append([i+1,j])
		if j!=0 and field[i][j-1]==False:
			field[i][j-1]=True
			black_new.append([i,j-1])
		if j!=w-1 and field[i][j+1]==False:
			field[i][j+1]=True
			black_new.append([i,j+1])
	black=black_new
	ans+=1
print(ans-1)




Measured memory_bytes: 149028
//---------------------------------------------------------------
#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#include<algorithm>
//---------------------------------------------------------------
#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 rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define SIZE 100005
#define INF 1000000000000000000ll
#define all(x) x.begin(),x.end()
#define fi first
#define se second
using pint = pair<int,int>;
using vec = vector<int>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
//---------------------------------------------------------------
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const double pi = acos(-1);
//---------------------------------------------------------------

//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓


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

    int n;
    cin>>n;
    vll l(n+3);
    rep(i,n) cin>>l[i];
    
    ll cnt = 0;
    for(int i=0; i<=n-3; i++){
        for(int j=i+1; j<=n-2;j++){
            for(int k=j+1; k<=n-1; k++){
                if(l[i] != l[j] && l[i] != l[k] && l[j] != l[k] && l[i]+l[j]>l[k] && l[i]+l[k]>l[j] && l[j]+l[k]>l[i]){
                    cnt++;
                }
            }
        }
    }

    cout<<cnt<<endl;

}

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

typedef struct TankState{
  int x, y, dir;//u:0, r:1, d:2, l:3
}TankState;

bool range(int x, int y, int w, int h){
  return (0 <= x and x < w) and (0 <= y and y < h);
}

int main(){
  int n;
  int dx[4] = {0, 1, 0, -1};
  int dy[4] = {-1, 0, 1, 0};
  std::cin >> n;
  for (int l = 0; l < n; l++) {
    TankState pos;
    int h, w;
    std::cin >> h >> w;
    vector<string> vs(h);
    for (int i = 0; i < h; i++) std::cin >> vs[i];
    for (int i = 0; i < h; i++) {
      for (int j = 0; j < w; j++) {
        if(vs[i][j] == '^')pos.x = j, pos.y = i, pos.dir = 0;
        if(vs[i][j] == '>')pos.x = j, pos.y = i, pos.dir = 1;
        if(vs[i][j] == 'v')pos.x = j, pos.y = i, pos.dir = 2;
        if(vs[i][j] == '<')pos.x = j, pos.y = i, pos.dir = 3;
      }
    }
    string operation;
    int tmp;
    std::cin >> tmp >> operation;
    for (int i = 0; i < operation.length(); i++) {
      if(operation[i] == 'S'){
        int x = pos.x, y = pos.y;
        while(range(x, y, w, h) and 
              vs[y][x] != '*' and vs[y][x] != '#')
          y += dy[pos.dir], x += dx[pos.dir];
        if(range(x, y, w, h) and vs[y][x] == '*')vs[y][x] = '.';
      }else if(operation[i] == 'U'){
        pos.dir = 0;
        if(range(pos.x, pos.y - 1, w, h) and
           vs[pos.y - 1][pos.x] == '.'){
          vs[pos.y - 1][pos.x] = '^';
          vs[pos.y][pos.x] = '.';
          pos.y -= 1;
        }else{
          vs[pos.y][pos.x] = '^';
        }
      }else if(operation[i] == 'R'){
        pos.dir = 1;
        if(range(pos.x + 1, pos.y, w, h) and
           vs[pos.y][pos.x + 1] == '.'){
          vs[pos.y][pos.x + 1] = '>';
          vs[pos.y][pos.x] = '.';
          pos.x += 1;
        }else{
          vs[pos.y][pos.x] = '>';
        }
      }else if(operation[i] == 'D'){
        pos.dir = 2;
        if(range(pos.x, pos.y + 1, w, h) and
           vs[pos.y + 1][pos.x] == '.'){
          vs[pos.y + 1][pos.x] = 'v';
          vs[pos.y][pos.x] = '.';
          pos.y += 1;
        }else{
          vs[pos.y][pos.x] = 'v';
        }
      }else if(operation[i] == 'L'){
        pos.dir = 3;
        if(range(pos.x - 1, pos.y, w, h) and
           vs[pos.y][pos.x - 1] == '.'){
          vs[pos.y][pos.x - 1] = '<';
          vs[pos.y][pos.x] = '.';
          pos.x -= 1;
        }else{
          vs[pos.y][pos.x] = '<';
        }
      }
    }
    for (int i = 0; i < h; i++) {
      std::cout << vs[i] << std::endl;
    }
    if(l != n - 1)std::cout << std::endl;
  }
  return 0;
}



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

using namespace std;
using ll = long long;

int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }

#define CIN(T, x) T x; cin >> x;
#define CINS(T, x, N) vector<T> x(N); for(int i = 0; i < (N); i++) { cin >> x[i]; }
#define SHOW(x) for(int i = 0; i < x.size(); i++) { cout << x[i] << " "; } cout << "\n";
#define SHOW2(x) for(int j = 0; j < x.size(); j++) { SHOW(x[j]); } cout << "\n";


ll lcm (ll a, ll b) {

    ll a1 = a, b1 = b;
    while (true) {
        if (a < b) swap(a, b);
        a %= b;
        if (a == 0) break;
    }

    return a1 * (b1 / b);
}

int main() {

    CIN(int, N);
    CIN(ll, T);

    if ( N == 1 ) {
        cout << T << "\n";
        return 0;
    }

    ll ans = T;
    for (int i = 1; i < N; i++) {
        cin >> T;
        ans = lcm(ans, T);
    }

    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
typedef  long long LL;
const int N = 1e5+5;
LL a[N],l,n;
vector<int>ans;
int main(){
  scanf("%I64d%I64d",&n,&l);
  for(int i=1;i<=n;++i)scanf("%I64d",&a[i]);
  int ret=1,tmp=a[1]+a[2];
  for(int i=2;i<n;++i){
     if(a[i]+a[i+1]>tmp){
        ret=i;tmp=a[i]+a[i+1];
     }
  }
  if(tmp<l){printf("Impossible\n");return 0;}
  ans.push_back(ret);
  for(int i=ret+1;i<=n-1;++i)ans.push_back(i);
  for(int i=ret-1;i>0;--i)ans.push_back(i);
  printf("Possible\n");
  for(int i=ans.size()-1;i>=0;--i)printf("%d\n",ans[i]);
  return 0;
}


Measured memory_bytes: 2040
N, M = (int(x) for x in input().split())
A = list(map(int, input().strip().split()))
A.sort(reverse=True)

for m in range(M):
    s = sum(A)
    if A[m] >= s / (4 * M):
        a = True
    else:
        a = False

if a == True:
    print("Yes")
else:
    print("No")

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

using namespace std;

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

#define each(i,a) for (auto&& i : a)
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)

const ll linf = 1e18;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    each(x,vec) is >> x;
    return is;
}
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    rep(i,vec.size()) {
        if (i) os << " ";
        os << vec[i];
    }
    return os;
}
template<typename T>
ostream& operator<<(ostream& os, const vector< vector<T> >& vec) {
    rep(i,vec.size()) {
        if (i) os << endl;
        os << vec[i];
    }
    return os;
}

bool solve() {
    ll w = 3, h = 3;
    vector<vector<ll>> m(h, vector<ll>(w)); cin >> m;
    rep(y, h-1) {
        set<ll> s;
        rep(x, w) {
            s.insert(m[y+1][x] - m[y][x]);
        }
        if (s.size() > 1) return false;
    }
    rep(x, w-1) {
        set<ll> s;
        rep(y, h) {
            s.insert(m[y][x+1] - m[y][x]);
        }
        if (s.size() > 1) return false;
    }
    return true;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    if (solve()) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#define Max (int)1e5+10
#define MAX_INT (int)1e9+2

int dp[Max][3];
void init(){
	int i,j;
	for(i=0;i<Max;i++){
		for(j=0;j<3;j++)
			dp[i][j] = 0;
	}
}

void solve(int n,int a[][3]){
	int i,j;
	for(i=n-1;i>=0;i--){
		for(j=0;j<3;j++){
			
			dp[i][j] = a[i][j];
			
			if(i+1 < n){
				dp[i][j] += dp[i+1][(j+1)%3] > dp[i+1][(j+2)%3] ? dp[i+1][(j+1)%3] : dp[i+1][(j+2)%3];
			}
		}
	}
}

int main(){
	
	int n,a[Max][3],i;
	init();
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&a[i][0],&a[i][1],&a[i][2]);
	}
	solve(n,a);
	int max = 0;
	for(i=0;i<3;i++){
		max = max < dp[0][i] ? dp[0][i] : max;
	}
	printf("%d\n",max);
	return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
int main(void){
    long long N,M;cin>>N>>M;
    if(N==1&&M==1)cout<<1<<endl;
    else if(N==1)cout<<M-2<<endl;
    else if(M==1)cout<<N-2<<endl;
    else cout<<N*M-N*2-M*2+4<<endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		if(A <= C && C <= B) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 23252
#include <bits/stdc++.h>
#define LL long long
#define PII pair<int,int>
#define PIL pair<int,LL>
#define PLI pair<LL,int>
#define PIII pair<int,PII>
#define PLL pair<LL,LL>
#define PLII pair<LL,PII>
#define VI vector<int>
#define VL vector<LL>
#define VPII vector<PII>
#define FF first
#define SS second
#define MP make_pair
#define PB push_back
#define EPS 0.00000000001
#define PI acos(-1)
#define loop(i,b,n) for(int i=b;i<n;++i)
#define rev_loop(i,b,n) for(int i=b;i>=n;--i)
using namespace std;

const int MOD = 1e9 + 7;
const LL MX = 1e9;
const LL INF = 1e9;

int main()
{
    //ofstream out("output.txt");
    //ifstream in("input.txt");
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    /*
    int t,n;
    cin>>t;
    loop(t1,1,t+1)
    {
        int a[n];
        loop(i,0,n) cin>>a[i];
    }
    */

    int n,m,x;
    cin>>n>>m>>x;
    int c[n], a[n][m];
    loop(i,0,n)
    {
        cin>>c[i];
        loop(j,0,m) cin>>a[i][j];
    }

    int ans = -1;
    loop(i,1,n+1)
    {
        VI v(n,0);
        loop(j,0,i) v[j] = 1;
        do
        {
            int x1[m] = {0}, cst = 0;
            loop(j,0,n)
            {
                if(v[j] == 0) continue;
                cst += c[j];
                loop(k,0,m) x1[k] += a[j][k];
            }

            int f = 1;
            loop(j,0,m) if(x1[j] < x) {f = 0; break;}
            if(f && (ans == -1 || ans > cst)) ans = cst;

        }while(prev_permutation(v.begin(),v.end()));
    }

    cout<<ans<<'\n';
    /*
    if(f) cout<<"Yes"<<'\n';
    else cout<<"No"<<'\n';
    */

    return 0;
}


Measured memory_bytes: 3664
package main

import (
	"fmt"
)

func main() {
	var N int
	fmt.Scanf("%d", &N)

	l := 0
	fmt.Println(l)
	var ls string
	fmt.Scanf("%s", &ls)
	if ls == "Vacant" {
		return
	}

	r := N - 1
	fmt.Println(r)
	var rs string
	fmt.Scanf("%s", &rs)
	if rs == "Vacant" {
		return
	}

	query := func(i int) int {
		fmt.Println(i)
		var s string
		fmt.Scanf("%s", &s)
		if s == "Vacant" {
			return 0
		}
		if i%2 == 0 {
			if s == ls {
				return 1
			} else {
				return -1
			}
		} else {
			if s == ls {
				return -1
			} else {
				return 1
			}
		}
	}

	for {
		m := (l + r) / 2
		ans := query(m)
		if ans == 0 {
			return
		} else if ans < 0 {
			r = m - 1
		} else {
			l = m + 1
		}
	}
}


Measured memory_bytes: 1108
#include<bits/stdc++.h>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
using namespace std; 
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
const int INF = 1<<29;
typedef long long int ll;
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n>>b)&1; }
inline void set_bit(int & n, int b) { n |= two(b); }
inline void unset_bit(int & n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) { int res = 0; while(n && ++res) n-=n&(-n); return res; }
template<class T> void chmax(T & a, const T & b) { a = max(a, b); }
template<class T> void chmin(T & a, const T & b) { a = min(a, b); }
const int MOD=1000000007;

bool isPowerOfTwo (ll x)  
{  
    return x && (!(x&(x-1)));  
}
bool isPrime(int n) 
{ 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}
int highestPowerof2(unsigned int n) 
{ 
    // Invalid input 
    if (n < 1) 
        return 0; 
  
    int res = 1;
    for (int i=0; i<8*sizeof(unsigned int); i++) 
    { 
        int curr = 1 << i; 
        if (curr > n) 
           break; 
  
        res = curr; 
    } 
  
    return res; 
} 
long long binpow(long long a, long long b) {
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}       
////////////////////////////////////////////////////////////////////

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);  
  cout.tie(NULL);
  int t=1;
  while(t--)
  {
      ll h,n;
      cin>>h>>n;
      ll sum=0,a[n];
      REP(i,n)
      {
          cin>>a[i];
          sum+=a[i];
      }
      if(sum>=h)cout<<"Yes";
      else cout<<"No";
  }
  return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int a, b, c, k;

int main()
{
    cin>>a>>b>>c>>k;
    if(k<=a) cout<<k<<endl;
   else  if(k<=a+b){
        cout<<a<<endl;
    }
    else {
        k-=(a+b);
        cout<<a-k<<endl;
    }
    return 0;
}


Measured memory_bytes: 3632
s=input()
nagasa=len(s)
liss=list(s)
revs=list(reversed(s))
zen=list(s[:(nagasa-1)//2])
revzen=list(reversed(zen))
kou=list(s[(nagasa+2)//2:])
revkou=list(reversed(kou))
if liss==revs and zen == revzen and kou== revkou:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<climits>
#include<map>
#include<string>
#include<functional>
#include<iomanip>
#include<deque>
#include<random>
#include<set>
#include<bitset>

using namespace std;
typedef long long ll;
typedef double lldo;
#define mp make_pair
#define pub push_back
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
ll gcd(ll a, ll b) { if (a % b == 0) { return b; } else  return gcd(b, a % b); }
ll lcm(ll a, ll b) { if (a == 0) { return b; }return a / gcd(a, b) * b; }
template<class T>ll LBI(vector<T>& ar, T in) { return lower_bound(ar.begin(), ar.end(), in) - ar.begin(); }
template<class T>ll UBI(vector<T>& ar, T in) { return upper_bound(ar.begin(), ar.end(), in) - ar.begin(); }

ll n, a[100] = {}, ans = 1000000;

int main() {
	cin >> n;
	rep(i, n)cin >> a[i];
	for (int i = 1; i <= 100; i++) {
		ll sum = 0;
		rep(j, n)sum += (i - a[j]) * (i - a[j]);
		ans = min(ans, sum);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
const ll mod = 1000000007;//998244353;
ll nC2(ll n){
    return n*(n-1)/2;
}
ll nC3(ll n){
    return n*(n-1)*(n-2)/6;
}
int main() {
    cin.tie(nullptr); ios::sync_with_stdio(false);
    string n; cin >> n;
    int k; cin >> k;
    ll ans = 0;
    while(k > 0){
        if (k==1){
            ans += (n[0]-'0')+9*(n.size()-1);
        }
        else if (k==2){
            ans += (n[0]-'0'-1)*(n.size()-1)*9+nC2(n.size()-1)*81;
            n.erase(n.begin());
            while(!n.empty()&&n[0]=='0'){
                n.erase(n.begin());
            }
        }
        else{
            ans += (n[0]-'0'-1)*nC2(n.size()-1)*81+nC3(n.size()-1)*729;
            n.erase(n.begin());;
            while(!n.empty()&&n[0]=='0'){
                n.erase(n.begin());
            }
        }
        k = min(k-1,int(n.size()));
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    h,w=MI()
    if h==1 or w==1:print(1)
    else:print((h*w+1)//2)

main()

Measured memory_bytes: 3064
import sys
from collections import Counter
def input():
    return sys.stdin.readline()[:-1]


def main():

    a, b, x = map(int, input().split())

    ans = 0
    first = a + (x - a%x) % x
    if first > b:
        ans = 0
    else:
        ans = 1 + (b - first) // x
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3316
#include<bits/stdc++.h>                                                   //---------------------------------------------------------------
                                                                    
# define ll long long   
# define ld long double                                               
# define mod 1000000007                                                   
# define MAX 100005                                                                                //shortcut keys
                                                                                
# define pb push_back                                                                     
# define mp make_pair                                                     
                                                                  
# define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);        //---------------------------------------------------------------                                       
using namespace std;
/*
ll power(ll x,ll y,ll m){            //power(x,y)=x^y  %m;
	if(y==0)return 1;
	int ll a=power(x,y/2,m);
	if(y%2){
		return (a*((a*x)%m))%m;
	}
	else{
		return (a*a)%m;
	}
}
ll mod_inverse(ll x,ll m){
	return power(x,m-2,m);
}
ll fact(ll n,ll m){
	if(n<=1)return 1;
	return (fact(n-1,m)*n)%m;
}
ll ncr(ll n,ll r,ll m){
	ll n1=1,d1=1,d2=1;
	n1=fact(n,m);d1=fact(r,m);d2=fact(n-r,m);
	ll ans=mod_inverse((d1*d2)%m,m);
	ans=(ans*n1)%m;
	return ans;
}
 vector<ll> adj[MAX];
 graphinput(ll edge)
 {
 	for(ll i=0;i<edge;i++)
 	{
 		int x,y;
 		cin>>x>>y;
 		adj[x].pb(y);
 		adj[y].pb(x);                                                         // for undirected graph
	 }
 }*/

int main()
{
	ll n;
	cin>>n;
	ll a[n][2];
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<2;j++)
		cin>>a[i][j];
	}
	ld sum=0.0;
	for(int i=0;i<n;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			ld b=pow(abs(a[i][0]-a[j][0]),2)+pow(abs(a[i][1]-a[j][1]),2);
			ld c=sqrt(b);
			sum+=c;
		}
	}
//	ld fac=fact(n,mod);
	ld ans=(sum*2)/n;
	cout<<fixed<<setprecision(9)<<ans;
	
	
	
	
	
	
	
	
	
	

	return 0;
}

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

using namespace std;

#define x first
#define y second
#define mp make_pair
#define pb push_back
#define sqr(a) ((a) * (a))
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define forn(i, n) for(int i = 0; i < int(n); i++) 
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

template <class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a) {
	return out << "(" << a.x << ", " << a.y << ")";
}

template <class A> ostream& operator << (ostream& out, const vector<A> &v) {
	out << "[";
	forn(i, sz(v)) {
		if(i) out << ", ";
		out << v[i];
	}
	return out << "]";
}

mt19937 rnd(time(NULL));

const int INF = int(1e9);
const li INF64 = li(1e18);
const int MOD = INF + 7;
const ld EPS = 1e-9;
const ld PI = acos(-1.0);

const int N = 10 * 1000 + 13;
const int K = 100 + 7;

int n, d;
string s;

bool read () {
	static char buf[N];
	if (scanf("%s", buf) != 1)
		return false;
	s = buf;
	n = sz(s);
	scanf("%d", &d);
	return true;
}

int dp[N][K];

int add(int a, int b){
	a += b;
	if (a >= MOD)
		a -= MOD;
	return a;
}

void solve() {	
	memset(dp, 0, sizeof(dp));
	dp[0][0] = 1;
	forn(i, n) forn(j, K) forn(l, 10)
		dp[i + 1][(j + l) % d] = add(dp[i + 1][(j + l) % d], dp[i][j]);
	
	int ans = MOD - 1;
	int cur = 0;
	forn(i, n){
		int c = s[i] - '0';
		forn(j, c){
			ans = add(ans, dp[n - i - 1][((d - cur - j) % d + d) % d]);
			//cerr << i << " " << j << " " << dp[n - i - 1][d - j] << endl;
		}
		cur = (cur + c) % d;
	}
	ans = add(ans, cur == 0);
	
	printf("%d\n", ans);
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
	
	int tt = clock();
	
#endif
	
	cerr.precision(15);
	cout.precision(15);
	cerr << fixed;
	cout << fixed;

	while(read()) {	
		solve();
		
#ifdef _DEBUG
	cerr << "TIME = " << clock() - tt << endl;
	tt = clock();
#endif

	}
}

Measured memory_bytes: 4480
N = int(input())
S = [input() for i in range(N)]

dic = {}

for i in range(N):
    s = str(sorted(S[i]))
    if s not in dic:
        dic[s] = 0
    dic[s] += 1

ans = 0
for v in dic.values():
    ans += v*(v-1)//2
print(ans)


Measured memory_bytes: 29200
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    while (true) {
      String x = stdin.next();
      if (x.equals("0")) {
        break;
      }

      int sum = 0;
      int len = x.length();
      for (int i = 0; i < len; i++) {
        sum += Character.getNumericValue(x.charAt(i));
      }
      System.out.println(sum);
    }
  }

}

Measured memory_bytes: 17164
#include<iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<stdio.h>
#define rep(i,n)for(int i=0;i<n;i++)
//printf("%.yf\n",x); xを小数点以下y桁で
using namespace std;
int main() {
    string s;
    cin >> s;
    int ans = 0;
    rep(i, 6) {
        if (s[i] == '1') {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String SA = sc.next();
    String SB = sc.next();
    String SC = sc.next();
    
    int ia = 0;
    int ib = 0;
    int ic = 0;
    char next = 'a';
    String ans = "";
    while (true) {
      if (next == 'a') {
        if (ia == SA.length()) {
          ans = "A";
          break;
        }
        next = SA.charAt(ia);
        ia++;
      } else if (next == 'b') {
        if (ib == SB.length()) {
          ans = "B";
          break;
        }
        next = SB.charAt(ib);
        ib++;
      } else { // c
        if (ic == SC.length()) {
          ans = "C";
          break;
        }
        next = SC.charAt(ic);
        ic++;
      }
    }
    
    System.out.println(ans);
  }
}

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

#define ll long long

int main() {
  ll A, B, C;
  cin >> A >> B >> C;

  ll cnt = 0;
  if (A+B+1 >= C) {
    cnt += C + B;
  } else {
    cnt += B + A+B+1;
  }

  cout << cnt << endl;

  return 0;
}


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

class UnionFind {
public:
	//親の番号を格納する。親だった場合は-(その集合のサイズ)
	vector<int> Parent;

	//作るときはParentの値を全て-1にする
	//こうすると全てバラバラになる
	UnionFind(int N) {
		Parent = vector<int>(N, -1);
	}

	//Aがどのグループに属しているか調べる
	int root(int A) {
		if (Parent[A] < 0) return A;
		return Parent[A] = root(Parent[A]);
	}

	//自分のいるグループの頂点数を調べる
	int size(int A) {
		return -Parent[root(A)];//親をとってきたい
	}

	//AとBをくっ付ける
	bool connect(int A, int B) {
		//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
		A = root(A);
		B = root(B);
		if (A == B) {
			//すでにくっついてるからくっ付けない
			return false;
		}

		//大きい方(A)に小さいほう(B)をくっ付けたい
		//大小が逆だったらひっくり返しちゃう。
		if (size(A) < size(B)) swap(A, B);

		//Aのサイズを更新する
		Parent[A] += Parent[B];
		//Bの親をAに変更する
		Parent[B] = A;

		return true;
	}
};

int main() {
	int N, M;
	cin >> N >> M;
	int Q[N];
	int P[N];
	for(int i=0;i<N;i++){
		cin >> Q[i];
		P[i] = Q[i]-1;
	}
	vector<int> A(M), B(M);
	for (int i = 0; i < M; i++)
	{
		cin >> A[i] >> B[i];
		A[i]--;
		B[i]--;
	}

	UnionFind Uni(N);

	for (int i = 0; i < M; i++)
	{
		Uni.connect(P[A[i]], P[B[i]]);
	}

	int ans=0;

	for (int i = 0; i < N; i++)
	{
		if( Uni.root(P[i]) == Uni.root(i) ){
			ans = ans + 1;
		}
	}
	// for (int i = 0; i < N; i++){
	// 	cout << Uni.root(P[i]) << Uni.size(P[i]) << endl;
	// }
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
#define P pair<int,int>
#define all(V) V.begin(),V.end()
#define ll long long
const ll MOD = 1000000007;

vector<ll> Bc(2019, 0), Rc(2019, 0);

//mod冪乗
ll mp(ll a, ll b) {
	ll ans = 1;
	while (b) {
		if (b % 2)
			ans *= a;
		a *= a;
		a %= MOD;
		ans %= MOD;
		b /= 2;
	}
	return ans;
}

//mod割り算
ll moddiv(ll a, ll b) {
	a %= MOD;
	return (a*mp(b, MOD - 2)) % MOD;
}

int main() {
	ll N, B, R;
	cin >> N >> B;
	R = N - B;
	if (R == 0) {
		cout << 1 << endl;
		for (int i = 1;i < B;i++) cout << 0 << endl;
		return 0;
	}
	R--;B--;
	Bc[0] = Rc[0] = 1;
	for (int i = 1;i <= B;i++) {
		Bc[i] = moddiv((B + 1 - i), i);
		Bc[i] *= Bc[i - 1];
		Bc[i] %= MOD;
	}
	for (int i = 1;i <= R;i++) {
		Rc[i] = moddiv((R + 1 - i), i);
		Rc[i] *= Rc[i - 1];
		Rc[i] %= MOD;
	}
	B++;
	ll ans;
	for (int i = 1;i <= B;i++) {
		ans = 0;
		//RB...RB
		ans += Rc[i - 1] * Bc[i - 1] * 2;
		ans %= MOD;
		//cout << ans << endl;
		//RB...BR
		ans += Rc[i] * Bc[i - 1];
		ans %= MOD;
		//cout << ans << endl;
		//BR...RB
		if(i>1) ans += Rc[i - 2] * Bc[i - 1];
		ans %= MOD;
		cout << ans << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct P
{
    //string r;
    int x,y,z;

    bool operator<(const P &a)const{
       // if(y!=a.y)
       // return y>a.y;
       return x>a.x;
//        return z>a.z;
    }
};

vector<P> v[5555];
//bitset<4001000> b;
int a,c,i,b,k,d,n,m,e;//dy[15]={0,1,0,-1,-1,1,-1,1},dx[15]={1,0,-1,0,1,1,-1,-1};//
int l[5555];
int o[5400];
int dx[10]={0,1,0,-1},dy[10]={1,0,-1,0},dz[10]={0,0,0,0,1,-1};

long long x,y,z,mod=1000000007;
P u[111111];
double j[111];

stack<int> s;
queue<P> q;
//'1'==49;
//'A'==65;
//'a'==97;
//unordered_
map<int,int > p;
//list<int> l;
string r;
//char r[333][333];


bool as(P a,P b)
{
    if(a.x!=b.x) return a.x<b.x;
    return a.y>b.y;
}

long long f(long long x,long long y)
{
    if(x<y) swap(x,y);
    if(!y) return -x;
    return x/y*y*2+f(y,x%y);
}
int main()
{
    scanf("%lld %lld",&x,&y);
    printf("%lld",f(y,x-y)+x);
}


Measured memory_bytes: 384
n_of_l=[26 ,702 ,18278 ,475254 ,12356630 ,321272406 ,8353082582 ,217180147158 ,5646683826134 ,146813779479510 ,3817158266467286]
n=int(input())
ans=''
flag=1
le=0
while flag:
  if n<=n_of_l[le]:
    flag=0
  le+=1
li='abcdefghijklmnopqrstuvwxyz'
n-=n_of_l[le-2]+1
for i in range(le):
  ans+=li[n%26]
  n//=26
print(ans[::-1])

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

int main(){
  int N,A,B,P1,P2;
  cin >> N >> A >> B;
  P1 = A * N;
  P2 = B;

  if (P1 <= P2){
    cout << P1 << endl;
  }
  else{
    cout << P2 << endl;
  }
}


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

#define OUT(x)  cerr << #x << " = " << x << endl;
#define all(x)  x.begin(), x.end()
#define mp      make_pair
#define pii     pair<int, int>
#define pll     pair<long long, long long>
#define ll      long long

int main() {
        int n;
        cin >> n;
        vector<int> a(n);
        vector<int> cnt(101010, 0);
        for (int i = 0; i < n; i ++) {
                cin >> a[i];
                cnt[a[i]] ++;
                cnt[a[i] + 1] ++;
                if (a[i] >= 1) cnt[a[i] - 1] ++;
        }
        int ans = -1;
        for (int i = 0; i < 101010; i ++) ans = max(ans, cnt[i]);
        cout << ans << endl;
        return 0;
}



Measured memory_bytes: 1024
def examA():
    S = SI()
    ans = 0
    if "R" in S:
        ans = 1
    if "RR" in S:
        ans = 2
    if "RRR" in S:
        ans = 3
    print(ans)
    return

def examB():
    N = I()
    L = LI()
    L.sort()
    cnt = 0
    for i in range(N):
        for j in range(i+1,N):
            for k in range(j+1,N):
                if L[i]==L[j]:
                    continue
                if L[j]==L[k]:
                    continue
                if L[i]+L[j]>L[k]:
                    cnt += 1
    ans = cnt
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

def test():
    i = I()
    li = LI()
    lsi = LSI()
    si = LS()
    print(i)
    print(li)
    print(lsi)
    print(si)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examB()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

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

int main() {
  int64_t N,ans=0,flag=0;
  cin >> N;
  if(N%2==1){
    ans = 0;
      }else{
      for (int64_t i= 10; i <= N;i*=5){
          ans+=N/i;
      }
    }
    cout << ans;
}


Measured memory_bytes: 384
#include <stdio.h>

int main(void)
{
	int j, flag=1, n, A[100], temp, cnt=0;
	scanf("%d",&n);
	for (j=0; j<n; j++) {
		scanf("%d",&A[j]);
	}
	while(flag) {
		flag = 0;
		for (j=n-1; j>=1; j--) {
			if(A[j] < A[j-1]) {
				temp = A[j];
				A[j] = A[j-1];
				A[j-1] = temp;
				cnt++;
				flag = 1;
			}
		}
	}
	for (j=0; j<n-1; j++) {
		printf("%d ",A[j]);
	}
	printf("%d\n%d\n",A[n-1],cnt);
	return 0;
}

Measured memory_bytes: 600
import java.util.*;
import java.util.stream.Collectors;
 
 
public class Main {
    public static void main(String[] args) {
    	
        Scanner scanner=new Scanner(System.in);
        
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        
        int ans = (a+Math.abs(b))<(a*b)?(a*b):(a+Math.abs(b));
        	
        
        System.out.println(ans);
 
 
    }
 
}


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

typedef long long ll;
typedef pair<int, int> pii; 
const int N = 2e5+10, mod = 1e9+7;

void solve() {
    int n; cin >> n;

    int a[N];
    memset(a, 0, sizeof(a));
    for (int i = 1; i * i <= n; ++i) {
        for (int j = 1; i*i + j*j + i*j <= n; ++j) {
            for (int k = 1; i*i + j*j + k*k + i*j + j*k + i*k <= n; ++k) {
                ++a[i*i + j*j + k*k + i*j + j*k + i*k];
            }
        }
    }

    for (int i = 1; i <= n; ++i) {
        cout << a[i] << endl;
    }
}   

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int t = 1; 
    while (t--) solve();
    return 0;
}


Measured memory_bytes: 4348
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 50+1;
int dp[maxn][maxn][maxn*maxn];// dp[i][j][k] 已经匹配到前i个，有j个没有匹配，当前已知的value是k

void Add(int &a,int b){
	a += b;
	if(a >= mod)
		a -= mod;
}
int main(void)
{
    int N,K;
    cin>>N>>K;
    dp[0][0][0] = 1;
    for(int i  = 1;i <= N;++i){
    	for(int j = 0;j <= i; ++j){
    		for(int k = 2*j;k <= K; ++k){
    			int &a = dp[i][j][k];
    			Add(a,1ll*(2*j+1)*dp[i-1][j][k-2*j]%mod);// i1,i2 匹配，或者i1与一个未匹配的匹配，或者i2与一个没匹配的匹配,没有匹配的个数不变
    			Add(a,1ll*(j+1)*(j+1)*dp[i-1][j+1][k-2*j]%mod);// i1,i2 匹配一个非 i2,i1 的，未匹配的数量-1
    			if(j)
    				Add(a,dp[i-1][j-1][k-2*j]);// i1,i2 不匹配，未匹配的数量+1
    		}
    	}
    }
    cout<<dp[N][0][K]<<endl;
   return 0;
}

Measured memory_bytes: 24704
n,m = map(int,input().split())

l = [-1]*(n+1)

for _ in range(m):
  s,c = map(int,input().split())
  if l[s] == -1:
    l[s] = c
  else:
    if l[s] != c:
      print(-1)
      exit()

if n != 1 and l[1] == 0:
  print(-1)
  exit()
if l[1] == -1:
  l[1] = 1
for i in range(2,n+1):
  if l[i] == -1:
    l[i] = 0
ls = list(map(str,l))
if n == 1 and m == 0:
  print(0)
  exit()
print(int(''.join(ls[1:])))

Measured memory_bytes: 9176
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

long long int p, q, a, N;

long long int ar[10];

long long int searc(int min, int n, long long int num, long long int den){
	long long int ans = 0;
	if(n != 0){
		num = den + num * ar[n - 1];
		den *= ar[n - 1];
	}
	if(p * den == q * num){
		ans++;
	}
	if(n == N || p * den < q * num){
		return ans;
	}
	n++;
	
	for(int i = min; i <= a / den; i++){
		ar[n - 1] = i;
		ans += searc(i, n, num, den);
	}
	return ans;
}

int main(){
	while(true){
		cin >> p >> q >> a >> N;
		if(N == 0){
			break;
		}
		for(int i = 0; i < 10; i++){
			ar[i] = 1;
		}
		cout << searc(1, 0, 0, 1) << endl;
	}
	return 0;
}

Measured memory_bytes: 2984
import math


def inputs():
    return [int(s) for s in input().split()]


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

    v = math.ceil(N / 1.08)

    if math.floor(v * 1.08) == N:
        return v
    else:
        return ':('


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


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

#define X real()
#define Y imag()
#define curr(P, i) P[(i)%(P).size()]
#define next(P, i) curr(P, i+1)
#define prev(P, i) curr(P, (i)-1+(P.size()))

using D = double;
using P = complex<D>;
using G = vector<P>;
const D EPS = 1e-8;
namespace std {
    bool operator <(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}
D dot(const P& a, const P& b) {
    return (conj(a)*b).X;
}
D cross(const P& a, const P& b) {
    return (conj(a)*b).Y;
}
int ccw(P a, P b, P c) {
    b -= a; c -= a;
    if (cross(b, c) > 0)   return +1;       // counter clockwise
    if (cross(b, c) < 0)   return -1;       // clockwise
    if (dot(b, c) < 0)     return +2;       // c--a--b on line
    if (norm(b) < norm(c)) return -2;       // a--b--c on line
    return 0;
}
struct L : public vector<P> {
    L(const P &a, const P &b) {
        push_back(a); push_back(b);
    }
};
P crossPoint(const L& l, const L& m) {
    D A = cross(l[1] - l[0], m[1] - m[0]);
    D B = cross(l[1] - l[0], l[1] - m[0]);
    if(abs(A) < EPS && abs(B) < EPS) return m[0];
    if(abs(A) < EPS) assert(false);
    return m[0] + B / A *(m[1] - m[0]);
}
G convexCut(const G& P, const L& l) {
    G Q;
    rep(i, P.size()) {
        auto A = curr(P, i);
        auto B = next(P, i);
        if(ccw(l[0], l[1], A) != -1) Q.push_back(A);
        if(ccw(l[0], l[1], A) * ccw(l[0], l[1], B) < 0) Q.push_back(crossPoint(L(A, B), l));
    }
    return Q;
}



int main() {
    int n;
    while(cin >> n) {
        if(n == 0) break;
        G ps;
        rep(i, n) {
            D x, y;
            cin >> x >> y;
            ps.push_back({x, y});
        }
        {
            D l = (D)0.0, r = (D)2e4;
            auto moveL = [&](D m, const L& l) {
                auto v = l[1]-l[0];
                v *= P{0, 1};
                v /= (D)abs(v);
                v *= (m);
                return L{l[0]+v, l[1]+v};
            };
            auto check = [&](D m) {
                auto g = ps;
                rep(i, n) {
                    L l = {curr(ps, i), next(ps, i)};
                    g = convexCut(g, moveL(m, l));
                    if(g.empty()) return false;
                }
                return true;
            };
            rep(i, 1024) {
                D m = (l+r)/2.0;
                if(check(m)) l = m;
                else r = m;
            }
            printf("%.15lf\n", l);
        }
    }
    return 0;
}


Measured memory_bytes: 3364
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
  string s;
  cin >> s;
  sort(s.begin(),s.end());
  s.erase(unique(s.begin(),s.end()),s.end());
  char c[26] = {'a'};
  bool flag = false;
  for(int i=0; i<26; i++){
    c[i] = 'a' + i;
  }
  for(int i=0; i<26; i++){
    if(c[i] != s[i]){
      cout << c[i] << endl;
      flag = true;
      break;
    }
  }
  if(!flag){
    cout << "None" << endl;
  }
}

Measured memory_bytes: 512