akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 
#define PB push_back
#define MP make_pair
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define SIN(x, S) (S.count(x) != 0)
#define M0(x) memset(x,0,sizeof(x))
#define FILL(x, y) memset(x,y,sizeof(x))
#define MM(x) memset(x,-1,sizeof(x))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
///////////////////////////////////////////////
/* (๑╹◡╹) */
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll MOD = 1000000007;
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 MAX = 510000;
 
long long fac[MAX], finv[MAX], inv[MAX];
 



int main() {
	ll ans = 0;
	ll A,B,C,D;	cin >> A >> B >> C >> D;
	A = A-1;
	ll p;
	p = C*D/gcd(C,D);
	ans = B/C-A/C+B/D-A/D-(B/p-A/p);
	ans = B - A - ans;
	cout << ans << endl;
}


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

using namespace std;
typedef long long ll;

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REP(a, b, m) for (ll a = (ll)(b); a < (ll)(m); a++)

int main() {
    int n;
    string s;
    cin >> n>>s;
    string abc2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int kazu = s.size();
    rep(i,kazu) {
        rep(j,57) {
            if(s[i]==abc2[j]) {
                s[i] = abc2[j + n];
                break;
            }
        }
    }
    cout << s << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define rREP(i,m,n) for(ll i = (m); i >= (n); i--)
#define ALL(c) (c).begin(), (c).end()
#define print(x) cout << (x) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll h;
    cin >> h;
    int count_n =  0;
    while(h>0)
    {
        count_n++;
        h /= 2;
    }

    ll ans = 0;
    ll tmpn = 1;
    // count_n--;
    rep(i,count_n)
    {
        ans += tmpn;
        tmpn *= 2;
    }
    // ans += tmpn/2;
    cout << ans << endl;
    
    
    
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    string S;
    cin >> S;
    set<string> st;
    st.insert(S);
    for(int i = 2; i <= N; i++) {
        string T;
        cin >> T;
        if(st.find(T) != st.end()) {
            cout << "No" << endl;
            return 0;
        }
        if(S.back() != T[0]) {
            cout << "No" << endl;
            return 0;
        }
        S = T;
      st.insert(T);
    }
    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target ("avx")
#include <bits/stdc++.h>
constexpr int INF = 2147483647;
constexpr long long int INF_LL = 9223372036854775807;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

// (A_[i] - A_[j]) mod K = i-j
// (A_[i] - i) mod K = (A_[j] - j)mod K  (j < i)

int main() {
	int N, K;
	cin >> N >> K;
	vector<ll> A(N), A_(N + 1), B(N + 1);
	for (int i = 0; i < N; i++) cin >> A[i];
	A_[0] = 0;
	for (int i = 0; i < N; i++) {
		A_[i + 1] = A_[i] + A[i];
	}
	for (int i = 0; i <= N; i++) {
		B[i] = (A_[i] - i)%K;
	}

	ll ans = 0;
	unordered_map<int, int> cnt;
	for (int i = 0; i <= N; i++) {

		ans += cnt[B[i]];
		cnt[B[i]]++;
		if (i >= K-1) {
			cnt[B[i - K+1]]--;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 13128
#[allow(unused)]
use proconio::marker::*;
use proconio::{fastout, input};
#[allow(unused)]
use std::cmp::{max, min, Reverse};
#[allow(unused)]
use std::collections::{BinaryHeap, HashMap, HashSet, VecDeque};

#[fastout]
fn main() {
    input! {
        s: Chars,
    }
    let mut s = s.iter();
    print!("{}", s.next().unwrap());
    print!("{}", s.next().unwrap());
    println!("{}", s.next().unwrap());
}


Measured memory_bytes: 2136
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import defaultdict

n,m = map(int,readline().split())
a = list(map(int,readline().split()))

c = [0]*(n+1)
for i in range(n):
  c[i+1] = a[i]+c[i]

d = defaultdict(int)
for i in c:
  d[i%m] += 1
  
ans = 0
for i in d.values():
  ans += (i-1)*i//2
print(ans)

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

int main()
{
  int A[3][3];
  std::cin >> A[0][0] >> A[0][1] >> A[0][2];
  std::cin >> A[1][0] >> A[1][1] >> A[1][2];
  std::cin >> A[2][0] >> A[2][1] >> A[2][2];

  int N;
  std::cin >> N;

  std::vector<int> b(N);
  for (int i = 0; i < N; ++i)
  {
    std::cin >> b[i];
  }

  bool hit[3][3] =
  {
    { false, false, false },
    { false, false, false },
    { false, false, false }
  };

  for (int ib = 0; ib < N; ++ib)
  {
    bool exist = false;
    for (int i = 0; i < 3; ++i)
    {
      for (int j = 0; j < 3; ++j)
      {
        if (b[ib] == A[i][j])
        {
          hit[i][j] = true;
          exist = true;
          break;
        }
      }
      if (exist) { break; }
    }
  }

  bool bingo = false;
  for (int i = 0; i < 3; ++i)
  {
    if (hit[i][0] && hit[i][1] && hit[i][2])
    {
      bingo = true;
      break;
    }
    if (hit[0][i] && hit[1][i] && hit[2][i])
    {
      bingo = true;
      break;
    }
  }
  if (hit[0][0] && hit[1][1] && hit[2][2])
  {
    bingo = true;
  }
  if (hit[2][0] && hit[1][1] && hit[0][2])
  {
    bingo = true;
  }

  if (bingo)
  {
    std::cout << "Yes\n";
  }
  else
  {
    std::cout << "No\n";
  }

  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
int N, E, T, a[100001];
long long f[100001], g[100001];
int main()
{
	scanf("%d%d%d", &N, &E, &T);
	for (int i = 1; i <= N; i++)
		scanf("%d", a + i);
	g[0] = 2 * -a[1];
	for (int i = 1, j = 0; i <= N; i++)
	{
		while (2 * (a[i] - a[j + 1]) > T)
			j++;
		f[i] = f[j] + T;
		if (j)
			f[i] = std::min(f[i], 2 * a[i] + g[j - 1]);
		if (i < N)
			g[i] = std::min(g[i - 1], f[i] - 2 * a[i + 1]);
	}
	printf("%lld\n", f[N] + E);
	return 0;
}


Measured memory_bytes: 2176
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().solve();
	}
	
	void solve() {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		int count=0;
		for(int i=0;i<s.length();i++) {
			if(s.charAt(i)=='1') {
				count++;
			}
		}
		System.out.print(count);
	}
}


Measured memory_bytes: 21844
function main()
    # スペース区切りの整数の入力
    N,M,X,Y = map(x -> parse(Int, x), split(readline()))
    Xs = map(x -> parse(Int, x), split(readline()))
    Ys = map(x -> parse(Int, x), split(readline()))


    # 出
    Xss = append!([X],Xs)
    Yss = append!([Y],Ys)
    
    xss = sort(Xss)
    yss = sort(Yss)
    if xss[end] < yss[1]
        print("No War")
    end
    if xss[end] >= yss[1]
        print("War")
    end
end
main()


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

typedef long long LL;

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL MOD = 1e9+7;

int main() {
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    for(;0 < A && 0 < C;) {
        A -= D;
        C -= B;
    }
    if(C <= 0) {
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#include <functional>
#include <iomanip>
using namespace std;
	
#define int long long
#define pb push_back
#define ub upper_bound
#define lb upper_bound
#define mp make_pair
#define F first
#define S second
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define REP(i,n) FOR(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define ve vector
#define vi vector<int>
#define vp vector<pair<int,int>>
#define vvi vector<vector<int>>

using ll = long long;
ll INF = LLONG_MAX / 4 - 100;
ll mod = 1e9 + 7;
int dx[] = {-1,0,1,0}, dy[] = {0,1,0,-1};
vector<ll> prime;
	
class fact {
public:
	int fmod = 1e9+7;
	vector<int> fac, inv;
	fact (int n, int Mod = 1e9+7) {
		fmod = Mod;
		fac = vector<int>(n,0);
		inv = vector<int>(n,0);
		fac[0] = 1; for (int i = 1; i < n; i++) fac[i] = fac[i-1] * i % fmod;
		for (int i = 0;i < n;i++) inv[i] = fact::POW(fac[i],fmod-2);
	}
	ll nCr(ll n, ll r) {return (fac[n] * inv[r] % fmod) * inv[n-r] % fmod;}
	ll POW(ll a, ll b) {ll c = 1; while (b > 0) {if (b & 1) {c = a * c%fmod;}a = a * a%fmod; b >>= 1;}return c;}
};
	
template <class T = ll> T in() {T x; cin >> x; return (x);}
void DEBUG(vector<int> a) {for(int i=0;i<a.size();i++)cout<<a[i]<<" ";cout<<endl;}
void EMP(int x) {cout<<"!!!"<<x<<"!!!"<<endl;}
ll GCD(ll a, ll b) {ll c; while (b != 0) {c = a % b; a = b; b = c;}return a;}
ll LCM(ll a, ll b) {return a * b / GCD(a, b);}
ll POW(ll a, ll b) {ll c = 1; while (b > 0) {if (b & 1) {c = a * c%mod;}a = a * a%mod; b >>= 1;}return c;}
void PRI(ll n) {bool a[n + 1LL]; for (int i = 0; i < n + 1LL; i++) {a[i] = 1LL;}for (int i = 2; i < n + 1LL; i++) {if (a[i]) {prime.pb(i); ll b = i; while (b <= n) {a[b] = 0; b += i;}}}}
template <typename T> T chmin(T& a, T b) {if(a>b)a=b;return a;}
template <typename T> T chmax(T& a, T b) {if(a<b)a=b;return b;}
bool isSqrt(ll a) {return pow(sqrt(a),2) == a ? 1 : 0;}
void YesNo(bool a) {if (a) cout << "Yes"; else cout << "No"; cout << endl;}
void yesno(bool a) {if (a) cout << "yes"; else cout << "no"; cout << endl;}
void YESNO(bool a) {if (a) cout << "YES"; else cout << "NO"; cout << endl;}
double dis(int x1, int x2, int y1, int y2) {
    return sqrt((double)abs(x1-x2)*(double)abs(x1-x2)+(double)abs(y1-y2)*(double)abs(y1-y2));
}

bool solve() {
    int n; cin >> n;
    string S[n];
    REP (i,n) {
        cin >> S[i];
        sort(all(S[i]));
    }
    int ans = 0;
    sort(S,S+n);
    int tmp = 1;
    FOR (i,1,n) {
        if (S[i] == S[i-1]) {
            tmp++;
        } else {
            ans += tmp * (tmp-1) / 2;
            tmp = 1;
        }
    }
    ans += tmp * (tmp-1) / 2;
    cout << ans << endl;
}

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


Measured memory_bytes: 5760
import sys
n,m,x= map(int, sys.stdin.readline().rstrip("\n").split())
lines = [ [int(s) for s in line.split()] for line in sys.stdin ]
price = -1
skill = {}
for i in range(2**n-1):
    i = format(i+1, 'b').zfill(n)
    price_ = 0
    for j in range (m):
        skill[j] = 0
    for k in range(n):
        if i[k] == '1':
            price_  += lines[k][0]
            for j in range(m):
                skill[j] = skill[j] + lines[k][j+1]
    for j in range(m):
        if skill[j] < x:
            break
    else:
        if price == -1:
            price = price_
        else:
            price = min(price, price_)
print(price)

Measured memory_bytes: 9248
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define po          pop_back
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<int,int>
#define ms          map<string,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define pqb         priority_queue<int>
#define pqs         priority_queue<int,vi,greater<int> >
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
#define debug(x,y)  cout<<x<<" "<<y<<"\n";
#define w(x)        ll x

using namespace std;
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; 
}
void solve()
{
    int n;
    cin>>n;
    int a[n+1][3];
    rep(i,1,n+1){
        rep(j,0,3){
            cin>>a[i][j];
        }
    }
    int dp[n+1][3];
    dp[1][0]=a[1][0];
    dp[1][1]=a[1][1];
    dp[1][2]=a[1][2];
    for(int i=2;i<=n;i++){
        for(int j=0;j<3;j++){
            dp[i][j]=a[i][j]+max(dp[i-1][(j+1)%3],dp[i-1][(j+2)%3]);
        }
    }
    cout<<max(dp[n][0],max(dp[n][1],dp[n][2]));
     
}
int main()
{
    int t=1;
    //cin>>t;
    while(t--){
        solve();
    }
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll r;
    cin >> r;
    print(3*r*r);

    
}

Measured memory_bytes: 256
let readCharArray _ = stdin.ReadLine().ToCharArray()

let rec solve ans q =
    match q with
    | 'B' :: xx -> if (ans |> List.isEmpty) then solve [] xx else ans |> List.tail |> solve <| xx
    | x :: xx -> solve (x :: ans) xx
    | _ -> ans |> List.rev |> List.toArray


()
|> readCharArray
|> Array.toList
|> solve []
|> System.String
|> printfn "%s"


Measured memory_bytes: 29608
N, M = map(int,input().split())
array = []
dic = {}
for i in range(M):
    p, y = map(int,input().split())
    array.append((p,y))
    dic[y]=i
array.sort()
ans = ['']*M
now_p = array[0][0]
idx = 1
for p, y in array:
    if p != now_p:
        idx = 1
    now_p = p
    ans[dic[y]]=str(p).zfill(6)+str(idx).zfill(6)
    idx+=1
for a in ans:
    print(a)

Measured memory_bytes: 100568
#[allow(unused_macros)]
macro_rules! invec {
    ( $t:ty ) => {{
        let mut s = String::new();
        match std::io::stdin().read_line(&mut s) {
            Ok(0) => Vec::<$t>::new(),
            Ok(n) => s.trim().split_whitespace().map(|s| s.parse::<$t>().unwrap()).collect::<Vec<$t>>(),
            Err(_) => Vec::<$t>::new(),
        }
    }}
}

#[allow(unused_macros)]
macro_rules! input {
    ( $($t:ty),* ) => {{
        let mut s = String::new();
        std::io::stdin().read_line(&mut s);
        let mut splits = s.trim().split_whitespace();
        ($(
            {
                 splits.next().unwrap().parse::<$t>().unwrap()
            },
        )*)
    }}
}

#[allow(unused_must_use)]
#[allow(unused_variables)]
fn solve() {
    let (n, ) = input!(usize);
    let arr = invec!(u32);

    let mut count = 0;
    let mut max = 0;

    for v in arr {
        if max <= v {
            count += 1;
            max = v;
        }
    }
    

    println!("{}", count);
}

fn main() {
    solve();
}


Measured memory_bytes: 4352
import collections
import sys
sys.setrecursionlimit(10**6)
N, M = map(int, input().split())
AB = [tuple(map(int, input().split())) for i in range(M)]


class unionFind:
    parent = []

    def __init__(self, N):
        self.parent = [i for i in range(N)]

    def root(self, x):
        if self.parent[x] == x:
            return(x)
        else:
            self.parent[x] = self.root(self.parent[x])
            return(self.parent[x])

    def same(self, x, y):
        x, y = x-1, y-1
        return(self.root(x) == self.root(y))

    def unite(self, x, y):
        x, y = x-1, y-1
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return
        else:
            self.parent[x] = y
            return


G = unionFind(N)

for a, b in AB:
    G.unite(a, b)

for i in range(N):
    G.root(i)

C = collections.Counter(G.parent).most_common()

print(C[0][1])


Measured memory_bytes: 201860
import java.io.PrintWriter;
import java.util.Scanner;

class Main{
    private static final Scanner sc = new Scanner(System.in);
    private static final PrintWriter out = new PrintWriter(System.out);
    public static void main(String[] Args){
        final int n = Integer.parseInt(sc.next());
        final int m = Integer.parseInt(sc.next());
        final int a[][] = new int[n][m];
        final int b[] = new int[m];
        for(int i = 0; i<n; i++){
            for(int j = 0; j<m; j++){
                a[i][j] = Integer.parseInt(sc.next());
            }
        }
        for(int i = 0; i<m; i++)
            b[i] = Integer.parseInt(sc.next());
        for(int i = 0; i<n; i++){
            int ans = 0;
            for(int j = 0; j<m; j++){
                ans += a[i][j]*b[j];
            }
            out.println(ans);
        }
        out.flush();
    }
}

Measured memory_bytes: 39160
from collections import Counter
n = int(input())
d = list(map(int, input().split()))
mod = 998244353
if d[0] != 0:
    print(0)
else:
    a = Counter(d)
    ans = 1
    if a[0] > 1:
        print(0)
    else:
        for i in range(1, max(d)+1):
            ans *= a[i-1]**a[i]
            ans %= mod
        print(ans)
    


Measured memory_bytes: 24384
import bisect as bis

n = int(input())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))

ans = 0
for b_e in b:
    n_top = bis.bisect_left(a, b_e)
    n_bottom = n - bis.bisect_right(c, b_e)
    ans += n_top * n_bottom

print(ans)

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

int main() {
  string c;
  cin >> c;
  
    if (c.at(0) == 'a')
      cout << "vowel" << endl;
    else if (c.at(0) == 'i')
      cout << "vowel" << endl;
    else if (c.at(0) == 'u')
      cout << "vowel" << endl;
    else if (c.at(0) == 'e')
      cout << "vowel" << endl;
    else if (c.at(0) == 'o')
      cout << "vowel" << endl;
    else 
      cout << "consonant" << endl;
}


Measured memory_bytes: 3604
// inputに入力データ全体が入る
function Main(input) {
	var line = input.split("\n");
	var M = Number(line[0]);
	console.log(48-M);

}

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

Measured memory_bytes: 7372
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    vi v(10); vi u(10);
    rep(i,10)cin>>v[i]; rep(i,10)cin>>u[i];
    sort(all(v),greater<int>()); sort(all(u),greater<int>());
    cout<<v[0]+v[1]+v[2]<<" "<<u[0]+u[1]+u[2]<<endl;
}

Measured memory_bytes: 3048
using System;
using System.Collections.Generic;
using System.Linq;

public class Program
{
    public static void Main(string[] args)
    {
        var tenkis = new string[] { "Sunny", "Cloudy", "Rainy" }.ToList();
        var input = Console.ReadLine().Trim();
        Console.WriteLine(tenkis[(tenkis.IndexOf(input) + 1) % (tenkis.Count)]);
    }
}

Measured memory_bytes: 13152
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();
		int change;
		
		if(a > b){
			change = a;
			a = b;
			b = change;
		}
		
		if(b > c){
			change = b;
			b = c;
			c = change;
		}
		
		if(a > b){
			change = a;
			a = b;
			b = change;
		}
		
		System.out.println(a +" "+b+" "+c);
	}
}

Measured memory_bytes: 17352
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  string s;
  int res=0;

  cin>>n;
  for(int i=0;i<n;i++){
    cin>>s[i];
  }
  for (int i=0;i<n;i++){
    if(s[i]=='G'){
      res++;
      break;
    }
  }

  for (int i=0;i<n;i++){
    if(s[i]=='W'){
      res++;
      break;
    }
  }

  for (int i=0;i<n;i++){
    if(s[i]=='P'){
      res++;
      break;
    }
  }

  for (int i=0;i<n;i++){
    if(s[i]=='Y'){
      res++;
      break;
    }
  }
 
if (res ==3){
  cout <<"Three"<<endl;
}
else if (res ==4){
  cout <<"Four"<<endl;
}
 
}

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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz size()
#define pb(x) push_back(x) 
#define bg begin()
#define ed end()
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define mp(x,y) make_pair(x,y)
const ll MOD=1000000007;

ll maxx(ll x,ll y,ll z){
	return max(max(x,y),z);
}
ll minn(ll x,ll y,ll z){
	return min(min(x,y),z);
}
ll gcd(ll x,ll y){
	if(x%y==0) return y;
    else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
	return x*(y/gcd(x,y));
}

//a,b x
int main(){
	ll A,B,C; cin>>A>>B>>C;
	if(A%2==1 || B%2==1 || C%2==1){
		cout<<0;
		return 0;
	}

	ll D=abs(A-B),E=abs(B-C);
	if(D==0 || E==0){
		ll tmp=D+E;
		D=tmp;
		E=tmp;
	}

	if(D==0 && E==0) cout<<-1;
	else{
		ll G=gcd(D,E);
		ll cnt=0;
		while(1){
			if(G%2==0){
				G/=2;
				cnt++;
			}
			else break;
		}
		cout<<cnt;
	}
}

Measured memory_bytes: 256
class UnionFindTree:
  def __init__(self, n: int):
    self.__parent = [i for i in range(n)]
    self.__rank = [0 for i in range(n)]

  def unite(self, x, y):
    self.__link(self.__find_set(x), self.__find_set(y))

  def same(self, x, y):
    return self.__find_set(x) == self.__find_set(y)

  def __find_set(self, x):
    if x != self.__parent[x]:
      self.__parent[x] = self.__find_set(self.__parent[x])
    return self.__parent[x]

  def __link(self, x, y):
    if self.__rank[x] < self.__rank[y]:
      self.__parent[x] = y
    else:
      if self.__rank[x] == self.__rank[y]:
        self.__rank[x] += 1
      self.__parent[y] = x


N, Q = map(int, input().split())
t = UnionFindTree(N)
for i in range(Q):
  command, x, y = map(int, input().split())
  if command == 0:
    t.unite(x, y)
  if command == 1:
    if t.same(x, y):
      print(1)
    else:
      print(0)



Measured memory_bytes: 6040
#include <iostream>

using namespace std;

int main()
{
    long long n,k,x,y,res=0;
    cin>>n>>k>>x>>y;
    for(int i=0;i<n;i++){
        if(k!=0){
            res+=x;
            k--;
        }
        else res+=y;
    }
    cout<<res<<endl;
    return 0;
}


Measured memory_bytes: 256
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = inpln(n)
m = 0
mm = 0
cnt = 0
for i in a:
    if i > m:
        mm = m
        m = i
        cnt = 0
    elif i == m:
        cnt += 1
    elif i > mm:
        mm = i
for i in a:
    if i == m:
        if cnt > 0:
            print(m)
        else:
            print(mm)
    else:
        print(m)

Measured memory_bytes: 60124
#include <iostream>
#include <string>

using namespace std;

int main(void) {
  string s;
  cin>>s;
  s="0"+s;

  if(s==string(s.rbegin(), s.rend()) && s[1]=='1') {
    int r=1;
    for(int i=2; i<s.size(); i++) {
      printf("%d %d\n", r, i);
      if(s[i-1]=='1') r=i;
    }
  } else {
    puts("-1");
  }
  return 0;
}


Measured memory_bytes: 1660
n=int(input())
l=[list(map(int,input().split())) for i in range(n-1)]
ans=0
for i in range(n):
  ans+=(i+1)*(n-i)
for i in range(n-1):
  ans-=min(l[i])*(n-max(l[i])+1)
print(ans)

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

typedef long long ll;

int n, k;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> k;
    int cur = 1;
    while (n) {
        cur = min(cur * 2, cur + k);
        --n;
    }
    cout << cur << endl;

    return 0;
}



Measured memory_bytes: 3608
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;
using ll = long long;
int main() {
	ll A, B, C, D;
	cin >> A >> B >> C >> D;
	ll bc = B / C, bd = B / D, r = 0;
	ll ac = (A - 1) / C, ad = (A - 1) / D;
	ll c = max(C, D), d = min(C, D);
	while (d != 0) {
		r = c%d;
		c = d;
		d = r;
	}
	ll l = C*D / c;
	ll lcm = B / l - (A - 1) / l;
	cout << B - A + 1 - ((bc - ac) + (bd - ad)) + lcm << endl;
	return 0;
}

Measured memory_bytes: 256
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7

s = S()
t = S()

if len(s) + 1 == len(t):
    for i in range(len(s)):
        if s[i] != t[i]:
            print("No")
            sys.exit()
    print("Yes")

Measured memory_bytes: 9112
def main():
    n, t = map(int, input().split())
    a = list(map(int, input().split()))

    if n == 1:
        print(0)
    else:
        min_a, max_prof = a[0], a[1] - a[0]
        cnt, c_lst = 0, []
        for i in range(1, n):
            if a[i] - min_a > max_prof:
                max_prof = a[i] - min_a
                c_lst.append(cnt)
                cnt = 1
            elif a[i] - min_a == max_prof:
                cnt += 1

            if a[i] < min_a:
                min_a = a[i]

        c_lst.append(cnt)

        print(max(c_lst))


if __name__ == '__main__':
    main()


Measured memory_bytes: 14436
cards = list(map(int, input().split()))
K = int(input())
for i in range(K):
    if cards[0] >= cards[1]:
        cards[1] *= 2
    else:
        cards[2] *= 2
# print(cards)
if cards[0] < cards[1] < cards[2]:
    print('Yes')
else:
    print('No')


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

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

int main() {
  int n;
  cin >> n;
  vector<int> p(n);
  rep(i, n) cin >> p[i];

  int ans = 0;
  for (int i=0; i<n-2; ++i) {
    if (p[i] < p[i+1] && p[i+1] <  p[i+2]) {
      ans += 1;
    } else if (p[i+2] < p[i+1] && p[i+1] < p[i] ) {
      ans += 1;
    }
  }
  cout << ans << endl;
  return 0;
}


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

int main() {
    int x,n;
    cin>>x>>n;
    map<int,bool>mp;
    int a;
    for(int i=0;i<n;i++) {
        cin>>a;
        mp[a] = true;
    }
    int ans = 0,mn=1e9;
    for(int i=0;i<=101;i++) {
        if(mp[i])continue;
        if(mn > abs(x-i)) {
            mn = abs(x-i);
            ans = i;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3612
import sys
import pdb
input = sys.stdin.readline

N, W = map(int, input().split())
ws = []
vs = []
for _ in range(N):
  w, v = map(int, input().split())
  ws.append(w)
  vs.append(v)

inf = 1e10

# Value[i番目までの品番][重さj以下]
Value = [[-inf for _ in range(W+1)] for __ in range(N)]

for load in range(W+1):
  if load < ws[0]:
    # 1番目の品物を入れようがなければスキップ
    Value[0][load] = 0
  else:
    Value[0][load] = vs[0]

for num in range(1, N):
  for load in range(W+1):
    if load >= ws[num]:   # 新しい品物を入れられるとき
      Value[num][load] = max(Value[num][load], Value[num-1][load], Value[num-1][load-ws[num]] + vs[num])
    else:   # 新しい品物を入れられないとき
      # 価値を変えることはできない
      Value[num][load] = Value[num-1][load]
      # Value[num][load] = max(Value[num][load], Value[num-1][load])

print(Value[N-1][W])


Measured memory_bytes: 287332
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <cmath>   
#include<cctype>
#include<string>
#include<set>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <utility> 

#define rep(i,m,n) for(int i = m;i < n;++i)
using namespace std;
using ll = long long;
using R = double;
const ll inf = 1LL << 50;
const ll MOD = 1e9 + 7;


ll n, m;


int main() {
	cin >> n >> m;
	//{終点,始点}
	vector< pair<int, int> >data;

	rep(i, 0, m) {
		int a, b;
		cin >> a >> b;
		data.push_back({b,a});
	}

	sort(data.begin(), data.end());

	int ans = 1;
	int last = data[0].first - 1;
	rep (i, 1, m) {
		if (data[i].second > last) {
			ans++;
			last = data[i].first - 1;
		}
	}

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

Measured memory_bytes: 1400
#include<bits/stdc++.h>
using namespace std;
int n,m,s,t;
int op[200][200];
int fa[200][200];
int fb[200][200];
int fc[200][200];
int fd[200][200];
int num[200][200];
int Anum[200][200];
int Cnum[200][200];
int Onum[200][200];
int numO[200][200];

struct data{
  int from,to,type;
  data(int a,int b,int c):from(a),to(b),type(c){}
};

void init(){
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      op[i][j]=0;
      fa[i][j]=0;
      fb[i][j]=0;
      fc[i][j]=0;
      fd[i][j]=0;
      num[i][j]=0;
      Anum[i][j]=0;
      Cnum[i][j]=0;
      Onum[i][j]=0;
    }
  }
}

bool solve(){
  queue< data > Q;
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
      if(num[i][j]==1)
        Q.push(data(i,j,0));
  
  while(!Q.empty()){
    data d=Q.front();Q.pop();
    if(d.from==s&&d.to==t&&d.type==0)return true;
    if(d.type==0){
      for(int nfrom=0;nfrom<n;nfrom++){
        if(op[nfrom][d.from]==1){
          if(Onum[nfrom][d.to]==0){
            Onum[nfrom][d.to]=1;
            Q.push(data(nfrom,d.to,3));
          }
        }
        if(fa[nfrom][d.from]==1){
          if(Anum[nfrom][d.to]==0){
            Anum[nfrom][d.to]=1;
            Q.push(data(nfrom,d.to,1));
          }
        }
        if(fc[nfrom][d.from]==1){
          if(Cnum[nfrom][d.to]==0){
            Cnum[nfrom][d.to]=1;
            Q.push(data(nfrom,d.to,2));
          }
        }
      }
      for(int nto=0;nto<n;nto++){
        if(Onum[d.to][nto]==1){
          if(num[d.from][nto]==0){
            num[d.from][nto]=1;
            Q.push(data(d.from,nto,0));
          }
        }
      }
    }
    if(d.type==1){
      for(int nto=0;nto<n;nto++){
        if(fb[d.to][nto]==1){
          if(num[d.from][nto]==0){
            num[d.from][nto]=1;
            Q.push(data(d.from,nto,0));
          }
        }
      }
    }
    if(d.type==2){
      for(int nto=0;nto<n;nto++){
        if(fd[d.to][nto]==1){
          if(num[d.from][nto]==0){
            num[d.from][nto]=1;
            Q.push(data(d.from,nto,0));
          }
        }
      }
    }
    if(d.type==3){
      for(int nfrom=0;nfrom<n;nfrom++){
        if(num[nfrom][d.from]==1){
          if(num[nfrom][d.to]==0){
            num[nfrom][d.to]=1;
            Q.push(data(nfrom,d.to,0));
          }
        }
      }
    }
  }
  return false;
}

int main(){
  while(1){
    scanf("%d %d %d %d",&n,&m,&s,&t);
    if(n==0&&m==0&&s==0&&t==0)break;
    s--,t--;
    init();
    for(int i=0;i<m;i++){
      int from,to;
      char str[3];
      scanf("%d %d %s",&from,&to,str);
      from--,to--;
      if(str[0]=='*'||str[0]=='+'){
        op[from][to]=1;
      }else if(str[0]=='('){
        fa[from][to]=1;
      }else if(str[0]==')'){
        fb[from][to]=1;
      }else if(str[0]=='['){
        fc[from][to]=1;
      }else if(str[0]==']'){
        fd[from][to]=1;
      }else if(str[0]=='a'){
        num[from][to]=1;
      }
    }
    cout<< (solve()?"Yes":"No") <<endl;
  }
  return 0;
}



Measured memory_bytes: 6108
# -*- coding: utf-8 -*-
n,q = map(int, input().split())
s = input()
td = [input().split() for _ in range(q)]

def check(idx, x):
    for t,d in td:
        if idx==x:
            return True
        elif idx==n or idx==-1:
            return False

        if s[idx]==t:
            if d=="L":
                idx -= 1
            else:
                idx += 1
    return idx==x

ok = -1
ng = n
while abs(ok-ng)>1:
    mid = (ok+ng)//2
    if check(mid, -1):
        ok = mid
    else:
        ng = mid
res = ok+1

ok = n
ng = -1
while abs(ok-ng)>1:
    mid = (ok+ng)//2
    if check(mid, n):
        ok = mid
    else:
        ng = mid
res += n-ok

print(n-res)


Measured memory_bytes: 41396
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <random>

using namespace std;


int main()
{
	int K,X;
	int L = -1000000;
	int R =  1000000;
	int ans = 0;

	cin >> K >> X;

	int l,r;

	l = max(L, X -  K + 1);
	r = min(R, X + K  - 1);

	for (int xi = l; xi <= r; xi++){
		printf("%d ",xi);
	}


	//printf("%d\n", ans);


	return 0;
}



Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using static System.Console;
using static System.Math;
using static MyIO;
using static MyUtil;

public class A
{
	public static void Main() => (new Solver()).Solve();
}

public class Solver
{
	public void Solve()
	{
		int N = GetInt();
		int R = GetInt();
		WriteLine(N >= 10 ? R : R + 100 * (10 - N));
	}
}

public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt() => int.Parse(getArg());
	public static long GetLong() => long.Parse(getArg());
	public static double GetDouble() => double.Parse(getArg());
	public static decimal GetDecimal() => decimal.Parse(getArg());
	public static string GetString() => getArg();
	public static char GetChar() => getArg()[0];
	public static int[] GetInts(long N) => Enumerable.Range(0, (int)N).Select(_ => GetInt()).ToArray();
	public static long[] GetLongs(long N) => Enumerable.Range(0, (int)N).Select(_ => GetLong()).ToArray();
	public static double[] GetDoubles(long N) => Enumerable.Range(0, (int)N).Select(_ => GetDouble()).ToArray();
	public static decimal[] GetDecimals(long N) => Enumerable.Range(0, (int)N).Select(_ => GetDecimal()).ToArray();
	public static string[] GetStrings(long N) => Enumerable.Range(0, (int)N).Select(_ => GetString()).ToArray();
}

public static class MyUtil
{
	public static void chmax<T>(ref T x, T y) where T : IComparable<T>
	{
		if(x.CompareTo(y) < 0)
			x = y;
	}

	public static void chmin<T>(ref T x, T y) where T : IComparable<T>
	{
		if(x.CompareTo(y) > 0)
			x = y;
	}

	public static void swap<T>(ref T x, ref T y)
	{
		T tmp = x;
		x = y;
		y = tmp;
	}
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
//NOT TO SUBMIT IN WRONG PLACE OR BY WRONG COMPILER
//ABC 147, taskC, 2020/05/01
//ms,
/*
bit全探索の練習！
*/

int main(void){
  int N;
  vector<int> A(15);
  int x[15][15];
  int y[15][15];
  int ans=0;

  cin >>N;
  for(int i=0; i<N; i++){
    cin >>A.at(i);
    for(int j=0; j<A.at(i); j++){
      cin >>x[i][j] >>y[i][j];
    }
  }

  for(int bin_flags=0; bin_flags<(1<<N); bin_flags++){
    //1:honest, 0:unkind
    for(int i=0; i<N; i++){
      if(bin_flags & (1<<i)){
        for(int j=0; j<A.at(i); j++){
          if(  (bin_flags &(1<<(x[i][j]-1)))
            != (y[i][j]<<(x[i][j]-1))        ) goto OUT;
        }
      }
    }
    ans=max(ans, __builtin_popcount(bin_flags));
    OUT:continue;
  }

  cout <<ans <<endl;


  return 0;
}
/*
*/



Measured memory_bytes: 384
#include <bitset>
#include <iostream>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
using Visited = bitset<60>;
struct Connect {
  int to;
  int idx;
};
using Connections = vector<vector<Connect>>;

bool separated(const Connections& ccs, int disable) {
  Visited visited(0);
  queue<int> ps;
  ps.push(1); //
  while(!ps.empty()) {
    auto crnt = ps.front();
    ps.pop();
    if(visited.test(crnt)) {
      continue;
    }
    visited.set(crnt);
    for(const auto& c : ccs[crnt]) {
      // 使えない橋の場合は追加しない
      if(c.idx == disable) {
        continue;
      }
      ps.push(c.to);
    }
  }
  // cout << disable << " : " << visited.count() << endl;
  return visited.count() != ccs.size() - 1;
}

int main() {
  int N, M;
  cin >> N >> M;
  Connections cs(N + 1);
  int a, b;
  for(int i = 0; i < M; ++i) {
    cin >> a >> b;
    cs[a].push_back({b, i});
    cs[b].push_back({a, i});
  }

  int ans = 0;
  for(int i = 0; i < M; ++i) {
    if(separated(cs, i)) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#if 0

#endif

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

int M;
set<string> S;

int main() {
  cin >> M;
  string train;
  while (cin >> train) {
    string s1, s2;
    for (int i = 0; i <= train.length(); i++) {
      s1 = train.substr(0,i); s2 = train.substr(i);
      S.insert(s1+s2); S.insert(s2+s1);
      reverse(s1.begin(), s1.end());
      S.insert(s1+s2); S.insert(s2+s1);
      reverse(s2.begin(), s2.end());
      S.insert(s1+s2); S.insert(s2+s1);
      reverse(s1.begin(), s1.end());
      S.insert(s1+s2); S.insert(s2+s1);
    }
    cout << S.size() << endl;
    S.clear();
  }
}



Measured memory_bytes: 3224
#include <bits/stdc++.h>
#define MAXN 300100
#define pii pair<int, int>
#define pb push_back
typedef long long ll;

using namespace std;

int n, a[MAXN];
ll ans = -1e18;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    cin >> n;
    for(int i = 0; i < 3 * n; i++){
    	cin >> a[i];
    }
    multiset<int> l, r, rr;
    ll ls = 0, rs = 0;
    for(int i = 0; i < n; i++){
    	l.insert(a[i]);
    	ls += a[i];
    }
    for(int i = n; i < 3 * n; i++){
    	r.insert(a[i]);
    	rr.insert(a[i]);
    }
    auto ri = r.begin();
    for(int i = 0; i < n; i++){
    	rs += *ri;
    	ri++;
    }
    r.erase(ri, r.end());
    while(rr.size() > n)
    	rr.erase(rr.begin());

    ans = max(ans, ls - rs);
    for(int i = n; i < 2 * n; i++){	//add i to left side
   // cout << ans;
    	l.insert(a[i]);
    	ls += a[i];
    	ls -= *l.begin();
    	l.erase(l.begin());

    	if(rr.find(a[i]) != rr.end()){
    		rr.erase(rr.find(a[i]));
    	} else{
    		r.erase(r.find(a[i]));
    		rs += *rr.begin();
    		r.insert(*rr.begin());
    		rr.erase(rr.begin());
    		rs -= a[i];
    	}

    	ans = max(ans, ls - rs);
    }
    cout << ans;
}

Measured memory_bytes: 24832
#include<bits/stdc++.h>
using namespace std;
	
#define ll long long int
#define pb push_back
#define rep(i , j , n) for(ll i = j ; i < n ; i++)
#define per(i , j , n) for(ll i = j ; i >= n ; i--)
 


int main(){
	ll a,b,c,d;
    cin >> a >> b >> c >> d;
    ll x;
    while(1){
        if(c - b <= 0){ 
            x = 1;
            break;
            }
        else if(a - d <= 0){
            x = 0;
            break;
        }
        c = c - b;
        a = a - d;
    }
    if(x) cout << "Yes";
    else cout << "No";
    
}


Measured memory_bytes: 3560
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mikit
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ATaskSchedulingProblem solver = new ATaskSchedulingProblem();
        solver.solve(1, in, out);
        out.close();
    }

    static class ATaskSchedulingProblem {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int a1 = in.nextInt(), a2 = in.nextInt(), a3 = in.nextInt();
            int max = Math.max(a1, Math.max(a2, a3));
            int min = Math.min(a1, Math.min(a2, a3));
            out.println(max - min);
        }

    }
}



Measured memory_bytes: 25556
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

namespace atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var abc = Console.ReadLine().Split(' ').Select(num => int.Parse(num)).ToArray();
            var result = abc[2] - (abc[0] - abc[1]);
            Console.WriteLine(result > 0 ? result : 0);
        }
    }
}

Measured memory_bytes: 28164
#include <bits/stdc++.h>
#include <string>
#include <cmath>
#include <sstream>
using namespace std;
using namespace std::chrono;
#define int long long
#define f(a,b,c) for(a=b;a<=c;a++)
#define frev(a,b,c) for(a=b;a>=c;a--)
#define rep(a,b,c) for(a=b;a<c;a++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define all(X) (X).begin(), (X).end()
#define reset(X) memset(X, 0, sizeof(X))
#define endl '\n'
#define ff first
#define ss second
#define ld long double
int M1=1000000007;
int M2=67280421310721;
int M3=998244353;
int INF=1e18;
int power(int a, int b, int mod)
{
    int ans=1;
    int prod=a;
    while(b)
    {
        if(b%2)
            ans=(ans*prod)%mod;
        prod=(prod*prod)%mod;
        b/=2;
    }
    return ans;
}
int inv(int a, int mod)
{
    return power(a, mod-2, mod);
} 
int gcd(int a,int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int fact(int n,int mod){
	int f=1;
	for(int i=1;i<=n;i++) f=(f*i)%mod;
	return f;
}
int ncr(int n,int r,int mod){
	if(mod==1){
	return (fact(n,mod)/fact(r,mod))/fact(n-r,mod);
	}
	return (((fact(n,mod)*inv(fact(r,mod),mod))%mod)*inv(fact(n-r,mod),mod))%mod;
}
void solve(){
    //code starts here
    int k;
    cin>>k;
    string s;
    cin>>s;
    if(s.size()<=k) {
    	cout<<s<<endl;
    }  
    else{
    	cout<<s.substr(0,k)<<"..."<<endl;
    }
}
signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout<<fixed<<setprecision(10);
    auto start = high_resolution_clock::now();
    int i,t=1;
    //cin>>t;
    f(i,1,t) solve();
    auto stop = high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(stop - start);
    //cout << duration.count() << endl;
}

Measured memory_bytes: 3656
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

class Program{
	static void Main(){
		long n = long.Parse(Console.ReadLine());
		List<long> abcde = new List<long>();
		for (int i = 0;i < 5;i++)
			abcde.Add(long.Parse(Console.ReadLine()));
		long min = abcde.Min();
		long ans = 4;
		ans += n / min;
		if (n % min != 0) ans++;
		Console.WriteLine(ans);
	}
}

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

int main() {
	#ifdef INPUT
	freopen("r", "r", stdin);
	#endif
	int n, d, x;
	scanf("%d %d %d", &n, &d, &x);
	vector<int> V; while(n--) {
		int now; scanf("%d", &now); V.emplace_back(now);
	}
	for(int i = 1; i <= d; ++i) {
		for(auto z : V) if((i-1) % z == 0) x++;
	}
	printf("%d\n", x);
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <limits.h>
#include <tuple>
#include <map>

using namespace std;

bool cmpX(const pair<int, int>& a, const pair<int, int>& b) {
    return ((a.first == b.first) ? (a.second < b.second) : (a.first < b.first));
}

bool cmpY(const pair<int, int>& a, const pair<int, int>& b) {
    return ((a.second == b.second) ? (a.first < b.first) : (a.second < b.second));
}

bool cmp(const tuple< pair<int, int>, pair<int, int>, int>& a, const tuple< pair<int, int>, pair<int, int>, int>& b) {
    return get<2>(a) < get<2>(b);
}

bool operator!= (const pair<int, int>& a, const pair<int, int>& b) {
    if (a.first != b.first || a.second != b.second) {
        return true;
    }

    return false;
}

bool operator== (const pair<int, int>& a, const pair<int, int>& b) {
    if (a.first == b.first && a.second == b.second) {
        return true;
    }

    return false;
}

map < pair<int, int>, pair<int, int> > gr;

pair<int, int> Find(const pair<int, int>& x) {
    if (gr[x] == x) {
        return x;
    }
    gr[x] = Find(gr[x]);
    return gr[x];
}

void Unite(const pair<int, int>& x, const pair<int, int>& y) {
    gr[x] = y;
}

int main()
{
    ios::sync_with_stdio(false);
    vector < pair<int, int> > v;

    int n;
    cin >> n;

    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        v.push_back(make_pair(a, b));
    }

    vector < tuple< pair<int, int>, pair<int, int>, int> > edges;
    sort(v.begin(), v.end(), cmpX);

    for (auto it = v.begin() + 1; it != v.end(); it++) {
        edges.push_back(make_tuple(*(it - 1), *it, it->first - (it - 1)->first));
        gr[*(it - 1)] = *(it - 1);
        gr[*it] = *it;
    }

    sort(v.begin(), v.end(), cmpY);

    for (auto it = v.begin() + 1; it != v.end(); it++) {
        edges.push_back(make_tuple(*(it - 1), *it, it->second - (it - 1)->second));
        gr[*(it - 1)] = *(it - 1);
        gr[*it] = *it;
    }


    sort(edges.begin(), edges.end(), cmp);
    /*cout << "\n";
    for (auto it = edges.begin(); it != edges.end(); it++) {
        cout << "(" << get<0>(*it).first << " " << get<0>(*it).second << ")->" << "(" << get<1>(*it).first << " " << get<1>(*it).second << ") " << get<2>(*it) << "\n";
    }
    cout << "\n";*/


    int answer = 0;

    for (auto it = edges.begin(); it != edges.end(); it++) {
        pair<int, int> a = Find(get<0>(*it)), b = Find(get<1>(*it));
        if (a != b) {
            Unite(a, b);
            answer += get<2>(*it);
        }
    }

    cout << answer;

    return 0;
}


Measured memory_bytes: 14444
#include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

int N, M, K;
vector<int> A, B;

int main() {
  cin >> N >> M >> K;
  A.resize(N);
  B.resize(M);
  for (int i = 0; i < N; i++)
    cin >> A[i];
  for (int i = 0; i < M; i++)
    cin >> B[i];

  vector<long long int> Asum(N + 1);
  vector<long long int> Bsum(M + 1);
  Asum[0] = 0;
  for (int i = 1; i <= N; i++)
    Asum[i] = A[i - 1] + Asum[i - 1];
  Bsum[0] = 0;
  for (int i = 1; i <= M; i++)
    Bsum[i] = B[i - 1] + Bsum[i - 1];

  int res = 0;
  for (int i = 0; i <= N; i++) {
    if (Asum[i] > K) {
      break;
    }

    long long int rest = K - Asum[i];
    auto it = upper_bound(Bsum.cbegin(), Bsum.cend(), rest);
    int tmp = i + distance(Bsum.cbegin(), it) - 1;
    if (tmp > res)
      res = tmp;
  }
  cout << res << endl;

  return 0;
}


Measured memory_bytes: 8008
#include<bits/stdc++.h>
#define int long long
#define endl "\n"
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);

using namespace std;

const int N = 1e6+7;
string s;

int32_t main()
{
	fast;

	cin>>s;
	if(s[0]==s[1]||s[1]==s[2]||s[2]==s[3])
		cout<<"Bad";
	else
		cout<<"Good";
	return 0;
}

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

using ll = long long;
using namespace std;
const int INFint = 2e9+1;
const ll INFll = 2e18+1;
ll MOD=1e9+7;

ll gcd(ll a, ll b) { return __gcd(a,b); } //最大公約数
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; } //最小公倍数

int main() {
  int cnt[5] = {0};
  for(int i(0);i<3;i++){
    int a,b;
    cin>>a>>b;
    cnt[a]++;
    cnt[b]++;
  }
  int cnt1(0),cnt2(0);
  for(int i(0);i<5;i++){
    if(cnt[i] == 1) cnt1++;
    if(cnt[i] == 2) cnt2++;
  }
  //cout << cnt1 << " " << cnt2 << endl;
  if(cnt1 == 2 && cnt2 == 2){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 256