akhauriyash/Code-Regression huggingface dataset:
# -*- coding: utf-8 -*-
C=input()
anslist=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
ans=anslist.index(C)
print(anslist[ans+1])

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0;i<int(n);++i)
using namespace std;
template<class A>void p(A a){cout << (a) << endl;}
template<class A,class B>void p(A a,B b){cout << a << " "  ;p(b);}
template<class A,class B,class C>void p(A a,B b,C c){cout << a << " " ;p(b,c);}
template<class A,class B,class C,class D>void p(A a,B b,C c,D d){cout << a << " " ;p(b,c,d);}
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
int INF=numeric_limits<int>::max();
// for copy
// for(int i=0;i<N;++i) {

int main(void) {
  int N,X,Y;cin>>N>>X>>Y;
  int G[N+10][N+10];
  REP(i,N) {
    int start = 0;
    for(int j=i+1;j<N;++j) {
      start++;
      G[i][j] = start;
    }
  }

  REP(i,N) {
    for(int j=i+1;j<N;++j) {
      int another_route = abs(X-(i+1)) + abs(Y-(j+1)) + 1;
      G[i][j]=min(G[i][j],another_route);
    }
  }

  int Res[N-1] = {};
  REP(i,N) {
    for(int j=i+1;j<N;++j) {
      Res[G[i][j]-1]+=1;
    }
  }
  REP(i,N-1) {
    p(Res[i]);
  }
  return 0;
}



Measured memory_bytes: 15872
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repA(i,a,b) for(int i=a;i<=b;i++)
#define repD(i,b,a) for(int i=b;i>=a;i--)
#define fill(a,val) memset(a,val,sizeof(a))
#define f first
#define s second
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
int main()
{
    ll n,d;
    cin>>n>>d;
    d*=d;
    int cnt=0;
    rep(i,0,n)
    {
        ll x,y;
        cin>>x>>y;
        ll dist = x*x+y*y;
        if(dist<=d)
            cnt++;
    }
    cout<<cnt<<endl;
}

Measured memory_bytes: 3640
// includes {{{
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<random>
#include<cassert>
// }}}
// #include<bits/stdc++.h>
using namespace std;
using ll = long long;

/// --- Union Find Library {{{ ///

struct UF {
  int n;
  vector< int > par;
  UF(int n) : n(n), par(n, -1) {}
  int find(int x) { return par[x] < 0 ? x : par[x] = find(par[x]); }
  int size(int x) { return -par[find(x)]; }
  bool same(int a, int b) { return find(a) == find(b); }
  void unite(int a, int b) {
    a = find(a);
    b = find(b);
    if(a == b) return;
    if(par[a] < par[b]) swap(a, b);
    par[b] += par[a];
    par[a] = b;
  }
};

/// }}}--- ///

const int N = 3e5;

const ll mod = 998244353;

// ufはいらないと思うが楽
int main() {
  std::ios::sync_with_stdio(false), std::cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; i++) cin >> a[i];
  vector<int> cnt(n + 1), last(n + 1), ecas(n + 1);
  for(int i = 0; i < n; i++) cnt[a[i]]++;
  for(int i = 0; i < n-1; i++) {
    if(a[i] != a[i+1]) last[a[i]] = i, ecas[a[i]]++;
  }
  if(a[n-1] != a[0]) last[a[n-1]] = n-1, ecas[a[n-1]]++;
  for(int i = 1; i <= n; i++) if(ecas[i] >= 2) return cout << 0 << endl, 0;
  vector<pair<int, int>> v;
  for(int i = 2; i <= n; i++) if(cnt[i]) {
    last[i] += n - last[1] - 1;
    if(last[i] >= n) last[i] -= n;
    v.emplace_back(last[i], i);
  }
  int k = n - cnt[1];
  int x = cnt[1];
  if(x == n) {
    ll mochi = 1;
    for(int i = 2; i <= n; i++) mochi = mochi * i % mod;
    cout << mochi << endl;
    return 0;
  }
  int tapris = v.size();
  sort((v).begin(), (v).end());
  vector<int> rnk(n + 1);
  vector<int> used(n + 1);
  for(int i = 0; i < v.size(); i++) rnk[v[i].second] = i;
  UF uf(tapris);
  vector<pair<int, int>> uku(tapris);

  ll ans = 1;
  ll free = 0;
  for(int i = 2; i <= n; i++) {
    if(cnt[i]) {
      int qina = x - cnt[i] + 1;
      if(qina <= 0) return cout << 0 << endl, 0;
      int p = rnk[i];
      used[p] = 1;
      int ecas = cnt[i];
      if(p - 1 >= 0){ 
        if(used[p - 1]) {
          int s, t;
          tie(s, t) = uku[uf.find(p - 1)];
          free -= t;
          ecas += s;
          uf.unite(p - 1, p);
        } else {
          qina = 1;
        }
      }
      if(p + 1 < tapris) {
        if(used[p + 1]) {
          int s, t;
          tie(s, t) = uku[uf.find(p + 1)];
          free -= t;
          ecas += s;
          uf.unite(p + 1, p);
        } else {
          qina = 1;
        }
      }
      int noel;
      if(uf.same(p, tapris - 1) || uf.same(p, 0)) {
        noel = ecas;
      } else {
        noel = max(ecas - (x - 1), 0);
      }
      if(noel <= 0) return cout << 0 << endl, 0;
      uku[uf.find(p)] = make_pair(ecas, noel);
      free += noel;

      ans = ans * qina % mod;
    } else {
      int cap;
      if(free == k) {
        cap = n - 1 - (i - 2);
      } else {
        cap = free - (i - 2);
      }
      if(cap <= 0) return cout << 0 << endl, 0;
      ans = ans * cap % mod;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 14700
#include<iostream>
#include<string.h>
#include<algorithm>
#define loop(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,b) loop(i,0,b)
using namespace std;
int main(){
    string A[36]={},B[36]={};
    int N,minj;
    int flag=1;
    cin>>N;
    rep(i,N){
        cin>>A[i];
        B[i]=A[i];
    }
    rep(i,N-1){
        for(int j=N-1;j>i;j--){
            if(int(A[j][1])<int(A[j-1][1])){
                swap(A[j],A[j-1]);
            }
        }
    }
    rep(i,N-1){
        minj=i;
        loop(j,i,N){
            if(int(B[j][1])<int(B[minj][1])){
                minj=j;
            }
        }
        if(minj !=i)swap(B[i],B[minj]);
    }
    rep(i,N){
        if(i==0)cout<<A[i];
        else cout<<" "<<A[i];
    }
    cout<<endl<<"Stable"<<endl;
    rep(i,N){
        if(i==0)cout<<B[i];
        else cout<<" "<<B[i];
    }
    rep(i,N){
        if(A[i]!=B[i]){
            flag=0;
            break;
        }
    }
    if(flag==0){
        cout<<endl<<"Not stable"<<endl;
    }
    else cout<<endl<<"Stable"<<endl;
}


Measured memory_bytes: 3216
#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
#define pb(a) push_back(a)
#define pr(a) cout<<(a)<<endl
#define PR(a,b) cout<<(a)<<" "<<(b)<<endl
#define F first
#define S second
#define ll long long
bool check(int n,int m,int x,int y){return (x<0||x>=n||y<0||y>=m)?false:true;}
const ll MAX=1000000007,MAXL=1LL<<60,dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
typedef pair<int,int> P;

int main() {
  int n,q;
  while(cin >> n >> q && (n||q)) {
    set<int> a[n];
    rep(i,n) {
      int m;
      cin >> m;
      rep(j,m) {
	int x;
	cin >> x ;
	a[i].insert(x);
      }
    }
    int M=0,ans=0;
    rep(i,101) {
      int cnt=0;
      rep(j,n) cnt+=a[j].count(i)?1:0;
      if(cnt>=q && cnt>M) {
	M=cnt;
	ans=i;
      }
    }
    pr(ans);
  }
  return 0;
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
using P = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef vector<ll> vi;
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
  ll n, m;
  cin >> n >> m;
  print((n - 1) * (m - 1));
}

Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <math.h> // sqrt
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <iomanip> // setprecision
#include <bitset> // bitset
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vb = vector<bool>;
using vll = vector<long long>;
using pii = pair<int, int>;
using psi = pair<string, int>;

int main() {
    int N;
    cin >> N;
    vector<string> data(N, " ");
    for (int i = 0; i < N; i++) {
        cin >> data[i];
    }
    vll march(5, 0);
    for (string s : data) {
        if (s[0] == 'M') {
            march[0]++;
        }
        else if (s[0] == 'A') {
            march[1]++;
        }
        else if (s[0] == 'R') {
            march[2]++;
        }
        else if (s[0] == 'C') {
            march[3]++;
        }
        else if (s[0] == 'H') {
            march[4]++;
        }
    }
    ll ans = 0;
    for (int i = 0; i < 3; i++) {
        for (int j = i + 1; j < 4; j++) {
            for (int k = j + 1; k < 5; k++) {
                ans += march[i] * march[j] * march[k];
            }
        }
    }
    cout << ans << endl;
}


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

int n;
long long x[1005], y[1005];
string s[1005];
long long d[40];
int tot = 0;

int main() {
	ios_base::sync_with_stdio(false);
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> x[i] >> y[i];
	}
	if ((x[1] & 1) == (y[1] & 1)) {
		d[++tot] = 1;
		for (int i = 1; i <= n; ++i) {
			s[i] += 'U';
			y[i]--;
		}
	}
	long long len = 1;
	while (len < (1LL << 33)) {
		d[++tot] = len;
		for (int i = 1; i <= n; ++i) {
			if ((x[i] & 1) == (y[i] & 1)) {
				return cout << -1 << '\n',0;
			}
			if (x[i] & 1) {
				if (((x[i] - 1) & 2) != (y[i] & 2)) {
					x[i]--;
					s[i] += 'R';
				}
				else {
					x[i]++;
					s[i] += 'L';
				}
			}
			else {
				if (((y[i] - 1) & 2) != (x[i] & 2)) {
					y[i]--;
					s[i] += 'U';
				} 
				else {
					y[i]++;
					s[i] += 'D';
				}
			}
			x[i] >>= 1;
			y[i] >>= 1;
		}
		len <<= 1;
	}
	d[++tot] = len;
	for (int i = 1; i <= n; ++i) {
		s[i] += (x[i] == 1 ? 'R' : (x[i] == -1 ? 'L' : (y[i] == 1 ? 'U' : 'D')));
	}
	cout << tot << '\n';
	for (int i = 1; i <= tot; ++i) cout << d[i] << ' '; 
	cout << '\n';
	for (int i = 1; i <= n; ++i) cout << s[i] << '\n';
}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main{
    public static void main(String[]args){
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();
        int area = a*b;
        int length = (a+b)*2;
        System.out.println(area+" "+length);
    }
}


Measured memory_bytes: 26172
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i = n;i >= 0;--i)
#define FOR(i,m,n) for(int i = m, i##_len=(n);i <i##_len; ++i)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}
const int INF = 1e9;
const ll LLINF = 1e16;

int main(void)
{
    int a,b,c;
    cin >> a >> b >> c;
    if(a+b+c >= 22){
        cout << "bust" << endl;
    }
    else{
        cout << "win" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
package main

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

func getScanner(fp io.Reader) *bufio.Scanner {
	sc := bufio.NewScanner(fp)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 500001), 500000)
	return sc
}

func getHugeScanner(fp io.Reader, size int) *bufio.Scanner {
	sc := bufio.NewScanner(fp)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, size), size)
	return sc
}

func getNextString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func getNextInt(sc *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(sc))
	return i
}

func getNextInt64(sc *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(sc), 10, 64)
	return i
}

func getNextFloat64(sc *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(sc), 64)
	return i
}

type Restaurant struct {
	no int
	city string
	score int
}

type Restaurants []Restaurant

func (p Restaurants)Len() int {
	return len(p)
}

func (p Restaurants)Less(i, j int) bool {
	cmp := strings.Compare(p[i].city, p[j].city)
	if cmp == 0 {
		return p[i].score > p[j].score
	}
	return cmp < 0
}

func (p Restaurants)Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func Solve(stdin io.Reader, stdout io.Writer) {
	sc := getScanner(stdin)
	n := getNextInt(sc)

	restaurants := make(Restaurants, n)

	for i := 0; i < n; i++ {
		restaurants[i].no = i + 1
		restaurants[i].city = getNextString(sc)
		restaurants[i].score = getNextInt(sc)
	}

	sort.Sort(restaurants)

	for _, v := range restaurants {
		_, _ = fmt.Fprintf(stdout, "%v\n", v.no)
	}

}

func main() {
	Solve(os.Stdin, os.Stdout)
	return
}

Measured memory_bytes: 640
#include <cmath>
#include <iostream>

using namespace std;

#define EPS 1e-10
#define equals(a, b) (fabs((a) - (b)) < EPS)

class Point {
public:
  double x, y;
  Point() {};
  Point(double x, double y): x(x), y(y) {}

  Point operator + (const Point &p) { return Point(x + p.x, y + p.y); }
  Point operator - (const Point &p) { return Point(x - p.x, y - p.y); }
  Point operator * (double d) { return Point(d * x, d * y); }
  Point operator / (double d) { return Point(d / x, d / y); }

  bool operator < (const Point &p) const {
    return (x == p.x ? y < p.y : x < p.x);
  }

  bool operator == (const Point &p) const {
    return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
  }

  friend ostream& operator << (ostream &os, Point &p) {
    return os << "Point(" << p.x << ", " << p.y << ")";
  }
};

struct Segment {
  Point p0, p1;
};

double cross (Point p1, Point p2) {
  return p1.x * p2.y - p1.y * p2.x;
}

double dot(Point p1, Point p2) {
  return p1.x * p2.x + p1.y * p2.y;
}

double norm(Point p) {
  return p.x * p.x + p.y * p.y;
}

string ccw(Segment s, Point p2) {
  if (cross(s.p1 - s.p0, p2 - s.p0) > 0) return "COUNTER_CLOCKWISE";
  if (cross(s.p1 - s.p0, p2- s.p0) < 0) return "CLOCKWISE";
  if (dot(s.p1 - s.p0, p2 - s.p0) < 0) return "ONLINE_BACK";
  if (norm(s.p1 - s.p0) < norm(p2 - s.p0)) return "ONLINE_FRONT";
  return "ON_SEGMENT";
}

int main() {
  int x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;

  Segment s;
  s.p0 = Point(x1, y1);
  s.p1 = Point(x2, y2);

  int n; cin >> n;

  while (n--) {
    int x, y; cin >> x >> y;
    Point p2(x, y);

    cout << ccw(s, p2) << endl;
  }
}

Measured memory_bytes: 1192
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  map<map<char,int>,int> a;
  for(int i=0;i<n;i++){
    string s;
    cin>>s;
    map<char,int> w;
    for(int j=0;j<s.size();j++)
      w[s.at(j)]++;
    a[w]++;
  }
  int64_t c=0;
  for(auto w:a)
    c+=(int64_t)w.second*(w.second-1)/2;
  cout<<c<<endl;
}

Measured memory_bytes: 49152
#include <iostream>
    #include <math.h>
    #include <vector>
    #include <string>
    #include <cstdlib>
    #include <cmath>
    #include <algorithm>
    using namespace std;
 
int main() {
    int N,M;cin>>N>>M;
    vector<pair<int,int>> v(N);
    for(int i = 0;i < N;i++){
        int a;
        int b;
        cin>>a>>b;
        v[i] = make_pair(a,b);
    }
    sort(v.begin(),v.end());
//    for(int p=0;p<v.size();p++){
  //      cout <<"price "<<v[p].first <<"stocks "<<v[p].second<<endl;
    //}
    long int sum=0;
    int num=0;
    for(int i=0;i<N;i++){
        for(int j=0; j < v[i].second; j++){
            num++;
            sum+=v[i].first;
            if(num == M){
                cout<<sum<<endl;
                return 0;
            }
        }
    }
}

Measured memory_bytes: 1024
mod = 1000000007
eps = 10**-9


def main():
    import sys
    from itertools import accumulate
    input = sys.stdin.readline

    # O(NlogN)
    # return suffix array and lcp array
    # 0th index of SA is |S|
    def SuffixArray(S):
        S = S + "$"
        N = len(S)
        LV = N.bit_length()

        # 0th sort
        P = []
        C = [0] * N
        cnt = [[] for _ in range(256)]
        for i, s in enumerate(S):
            cnt[ord(s)].append(i)
        cnt_c = 0
        for i_list in cnt:
            for i in i_list:
                P.append(i)
                C[i] = cnt_c
            if i_list:
                cnt_c += 1

        # doubling
        for k in range(LV):
            C_new = [0] * N
            cnt = [0] * N
            k2 = 1 << k
            for i in range(N):
                p = P[i] - k2
                if p < 0:
                    p += N
                cnt[C[p]] += 1
                P[i] = p
            cnt = list(accumulate(cnt))
            P_new = [0] * N
            for i in range(N-1, -1, -1):
                p = P[i]
                c = C[p]
                P_new[cnt[c] - 1] = p
                cnt[c] -= 1
            cnt_c = -1
            prev = None
            for p in P_new:
                p_ = p + k2
                if p_ >= N:
                    p_ -= N
                new = C[p] * N + C[p_]
                if new != prev:
                    cnt_c += 1
                    prev = new
                C_new[p] = cnt_c
            C = C_new
            P = P_new

        # lcp
        rank = [0] * N
        for i in range(N):
            rank[P[i]] = i
        LCP = [0] * (N - 1)
        h = 0
        for i in range(N - 1):
            j = P[rank[i] - 1]
            if h > 0:
                h -= 1
            while i + h < N and j + h < N:
                if S[i + h] == S[j + h]:
                    h += 1
                else:
                    break
            LCP[rank[i] - 1] = h

        return P, LCP

    S = input().rstrip('\n')
    N = len(S)
    SA, LCP = SuffixArray(S)
    print(N * (N+1) // 2 - sum(LCP))


if __name__ == '__main__':
    main()


Measured memory_bytes: 189968
import java.io.*;
import java.util.*;

public class Main {

	void submit() {
		String s = nextToken();

		int x0 = 0, y0 = 0, x1 = 0, y1 = 0;

		boolean noT = true;
		boolean goX = true;
		int streak = 0;

		List<Integer> lx = new ArrayList<>();
		List<Integer> ly = new ArrayList<>();

		int decX = 0;

		s += "T";

		for (char c : s.toCharArray()) {
			if (c == 'F') {
				streak++;
			} else {
				if (streak != 0) {
					if (noT) {
						decX = streak;
					} else if (goX) {
						lx.add(streak);
					} else {
						ly.add(streak);
					}
				}

				streak = 0;
				goX = !goX;
				noT = false;
			}
		}

		int toX = nextInt();
		int toY = nextInt();

		toX -= decX;

		out.println(can(toX, lx) && can(toY, ly) ? "Yes" : "No");
	}

	boolean can(int goal, List<Integer> delta) {
		// System.err.println(goal + " " + delta);
		HashSet<Integer> can = new HashSet<>();
		can.add(0);
		for (int l : delta) {
			HashSet<Integer> nxt = new HashSet<>();
			for (int was : can) {
				nxt.add(was - l);
				nxt.add(was + l);
			}
			can = nxt;
		}
		return can.contains(goal);
	}

	void preCalc() {

	}

	void stress() {

	}

	void test() {

	}

	Main() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		preCalc();
		submit();
		// stress();
		// test();
		out.close();
	}

	static final Random rng = new Random();

	static int rand(int l, int r) {
		return l + rng.nextInt(r - l + 1);
	}

	public static void main(String[] args) throws IOException {
		new Main();
	}

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}

	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

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

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

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


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

int main() {
    string s; cin >> s;
    int flag = 0;
    for(char x: s)
        if(x == '7'){
            flag = 1;
            break;
        }
    if(flag) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3596
#include <iostream>
#include <algorithm>
#include <stack>
#include <map>
#include <math.h>
#include <vector>
#include <cctype>
using namespace std;

int main() {

	int a, b;
	cin >> a >> b;
	if(a%b != 0){
		cout << 1;
	}else{
		cout << 0;
	}
}


Measured memory_bytes: 256
import Control.Monad
import Control.Applicative
import Data.Functor
import Data.Monoid
import Data.Maybe
import Data.List
import Data.Foldable (foldMap)
import Data.List.Split
import Data.Char
import Data.Ratio
import Data.Ord
import Data.Array.IO

readInt = read :: String -> Int
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
-- end of templete

affine a b c
  | isAsciiLower c = chr $ mod (a * (ord c - ord 'a') + b) 26 + ord 'a'
  | otherwise = c

unaffine a b c
  | isAsciiLower c = head [x | x <- ['a'..'z'], affine a b x == c]
  | otherwise = c

  
findAffine s = fromJust $ find (\t -> isInfixOf "that" t || isInfixOf "this" t)  [flip map s $ unaffine a b | a <- [1..25], b <- [0..25], mod a 2 /= 0, mod a 13 /= 0]

main = do
    getInt >>= flip replicateM getLine >>= mapM_ (putStrLn . findAffine)

Measured memory_bytes: 5144
#include <iostream>
#include <cstring>

char a[105];
char b[105];
char c[105];
int main(){
    int t;
    std::cin >> t;
    std::cin >> a >> b >> c;
    int cnt = 0;
    for(int i = 0 ; i < t; i++){
        if (a[i] == b[i] && b[i] == c[i]) continue; 
        else if (a[i] == b[i] && b[i] != c[i]) cnt++;
        else if (b[i] == c[i] && a[i] != b[i]) cnt++;
        else if (c[i] == a[i] && a[i] != b[i]) cnt++;
        else cnt+= 2;
    }
    std::cout << cnt;
}

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

#define FOR(i, b, e) for(ll i = (ll)(b); i < (ll)(e); ++i)
#define RFOR(i, b, e) for(ll i = (ll)(e-1); i >= (ll)(b); --i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define REPC(x,c) for(const auto& x:(c))
#define VS vector<string>
#define VL vector<long long>
#define VI vector<int>
#define VVI vector<vector<int>>
#define VVL vector<vector<ll>>
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort(ALL(x))
#define RSORT(x) sort((x).rbegin(),(x).rend())
#define PAIR pair<ll,ll>
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

using  ll = long long;
constexpr ll MOD = 1000000007;
using std::cout;
using std::endl;
using std::cin;
using std::sort;
using std::pair;
using std::string;
using std::stack;
using std::queue;
using std::vector;
using std::list;
using std::map;
using std::unordered_map;
using std::multimap;
using std::unordered_multimap;
using std::set;
using std::unordered_set;
using std::multiset;

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll pow(ll a, ll b) {
	ll ans = 1;
	while (b > 0) {
		if (b % 2 == 1) {
			ans *= a;
			ans %= MOD;
		}
		b /= 2;
		a *= a;
		a %= MOD;
	}
	return ans;
}
ll comb(ll a, ll b) {
	if (a - b < b) { return comb(a, a - b); }
	static unordered_map<ll, ll> memo;

	ll c = 1;
	FOR(i, a - b + 1, a + 1) {
		c *= i;
		c %= MOD;
	}
	if (memo.find(b) == memo.end()) {
		ll k = 1;
		FOR(i, 2, b + 1) {
			k *= i;
			k %= MOD;
		}
		memo[b] = pow(k, MOD - 2);
	}
	c *= memo[b];
	return c % MOD;
}
multiset<ll> prime_decomposition(ll n) {
	ll i = 2;
	multiset<ll> table{};
	while (i * i <= n) {
		while (n % i == 0) {
			n /= i;
			table.emplace(i);
		}
		++i;
	}
	if (n > 1) {
		table.emplace(n);
		return table;
	}
	return table;
}
/*
-- bit --
REP(i, (1 << n)) {
	REP(j, n) {
		cout << (1 & (i >> j));
	}
	cout << endl;
}
*/


int main() {
	ll n, k;
	cin >> n >> k;
	if (n * 2 > k) {
		cout << k / 2 << endl;
	} else {
		cout << n + (k-2*n) / 4 << endl;
	}
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val inputList = readLine()!!.split(' ').map(String::toInt)
    val map = mutableMapOf<Int, Int>()
    inputList.forEach {
        if (map.containsKey(it)) {
            map[it] = map[it]!! + 1
        } else {
            map[it] = 1
        }
    }

    var maxSum = 0
    for (key in map.keys) {
        var sum = 0
        sum += map[key]!!
        if (map[key + 1] != null) sum += map[key + 1]!!
        if (map[key + 2] != null) sum += map[key + 2]!!
        maxSum = Math.max(maxSum, sum)
    }
    println(maxSum)
}


Measured memory_bytes: 61504
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int, int> pii;

inline bool valid(int x, int n) {
    return 0 <= x && x < n;
}

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

template <typename T>
inline T pop(queue<T>& q) {
    T front = q.front();
    q.pop();
    return front;
}

template <typename T>
inline T gcd(T a, T b) {
    for (; b; a %= b, swap(a, b));
    return a; 
}

template <typename T>
tuple<T, T, T> xgcd(T a, T b) {
    if (b == 0) return {1, 0, a};
    T x, y, g;
    tie(x, y, g) = xgcd(b, a%b);
    return {y, x-(a/b)*y, g};
}

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

    int A, B, M; cin >> A >> B >> M;
    int am = 1e5 + 5;
    vi a(A);
    for (int i = 0; i < A; i++) {
        cin >> a[i];
        am = min(am, a[i]);
    }

    int bm = 1e5 + 5;
    vi b(B);
    for (int i = 0; i < B; i++) {
        cin >> b[i];
        bm = min(bm, b[i]);
    }

    int rst = am + bm;
    for (int i = 0; i < M; i++) {
        int x, y, c; cin >> x >> y >> c;
        int sub = a[x-1] + b[y-1] - c;
        rst = min(rst, sub);
    }

    cout << rst;
}

Measured memory_bytes: 1024
# A, B = [int(i) for i in input().split(" ")]
# A = int(input())
# As = [int(i) for i in input().split(" ")]
# Ss = ["".join(sorted(input())) for _ in range(N)]
# from math import factorial
# def nCr(n, r): return factorial(n) // factorial(r) // factorial(n - r)

N = int(input())
Vs = [int(i) for i in input().split(" ")]
Vs.sort()
ans = (Vs[0] + Vs[1]) / 2
for v in Vs[2:]:
    ans = (ans + v) / 2
print(ans)


Measured memory_bytes: 2940
#include<stdio.h>
void printRectangle(int,int);
int main(void)
{
  int w,h;
  for(;;)
    {
      scanf("%d%d",&h,&w);
      if(h==0&&w==0) break;
      printRectangle(h,w);

    }
  return 0;
}
void printRectangle(int h,int w)
{
  int i,j;
  for(i=0;i<h;i++)
    {
      for(j=0;j<w;j++)
        {
          printf("#");
        }
      printf("\n");
    }
  printf("\n");
}



Measured memory_bytes: 2060
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<ll>;
using VV = vector<VI>;
using VS = vector<string>;

// tourist set
template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << '\n'; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
// tourist set end

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

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,b) FOR(i, 0, b)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<'\n'
#define p2(s, t) cout << (s) << " " << (t) << '\n'
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << '\n'
#define p_yes() p("YES")
#define p_no() p("NO")
#define SZ(x) ((int)(x).size())
#define SORT(A) sort(ALL(A))
#define RSORT(A) sort(ALL(A), greater<ll>())

void no(){p_no(); exit(0);}
void yes(){p_yes(); exit(0);}

const ll mod = 1e9 + 7;
const ll inf = 1e18;

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

    // input
    ll N, A, B;
    cin >> N >> A >> B;

    VI X(N);
    rep(i, N){
        cin >> X.at(i);
    }

    ll sum = 0;
    rep(i, N-1){
      ll diff = X[i+1] - X[i];
      ll cost = min(A*diff, B);
      sum += cost;
    }
    p(sum);
    
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>

using namespace std ;

int main(void){
    int N,ans=0;
    int a[3000];

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

    for(int i=0; i<N; i++) ans += a[i]-1;

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
data = [int(input()) for i in range(5)]
data.sort(key = lambda x : x % 10)
data_rev = []
first_10multiple = True
for d in data:
    if d % 10 == 0:
        data_rev.append(d)
    elif first_10multiple == True:
        data_rev.append(d)
        first_10multiple = False
    else:
        data_rev.append(d + 10 - d % 10)
print(sum(data_rev))

Measured memory_bytes: 3060
arr = input().split()
arr = list(map(int,arr))
a = arr[0]
b = arr[1]
c = arr[2]

flag = False
for k in range(a,b*a+1):
    if (k*a) % b == c:
        flag = True

if flag == True:
    print('YES')
else:
    print('NO')


Measured memory_bytes: 3060
import java.util.Scanner;
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=a-b;

	if(c>0){ System.out.println( "a > b" ); }
	if(c<0){ System.out.println( "a < b" ); }
	if(c==0){ System.out.println( "a == b" ); }

	
    }

}

Measured memory_bytes: 26000
using System;
using System.Linq;

namespace ConsoleApp1
{

    class Program
    {

        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int a = input[0];
            int b = input[1];

            bool res = false;

            for (int i = a; i <= b; i++)
                if (i % k == 0)
                {
                    res = true;
                    break;
                }

            if (res)
                Console.WriteLine("OK");
            else
                Console.WriteLine("NG");

        }

    }
}



Measured memory_bytes: 28140
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
using namespace std;
using Int = unsigned long long;
typedef pair<int,int> P; typedef pair<Int,Int> Pl;
static int const mod = 1e9+7;
#define END {cout<<(ans)<<'\n'; return 0;}
#define ALL(vec) vec.begin(),vec.end()
#define Pr(type) priority_queue<type>
#define gPr(type) priority_queue<type,vector<type>,greater<type>>
#define V(type) vector<type>
#define rep(i,n) for(int i=0; i<n; i++)
#define rer(i,s,n) for(int i=s; i<=n; i++)
#define gnr(i,l,r) for(int i=r; i>=l; i--)
#define eb emplace_back
#define fi first
#define se second
#define pri1(a) cout<<(a)<<'\n'
#define pri2(a,n) rep(i,(n)-1)cout<<a[i]<<' '; if(n)cout<<a[(n)-1]<<'\n';
#define prip(p) cout<<(p).first<<' '<<(p).second<<'\n'
template<class T> inline bool cmin(T& a, T b) { if (a > b) { return a = b; } return false; }
template<class T> inline bool cmax(T& a, T b) { if (a < b) { return a = b; } return false; }

Int n,m,q,_,x,y;
string s,sb;
bool ok;
char ch;

void merge(vector<int> &vec,int l,int mid,int r){
  int ll=mid-l,rl=r-mid; V(int)la(ll+1,mod),ra(rl+1,mod);
  rep(i,ll)la[i]=vec[l+i];
  rep(i,rl)ra[i]=vec[mid+i];
  int i=0,j=0;
  rer(k,l,r-1){
    x++;
    if(la[i]<=ra[j]){
      vec[k]=la[i];
      i+=1;
    }else{
      vec[k]=ra[j];
      j+=1;
    }
  }
}

void mergeSort(vector<int> &vec,int l,int r){
  if(l+1<r){
  int mid=(l+r)/2;
  mergeSort(vec,l,mid);
  mergeSort(vec,mid,r);
  merge(vec,l,mid,r);}
  return;
}

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

  cin>>n; V(int) a(n); rep(i,n)cin>>a[i];
  mergeSort(a,0,n);
  pri2(a,n);
  pri1(x);
}


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

#define ll long long int

int main()
{
    string str,btr;

    cin>>str>>btr;
    int len=str.length();
    int lenb=btr.length();

    int mx=1e9+100;

    for(int i=0;i+lenb-1<len;i++){
        int ct=0;
        for(int j=0;j<lenb;j++){
            if(str[i+j] != btr[j]) ++ct;
        }
        mx=min(mx, ct);
    }

    cout<<mx<<'\n';
}


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

int dice[120][6];
int i,j,k,t,clear=0;

int ue=1;
int hid=4;
int mig=3;
int mae=2;
int usi=5;
int sit=6;

void Move2(int j,int k);
void rndMove();
void eMove();
void nMove();
void sMove();
void wMove();

int main(){
	int n;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		for(j=0;j<6;j++){
			scanf("%d",&dice[i][j]);
		}
	}
	for(j=0;j<n-1;j++){
		for(k=j+1;k<n;k++){
			Move2(j,k);
		}
	}
	
	if(clear==1)printf("No\n");
	else printf("Yes\n");
	
	return 0;
}

void Move2(j,k){
	for(i=0;i<100;i++){
		rndMove();
		
		if((dice[j][0]==dice[k][ue-1])&&(dice[j][1]==dice[k][mae-1])&&
			(dice[j][2]==dice[k][mig-1])&&(dice[j][3]==dice[k][hid-1])&&
			(dice[j][4]==dice[k][usi-1])&&(dice[j][5]==dice[k][sit-1])){
			clear=1;
			break;
		}
	}
	return;
}

void rndMove(){
	int rnd=rand()%4;
		
	if(rnd==0)eMove();
	else if(rnd==1)nMove();
	else if(rnd==2)sMove();
	else wMove();
	
	return;
}

void eMove(){
	t=ue;
	ue=hid;
	hid=sit;
	sit=mig;
	mig=t;
	return;
}

void nMove(){
	t=ue;
	ue=mae;
	mae=sit;
	sit=usi;
	usi=t;
	return;
}

void sMove(){
	t=ue;
	ue=usi;
	usi=sit;
	sit=mae;
	mae=t;
	return;
}

void wMove(){
	t=ue;
	ue=mig;
	mig=sit;
	sit=hid;
	hid=t;
	return;
}



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

	
int main(){
	string s,t;
	cin >> s;
  	cin >> t;
	auto m = vector<int>('z'-'a'+1,-1);
  	auto m1 = vector<int>('z'-'a'+1,-1);
 
	bool flag = true;
  	for (int i = 0; i < s.size(); i++)
	{
      	if(m[s[i]-'a']<0){
        	m[s[i]-'a'] = t[i]-'a';
        }else{
        	if(	m[s[i]-'a'] != t[i]-'a'){
              cout << "No";
          	  flag = false;
              	break;
            }
        }
      	
      	if(m1[t[i]-'a']<0){
        	m1[t[i]-'a'] = s[i]-'a';
        }else{
        	if(	m1[t[i]-'a'] != s[i]-'a'){
              cout << "No";
          	  flag = false;
              	break;
            }
        }
    }
  
    if(flag){
      cout << "Yes";
    }
}


Measured memory_bytes: 776
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>
#include <climits>
#include <iterator>
#include <iomanip>
#include <stack>
#include <set>
#include <cstdio>
#include <bitset>
#include <functional>
#include <tuple>
using namespace std;
const int INF = 1e9;
//typedef std::pair<std::string,double> P;

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

typedef long long ll;
typedef vector<int> VI;
const  ll MOD = 1e9 + 7;

struct Less {
	bool operator()(const pair<int, int>& x, const pair<int, int>& y) const {
		return x.first > y.first;
	}
};
//グラフの隣接リスト
//VI g[200010];
//頂点の入次数を管理
int h[100010];

int g[101][101];

int a[25];
int dp[50100];
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n, m; cin >> n >> m;
	REP(i, m) cin >> a[i];

	REP(i, 50100) dp[i] = INF;

	dp[n] = 0;
	for (int i = n; i >= 0; --i) {
		for (int j = 0; j < m; ++j) {
			if (i - a[j] >= 0) dp[i - a[j]] = min(dp[i - a[j]], dp[i] + 1);
		}
	}
	cout << dp[0] << endl;
	return 0;
}


Measured memory_bytes: 3360
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define np next_permutation
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define pi acos(-1.0)
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
//cout << fixed << setprecision (20);   小数点以下2０桁まで
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'0'+=16;        で大文字に
//'大文字'+=32;    で小文字に
//s[i]-'0'でchar文字→int数に;
//string s = to_string(int数);
//int n = stoi(string文字列)
//実行時間制約2秒では２×10^8回くらいまで計算できる


int main() {
  ll n;
  cin >> n;
  
  ll ans = (1000000000000000000);
  for(ll i=2; i<=1000000;i++){
    if(n%i==0) {
      if(ans>i+n/i) ans=i+n/i;
    }
  }
  
  if(ans==1000000000000000000) cout << n-1 << endl;
  else cout << ans-2 << endl;
   
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int N=200010;
inline int gi() {
    int x=0,o=1;
    char ch=getchar();
    while(ch<'0'||ch>'9') ch=='-'?o=-1:0,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return o*x;
}
struct Dat {
    int x,y;
    inline bool operator < (const Dat &A) const {
	return y==A.y?x<A.x:y<A.y;
    }
} g[N];
int main() {
    int n,m,k,x=1,y=1,ans;
    cin>>n>>m>>k,ans=n;
    for(int i=1;i<=k;i++) g[i].x=gi(),g[i].y=gi();
    sort(g+1,g+1+k);
    for(int i=1,j=1;i<=m;i++) {
	if(j<=n&&g[j].y==i) ans=min(ans,g[j].x-1);
	++x;
	while(j<=n&&g[j].y==i) ++j;
	while(j<=n&&g[j].y==i+1&&g[j].x<x) ++j;
	while(j<=n&&g[j].y==i+1&&g[j].x==x) ++x,++j;
	if(x>=ans) break;
	++y;
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 1792
sub f{my$d=pop;
	$c[$_-1]||=$';
	if($d>$d[$_]&&$d>0){
		$d[$_]=$d;
		f($d-1)for@$_
	}
}
<>=~$";
@c=(0)x$`;
map{push@$_,$_[--$|]for@_=<>=~/\d+/g}1..$';
<>;
$_*=/ .* /,f$&for reverse<>;
print"@c"


Measured memory_bytes: 107392
# -*- coding: utf-8 -*-


from sys import stdin


############################################


# read data for n sequences.
n = stdin.readline().split()
a = int(n[0])
b = int(n[1])

#data = [int(stdin.readline().rstrip()) for _ in range(n)]

out = int((a*3+b) / 2)

print(out)

#end = time.time()
#print(end-start)

Measured memory_bytes: 3064
# -*- coding: utf-8 -*-
import numpy as np

A, B, H, M = map(int, input().split())

rad_H = 2*np.pi*H/12 + 2*np.pi*M/12/60
rad_M = 2*np.pi*M/60


dif = rad_H - rad_M
if (np.abs(dif) > np.pi):
    dif = 2*np.pi - dif


AB = A**2 + B**2 - 2*A*B*np.cos(abs(dif))


print('{:.12f}'.format(np.sqrt(AB)))

Measured memory_bytes: 27184
import java.util.*;
import java.util.stream.*;

class Main {
	Scanner sc;
	String S;
	int[] c;
	
	public Main() {
		sc = new Scanner(System.in);
	}
	
	private void calc() {
		S = sc.next();
		c = new int[S.length()];
		int i = 0;
		while (true) {
			int j = i;
			for (;j < S.length(); j++)
				if (S.charAt(j) == 'L') break;
			if (j == S.length()) break;
			for (int k = i; k < j; k++)
				c[j - (j-k)%2]++;
			i = j;
			for (j = i+1; j < S.length(); j++)
				if (S.charAt(j) == 'R') break;
			for (int k = i; k < j; k++)
				c[i - (k-i)%2]++;
			i = j;
		}
		out(IntStream.of(c)
					.mapToObj(n -> String.valueOf(n))
					.collect(Collectors.joining(" ")));
	}
	
	void out(Object o) {
		System.out.println(o);
		System.out.flush();
	}
	
	public static void main(String[] args) {
		Main m = new Main();
		m.calc();
	}

}

Measured memory_bytes: 33788
import java.util.*;
import java.math.*;
public class Main{

	static int INF = 2 << 27;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true) {
			int n = sc.nextInt();
			if(n == 0) break;
			int a[] = new int[n];
			int b[] = new int[n];
			int c[] = new int[n];
			int d[] = new int[n];
			for(int i = 0; i < n; i++) {
				a[i] = sc.nextInt();
				b[i] = sc.nextInt();
				c[i] = sc.nextInt()-1;
				d[i] = sc.nextInt()-1;
			}
			Data[] data = new Data[n];
			for(int i = 0; i < n; i++) {
				data[i] = new Data(a[i],b[i],c[i],d[i]);
			}
			int  start = 0;
			boolean[] use = new boolean[n];
			for(int i = 0; i < n; i++) {
				if(data[i].nextDataA != -1)
				use[data[i].nextDataA] = true;
				if(data[i].nextDataB != -1)
				use[data[i].nextDataB] = true;
			}
			for(int i = 0; i < n; i++) {
				if(!use[i]) {
					start = i;
					break;
				}
			}
			int ans = DFS(start,data);
			System.out.println(ans);
		}
	}
	static int DFS(int now, Data[] data) {
		int ACost = data[now].nextDataA == -1 ?1:DFS(data[now].nextDataA,data);
		int BCost = data[now].nextDataB == -1 ?1:DFS(data[now].nextDataB,data);
		int l = lcm(data[now].lenA * ACost, data[now].lenB * BCost);
		return l / data[now].lenA + l / data[now].lenB;
	}
	static class Data {
		int lenA;
		int lenB;
		int nextDataA;
		int nextDataB;
		Data(int a, int b, int c, int d) {
			lenA = a;
			lenB = b;
			nextDataA = c;
			nextDataB = d;
		}
	}
	static int gcd(int a, int b) {
		if(b == 0) return a;
		if(a < b) return gcd(b,a);
		return gcd(b,a % b);
		
	}
	static int lcm(int a,int b){
		  return a / gcd(a,b) * b;
		}
	
}

Measured memory_bytes: 32152
from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue
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 conb(n,r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n,m = inpl()
x = inpl()
x.sort()
dd = []
for i in range(m-1):
    dd.append(abs(x[i] - x[i+1]))
dd.sort()
s = 0
for i in range(m-n):
    s += dd[i]
print(s)

Measured memory_bytes: 15212
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int n;
vector<int> A;
int main(){
	int q ,a ,k=0;
	cin>>n;
	for(int i = 0;i<n;i++){
		cin>>a;
		A.push_back(a);
	}
	cin>>q;
	for(int i = 0;i<q;i++){
		cin>>a;
		if(binary_search(A.begin(), A.end(), a)) k++;
	}
	cout<<k<<endl;
	return 0;

}


Measured memory_bytes: 3436
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
int main() {
    int n,x;
    cin>>n>>x;
    if(x==1||x==n+n-1) return puts("No"),0;
    puts("Yes");
    for(int i=0;i<n+n-1;i++) printf("%d\n",(i+x+n-1)%(n+n-1)+1);
    return 0;
}

Measured memory_bytes: 1536
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int t[101];
int pri[26];
int res = 0;

void p756() {
	int N;
	cin >> N;
	pri[0] = 2;
	int pi = 1;
	for (size_t i = 3; i <= 100; i += 2)
	{
		bool isp = true;
		for (size_t j = 3; j < i; j++)
		{
			if (i % j == 0) {
				isp = false;
				break;
			}
		}
		if (isp) pri[pi++] = i;
	}

	t[1] = 1;
	for (size_t i = 2; i <= N; i++)
	{
		int ti = i;
		for (size_t j = 0; j < 25; j++)
		{
			while (ti % pri[j] == 0)
			{
				t[pri[j]]++;
				ti /= pri[j];
			}
		}
	}

	int dp[27][101];


	for (size_t i = 0; i < 101; i++)
	{
		dp[0][i] = -1;
	}
	ll res = 0;
	dp[0][1] = 1;

	for (size_t i = 0; i < 26; i++)
	{
		for (size_t j = 1; j < 101 ; j++)
		{
			dp[i + 1][j] = -1;
		}
		dp[i + 1][0] = dp[i][0];
		for (size_t j = 0; j <= t[pri[i]]; j++)
		{
			for (size_t k = 1; k <= 75; k++)
			{
				if (dp[i][k] == -1) continue;
				int next = dp[i][k];
				if (k * (j + 1) < 101) {

					if (dp[i + 1][k * (j + 1)] < 0) {
						dp[i + 1][k * (j + 1)] = 0;
					}
					dp[i + 1][k * (j + 1)] += next;

				}
			}
		}
	}
	if (dp[25][75] == -1) {
		cout << 0 << endl;
	}else
		cout << dp[25][75] << endl;
}
int main() {

	p756();
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define int long long
using namespace std;
const int MOD=1e9+7;
const int INF=1e10;

signed main(){
  int N,W;
  cin>>N>>W;
  vector<int> v(N+10),w(N+10);
  rep(i,N)cin>>v[i]>>w[i];

  vector<vector<int>> dp(N+10,vector<int>(10004,INF));

  dp[0][0]=0;

  rep(i,N+1){
    rep(j,10004){
      if(j-v[i]>=0)
        dp[i+1][j]=min(dp[i+1][j],dp[i][j-v[i]]+w[i]);
      dp[i+1][j]=min(dp[i+1][j],dp[i][j]);
    }
  }
  for(int j=10003;j>=0;j--){
    if(dp[N][j]<=W){
      cout<<j<<endl;
      return 0;
    }
  }

  return 0;
}



Measured memory_bytes: 11596