akhauriyash/Code-Regression huggingface dataset:
/* Author - xorier4104 */

#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>


using namespace std;

#define ll              long long int
#define ld              long double
#define db              double
#define pi              3.1415926535897932384626
#define PI              acos(-1.0)
#define endl            "\n"
#define mod             1000000007
#define MOD 			(int) 1e9+7
#define mk              make_pair
#define pb              push_back
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(t)            ll t; cin>>t; while(t--)
#define sc(a)	        scanf("%lld",&a);
#define pr(a)	        printf("%lld\n",a)
#define f(i,a,n)		for(ll i=a;i<n;i++)
#define m(a)		    memset(a,0,sizeof(a))
#define mem(a,b)        memset(a,(b),sizeof(a))
#define max(a,b)        ((a)>(b) ? (a):(b))
#define min(a,b)        ((a)<(b) ? (a):(b))
#define abs(a)          ((a)>0 ? (a):(-(a)))
#define sq(a) 			((a)*(a))
#define FastIO          ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)

int main(){ FastIO;
	
	int a,b;
	cin>>a>>b;
	cout<<6-a-b<<endl;
	
return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
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; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    cin.tie(0);
    ios::sync_with_stdio(false);<- これら、printfとかと併用しない方が良さそう

*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n==0) return 1;
    ll res=modpow(x, n/2);

    if(n%2==0) return res*res%mod;
    else return res*res%mod*x%mod;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };


// 線分 ab の偏角 返り値は[-π, π]
double argument(const pair<double, double> &a, const pair<double, double> &b){
    double ax=a.first, ay=a.second, bx=b.first, by=b.second;
    return atan2(by-ay, bx-ax);
}

/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */



// lcp[i] := S と S[i:S.size()] の最長共通接頭辞の長さを記録した LCP 配列を O(|S|) で計算する
// 0-indexed
vector<int> Zalgo(const string& S){
    int N=(int)S.size();
    vector<int> res(N);
    res[0]=N;
    int i=1, j=0;
    while(i<N){
        while(i+j<N && S[j]==S[j+i]) ++j;
        res[i]=j;
        if(j==0) {++i; continue;}
        int k=1;
        while(i+k<N && k+res[k]<j) res[i+k]=res[k], ++k;
        i += k, j -= k;
    }
    return res;
}

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

    
    int n; cin >> n;
    string s; cin >> s;
    int ans = 0;
    rep(i, n-1) {
        string t = s.substr(i);
        auto lcp = Zalgo(t);
        rep(j, t.size()) chmax(ans, min(lcp[j], j));
    }
    cout << ans << endl;


    return 0;
}


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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init));

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  ll a,b,c;
  cin >> n;
  if(n == 2){
    cin >> a >> b;
    ll s = gcd(a,b);
    REP(i,1,s+1){
      if( a % i == b % i && b % i == 0){
        cout << i << endl;
      }
    }
  }
  else{
    cin >> a >> b >> c;
    ll s = gcd(gcd(a,b),c);
    REP(i,1,s+1){
      if(a % i == b % i && b % i == c % i && c%i == 0){
        cout << i << endl;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 3140
#n=int(input())
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))


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


n,m=list(map(int,input().split()))
a=list(map(int,input().split()))
a.sort()
a.reverse()
t=sum(a)/(4*m)
for i in range(m):
    if a[i]<t:
        print("No")
        exit()

print("Yes")

Measured memory_bytes: 3060
import sys
input = sys.stdin.readline
def main():
  n,q=map(int,input().split())
  c=list(map(int,input().split()))
  lri=[list(map(int,input().split()))+[i] for i in range(q)]
  lri.sort(key=lambda x:x[1])
  
  class BIT:
      def __init__(self, n):
          self.n = n
          self.data = [0]*(n+1)
          self.el = [0]*(n+1)
      def sum(self, i):
          s = 0
          while i > 0:
              s += self.data[i]
              i -= i & -i
          return s
      def add(self, i, x):
          # assert i > 0
          self.el[i] += x
          while i <= self.n:
              self.data[i] += x
              i += i & -i
      def get(self, i, j=None):
          if j is None:
              return self.el[i]
          return self.sum(j) - self.sum(i)

  bt=BIT(n+1)
  dc={}
  ans=[0]*q
  j=0
  for i in range(n):
    x=c[i]
    if x in dc:
      bt.add(dc[x],-1)
    bt.add(i+1,1)
    dc[x]=i+1
    while j<q and i+1==lri[j][1]:
      l,r,k=lri[j]
      ans[k]=bt.get(l-1,r)
      j+=1
    if j==q:break
  print(*ans,sep='\n')


if __name__=='__main__':
  #import datetime
  #print(datetime.datetime.now())
  main()
  #print(datetime.datetime.now())


Measured memory_bytes: 260464
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 

using namespace std;

int main() {
	int i, j, n;
	
	cin >> n;


	if (n == 1) {
		cout << 1 << endl;
		return 0;
	}
	if (n == 2) {
		cout << 3 << endl;
		return 0;
	}



	long long a = 2,  b = 1;
	long long num = 0, num2 = 0;
	for (i = 0; i < n-1; i++) {
		num = b + a;
		num2 = num;
		a = b;
		b = num;
		

	}

	cout << num2 << endl;








	return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
from itertools import product
import numpy as np

def dist(p1, p2=np.zeros(2,)):
    return np.sqrt(((p1-p2)**2).sum())


def MD(P):
    c = (P[0]+P[1])/2
    r = dist(P[0], P[1])/2
    D = (c, r)
    for i in range(2,len(P)):
        if dist(D[0], P[i]) > D[1]:
            D = MDWP(P[:i], P[i])
    return D

def MDWP(P, q1):
    c = (P[0]+q1)/2
    r = dist(P[0], q1)/2
    D = (c, r)
    for i in range(1,len(P)):
        if dist(D[0], P[i]) > D[1]:
            D = MDWPs(P[:i], P[i], q1)
    return D

def MDWPs(P, q1, q2):
    c = (q1+q2)/2
    r = dist(q1, q2)/2
    D = (c, r)
    for i in range(0,len(P)):
        if dist(D[0], P[i]) > D[1]:
            D = Disk(q1, q2, P[i])
    return D

def Disk(q1, q2, q3):
    a, b = q1-q2
    c, d = q2-q3
    z = (q1**2).sum() - (q2**2).sum()
    w = (q2**2).sum() - (q3**2).sum()
    e = 2*(a*d-b*c)
    if e == 0:
        c = (q1+q2)/2
        r = dist(q1, q2)/2
        return (c, r)
    else:
        c = np.array([d*z-b*w, -c*z+a*w])/e
        r = dist(q1, c)
        return (c, r)



def solve():
    N = int(input())
    P = np.array([np.array(list(map(int, input().split()))) for _ in range(N)])
    D = MD(P)
    return str(D[1])

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

Measured memory_bytes: 12448
use std::cmp;
use std::collections::HashMap;
use std::collections::VecDeque;
use std::io::Read;
use std::usize::MAX;

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

fn solve() {
    input! {
        n: usize,
        sticks: [usize;n]
    }

    let mut sticks = sticks.clone();
    sticks.sort();

    let mut ans = 0;

    for i in 0..n - 1 {
        for j in i + 1..n - 1 {
            let sub = sticks[j] - sticks[i];
            let sum = sticks[j] + sticks[i];

            let a = binsearch(&sticks[j + 1..], sub);
            let b = binsearch(&sticks[j + 1..], sum);

            ans += b - a;
        }
    }

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

fn binsearch(v: &[usize], q: usize) -> usize {
    if v.is_empty() || q <= v[0] {
        return 0;
    }
    let mut min = 0;
    let mut max = v.len();
    while max - min > 1 {
        let mid = (min + max) / 2;
        if v[mid] < q {
            min = mid;
        } else {
            max = mid;
        }
    }
    max
}

fn main() {
    let thd = std::thread::Builder::new().stack_size(104_857_600);
    thd.spawn(|| solve()).unwrap().join().unwrap();

    /*
    // 入力を一括で読み込む場合
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    // inputに対しnext()で読み込んでいく
    let q: usize = input.next().unwrap().parse().unwrap();
    */
}

const LARGE_PRIME: u64 = 1_000_000_007;

// @〜でsnippet


Measured memory_bytes: 8572
import java.util.Scanner;
public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		String S=stdIn.next();
		if(S.equals("SUN"))
			System.out.println(7);
		if(S.equals("MON"))
			System.out.println(6);
		if(S.equals("TUE"))
			System.out.println(5);
		if(S.equals("WED"))
			System.out.println(4);
		if(S.equals("THU"))
			System.out.println(3);
		if(S.equals("FRI"))
			System.out.println(2);
		if(S.equals("SAT"))
			System.out.println(1);
	}
}


Measured memory_bytes: 21844
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define PI acos(-1)
#define fs first
#define sc second
#define MAX 0x3f3f3f3f
#define debug freopen("1.in", "r", stdin), freopen("1.out", "w", stdout);
#define ios                                                                    \
    ios::sync_with_stdio(false);                                               \
    cin.tie(0);                                                                \
    cout.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const ll maxn = 2e5 + 7;

int n;

int main() {
    cin >> n;
    if (n == 0)cout << 1 << '\n';
    else cout << '0' << '\n';

    return 0;
}

Measured memory_bytes: 3128
#include <bits/stdc++.h>
#define pb push_back
#define rep(i,n) for(ll i = 0;i < (n); ++i)
typedef long long ll;
typedef long double la;
using namespace std;

ll f(ll n){
    if(n%10 == 0) return n;
    else return f(n+1);
}

int main(){
    vector<int> v(5);
    vector<int> ans;
    ll count = 0, i = 0;
    rep(i,5){
        cin >> v[i];
    }
    do {
        ll sum = 0;
        rep(i,v.size()){
            if(v[i]%10 == 0){
                sum += v[i];
            }else{
                if(!(i==4)) sum += f(v[i]);
                else sum += v[i]; 
            }
        }
        ans.pb(sum);
    }while(next_permutation(v.begin(), v.end()));
    sort(ans.begin(),ans.end());
    cout << ans[0] << endl;
}

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

typedef long long int lli;
#define int lli
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<lli> vli;
typedef vector<pii> vii;

const int MOD   = 1e9 + 7;
const double PI = acos(-1.0);
const int xd[4] = {1, 0, -1, 0}, yd[4] = {0, 1, 0, -1};
const int INF   = 1e18;

#define fastio            ios_base::sync_with_stdio(false);cin.tie(0)
#define sz(a) int((a).size())
#define rsz resize
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define f first
#define s second
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define endl "\n"
#define spc " "
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template <typename T> T lcm(T a, T b){return (a*b)/gcd(a,b); }

void solve(){

    char c;
    cin >> c;
    if(c >= 'a' && c <= 'z'){
        cout << 'a' << endl;
    }else{
        cout << 'A' << endl;
    }

}

signed main(){
    fastio;

    solve();

    return 0;
}


Measured memory_bytes: 3532
h, w = map(int, input().split())
c = [list(map(int, input().split())) for _ in range(10)]
a = [list(map(int, input().split())) for _ in range(h)]
dp = [[10 ** 4 for _ in range(10)] for _ in range(10)]
for i in range(10):
    for j in range(10):
        for k in range(10):
            c[j][k] = min(c[j][k], c[j][i] + c[i][k])
b = [0] + [c[i][1] for i in range(10)]
ans = 0
for i in a:
    for j in i:
        ans += b[j + 1]
print(ans)

Measured memory_bytes: 3444
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,w;
  cin>>n>>w;
  int wt[n];
  long long pl[n];
  for(int i=0;i<n;i++){
    cin>>wt[i]>>pl[i];
  }
  long long dp[n+1][w+1];
  for(int i=0;i<=n;i++){
    dp[i][0]=0;
  }
  for(int i=0;i<=w;i++){
    dp[0][i]=0;
  }
  for(int i=1;i<=n;i++){
    for(int j=1;j<=w;j++){
      if(wt[i-1]>j){
	dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
      }else{
	dp[i][j]=max(dp[i-1][j-wt[i-1]]+pl[i-1],max(dp[i-1][j],dp[i][j-1]));
      }
    }
  }
  cout<<dp[n][w]<<endl;
  return(0);
}


Measured memory_bytes: 79104
/**
 *   created: 16 November 2019  10:01:14
**/
#include<bits/stdc++.h>
using namespace std;

typedef vector<int> vi;
typedef pair<int , int> pii;
typedef vector< pair<int , int> > vii;
typedef long long ll;
typedef vector<long long> vl;
typedef pair<long long , long long> pll;
typedef vector< pair<long long , long long> > vll;

#define PB push_back
#define PPB pop_back
#define all(c) c.begin(),c.end()
#define rep(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define rrep(i,a,b) for(int i = (int)(a-1); i>=(int)(b); i--)
#define INFLL 2000000000000000007
#define INF 2000000007
#define MOD 1000000007


#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif


void optimizeIO()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}

//                                        //AUTHOR: Kaushalesh Shukla

//=========================================================================================================

int main()
{
	optimizeIO();
	int tt=1;
	//cin>>tt;
	while(tt--){
		int n;
		cin>>n;
		vector<int> v(n);
		rep(i,0,n)
			cin>>v[i];
		int sum = 0;
		rep(i,0,n){
			rep(j,i+1,n){
				sum += v[i]*v[j];
			}
		}
		cout<<sum;
	}
	return 0;
}


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

using namespace std;

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

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  int H, W;
  cin >> H >> W;
  char A[H][W];
  REP(i, H) REP(j, W) cin >> A[i][j];
  int dist[H][W];
  REP(i, H) REP(j, W) dist[i][j] = -1;
  queue<P> que;
  REP(i, H) REP(j, W) {
    if (A[i][j] == '#') {
      que.push(P(i, j));
      dist[i][j] = 0;
    }
  }
  int dy[4] = {-1, 0, 1, 0};
  int dx[4] = {0, 1, 0, -1};
  while (que.size()) {
    P p = que.front();
    que.pop();
    REP(i, 4) {
      int ny = p.first + dy[i];
      int nx = p.second + dx[i];
      if (0 <= ny && ny < H && 0 <= nx && nx < W && dist[ny][nx] == -1) {
        que.push(P(ny, nx));
        dist[ny][nx] = dist[p.first][p.second] + 1;
      }
    }
  }
  int ans = 0;
  REP(i, H) REP(j, W) ans = max(ans, dist[i][j]);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 13328
// C - Shopping Street
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
#define rp(i,s,e) for(int i=(int)(s);i<(int)(e);++i)

int c(int i, int open_pattern, vvi &f){
	int ret = 0;
	rp(j, 0, 10)
		if(open_pattern>>j & 1)
			if(f[i][j]) ret++;
	return ret;
}

int main(){
	int n; cin>>n;
	vvi F(n, vi(10));
	rp(i, 0, n)rp(j, 0, 10) cin>>F[i][j];
	vvi P(n, vi(10+1));
	rp(i, 0, n)rp(j, 0, 10+1) cin>>P[i][j];

	int64_t ans = -10000000*100;
	rp(i, 1, 1<<10){
		int64_t s = 0;
		rp(j, 0, n){
			int cj = c(j, i, F);
			s += P[j][cj];
		}
		ans = max(ans, s);
	}
	cout<< ans <<endl;
}


Measured memory_bytes: 3632
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1000000009LL;
constexpr long long LINF = 1000100010001000100LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define rept(i, j, n) for(int i=(j); i<(n); i++)
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(){ 
    int n, k; cin >> n >> k;
    int num = 1, cnt = 0;
    while(num < n){
        num += k-1;
        cnt++;
    }
    cout << cnt << ln;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}

// get longest common subsequence, O(s.length() * t.length())
struct LCS {
    vvi dp;
    string s, t;
    LCS(string s, string t) : s(s), t(t) {
        dp.assign(s.size() + 1, vi(t.size() + 1, 0));
        for (int i = 1; i <= s.size(); ++i) {
            for (int j = 1; j <= t.size(); ++j) {
                if (s[i - 1] == t[j - 1]) {
                    dp[i][j] = dp[i - 1][j - 1] + 1;
                }
                chmax(dp[i][j], dp[i][j - 1]);
                chmax(dp[i][j], dp[i - 1][j]);
            }
        }
    }
    int length() { return dp[s.size()][t.size()]; }
    string restore() {
        string ret(length(), 'a');
        deque<char> temp;
        int sidx = s.size();
        int tidx = t.size();
        int retidx = length() - 1;
        while (sidx > 0 && tidx > 0) {
            if (s[sidx - 1] == t[tidx - 1]) {
                ret[retidx] = s[sidx - 1];
                --retidx;
                --sidx;
                --tidx;
            } else if (dp[sidx][tidx] == dp[sidx - 1][tidx])
                --sidx;
            else
                --tidx;
        }
        return ret;
    }
};

int main() {
    string s, t;
    cin >> s >> t;
    LCS lcs(s, t);
    cout << lcs.restore() << "\n";
    return 0;
}

Measured memory_bytes: 35584
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
using namespace std;
// 多倍長テンプレ
/* ---------------------- ここから ---------------------- */
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
/* ---------------------- ここまで ---------------------- */
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
int main() {
  int N,X,Y;
  cin >> N >> X >> Y;
  if(X*Y>=N){
    Yes();
  }
  else{
    No();
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 3628
N, M = list(map(int, input().split()))

L, R = [], []
for i in range(M):
    l, r = list(map(int, input().split()))
    L.append(l)
    R.append(r)

ans = min(R) - max(L) + 1
if ans >= 0:
    print(ans)
else:
    print(0)


Measured memory_bytes: 11028
#include<bits/stdc++.h>
using namespace std;
typedef long long LL; 
LL n;
char s[11],s2[11];
int main()
{
    cin >> n;
    for (int i = sqrt(n); i >= 1; -- i) 
    {
        if (n % i == 0)
        {
            int i2 = n / i; 
            sprintf(s,"%d",i);
            sprintf(s2,"%d",i2);
            cout << max(strlen(s),strlen(s2)) << endl; 
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
            var N = int.Parse(ReadLine());
            var raw = ReadLine().Split().Select(int.Parse).ToArray();

            var array = raw.OrderBy(x => x).ToArray();
            var ans = array[N / 2] - array[N / 2 - 1];
            if (ans >= 0) WriteLine(ans);
        }
    }
}


Measured memory_bytes: 22880
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<tuple>
#include<complex>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF (long long)1000000000
#define MOD 1000000007
#define EPS (long double) 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
int dh[4] = {1, 0, -1, 0};
int dw[4] = {0, 1, 0, -1};

using namespace std;

int main() {
	while(1) {
		ll n, m, s, g1, g2;
		cin>>n>>m>>s>>g1>>g2;
		if(n == 0 && m == 0 && s == 0 && g1 == 0 && g2 == 0) break;
		--s;
		--g1;
		--g2;
		ll d[n + 1][n][n];
		// ????????°????????§???????°´????????????????????????????????\????????????????????????
		REP(i, n) {
			REP(j, n) {
				if(i == j) d[0][i][j] = 0;
				else d[0][i][j] = INF;
			}
		}
		REP(i, m) {		// ??\???
			ll b1, b2, c;
			cin>>b1>>b2>>c;
			--b1;
			--b2;
			d[0][b1][b2] = c;
		}
		FOR(i, 1, n + 1) {	// ???????????£???????????????
			REP(j, n) {
				REP(k, n) {
					d[i][j][k] = min(d[i - 1][j][k], d[i - 1][j][i - 1] + d[i - 1][i - 1][k]);
				}
			}
		}
		ll res = INF;
		REP(i, n) {
			res = min(res, d[n][s][i] + d[n][i][g1] + d[n][i][g2]);
		}
		cout<<res<<endl;
	}
}

Measured memory_bytes: 10972
#include <stdio.h>

int main()
{
    int n, el, count = 0;
    int arr[21];
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &arr[i]);
    }
    for (int i = 1; i < n - 1; i++)
    {
        if ((arr[i] > arr[i - 1] && arr[i] < arr[i + 1]) || (arr[i] < arr[i - 1] && arr[i] > arr[i + 1]))
            count++;
    }
    printf("%d\n", count);

}

Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<fstream>
#include<algorithm>
using namespace std;
using ll = long long;

int main(){
    string s1,s2;
    cin >> s1 >> s2;
    cout << s2 << s1;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#define LL long long
using namespace std;
typedef pair<LL,LL>pii;
LL a[1<<18+5];
vector<pii>v[1<<18+5];
int main(void)
{
	int i,j,n,S;
	LL ans=0;
	scanf("%d",&n);
	for(i=0;i<(1<<n);++i)scanf("%lld",&a[i]);
	for(i=0;i<(1<<n);++i)v[i].push_back(make_pair(a[i],i));
	for(S=0;S<(1<<n);++S)
	{
		for(i=0;i<n;++i)
		{
			if(!((S>>i)&1))continue;
			for(j=0;j<v[S^(1<<i)].size();++j)v[S].push_back(v[S^(1<<i)][j]);
			sort(v[S].begin(),v[S].end(),greater<pii>());
			v[S].erase(unique(v[S].begin(),v[S].end()),v[S].end());
			if(v[S].size()>2)v[S].resize(2);
//			else while(true);
		}
	}
	for(S=1;S<(1<<n);++S)
	{
		ans=max(ans,v[S][0].first+v[S][1].first);
		printf("%lld\n",ans);
	}
	return 0;
}

Measured memory_bytes: 224256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
#define ll long long
#define MAX 3030
#define MOD 1000000007
#define inv2 500000004
inline int read()
{
	int x=0;bool t=false;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-')t=true,ch=getchar();
	while(ch<='9'&&ch>='0')x=x*10+ch-48,ch=getchar();
	return t?-x:x;
}
int A[MAX],S[MAX],tot;
int f[MAX][MAX];
int tmp[MAX][MAX];
int n,Q;
int main()
{
	//freopen("1.in","r",stdin);
	n=read();Q=read();
	for(int i=1;i<=n;++i)A[i]=S[i]=read();
	sort(&S[1],&S[n+1]);tot=unique(&S[1],&S[n+1])-S-1;
	for(int i=1;i<=n;++i)A[i]=lower_bound(&S[1],&S[n+1],A[i])-S;
	//for(int i=1;i<=n;++i)f[i][i]=1;
	for(int i=1;i<=n;++i)
		for(int j=1;j<=n;++j)
			if(A[i]<A[j])f[i][j]=1;
	int bin=1;for(int i=1;i<=Q;++i)bin=(bin+bin)%MOD;
	while(Q--)
	{
		int x=read(),y=read();
		for(int i=1;i<=n;++i)
		{
			if(i==x||i==y)continue;
			f[i][y]=f[i][x]=1ll*inv2*(f[i][x]+f[i][y])%MOD;
			f[y][i]=f[x][i]=1ll*inv2*(f[x][i]+f[y][i])%MOD;
			//tmp[i][y]=1ll*inv2*(f[i][y]+f[i][x])%MOD;
			//tmp[y][i]=1ll*inv2*(f[y][i]+f[x][i])%MOD;
		}
		f[x][y]=f[y][x]=1ll*inv2*(f[y][x]+f[x][y])%MOD;
	}
	int ans=0;
	for(int i=1;i<=n;++i)
		for(int j=1;j<i;++j)
			ans=(ans+1ll*bin*f[i][j])%MOD;
	printf("%d\n",ans);
}


Measured memory_bytes: 37120
macro_rules !read_value {($iter :expr ,($($t :tt ) ,*) ) =>{($(read_value !($iter ,$t ) ) ,*) } ;($iter :expr ,[$t :tt ;$len :expr ] ) =>{(0 ..$len ) .map (|_ |read_value !($iter ,$t ) ) .collect ::<Vec <_ >>() } ;($iter :expr ,{chars :$base :expr } ) =>{read_value !($iter ,String ) .chars () .map (|c |(c as u8 -$base as u8 ) as usize ) .collect ::<Vec <usize >>() } ;($iter :expr ,{char :$base :expr } ) =>{read_value !($iter ,{chars :$base } ) [0 ] } ;($iter :expr ,chars ) =>{read_value !($iter ,String ) .chars () .collect ::<Vec <char >>() } ;($iter :expr ,char ) =>{read_value !($iter ,chars ) [0 ] } ;($iter :expr ,usize1 ) =>{read_value !($iter ,usize ) -1 } ;($iter :expr ,$t :ty ) =>{$iter .next () .unwrap () .parse ::<$t >() .unwrap () } ;}
macro_rules !input_inner {($iter :expr ) =>{} ;($iter :expr ,) =>{} ;($iter :expr ,mut $var :ident :$t :tt $($r :tt ) *) =>{let mut $var =read_value !($iter ,$t ) ;input_inner !{$iter $($r ) *} } ;($iter :expr ,mut $var :ident $($r :tt ) *) =>{input_inner !{$iter ,mut $var :usize $($r ) *} } ;($iter :expr ,$var :ident :$t :tt $($r :tt ) *) =>{let $var =read_value !($iter ,$t ) ;input_inner !{$iter $($r ) *} } ;($iter :expr ,$var :ident $($r :tt ) *) =>{input_inner !{$iter ,$var :usize $($r ) *} } ;}
macro_rules !input {(source =$s :expr ,$($r :tt ) *) =>{let mut iter =$s .split_whitespace () ;input_inner !{iter ,$($r ) *} } ;(iter =$iter :ident ,$($r :tt ) *) =>{let s ={use std ::io ::Read ;let mut s =String ::new () ;std ::io ::stdin () .read_to_string (&mut s ) .unwrap () ;s } ;let mut $iter =s .split_whitespace () ;input_inner !{$iter ,$($r ) *} } ;($($r :tt ) *) =>{let s ={use std ::io ::Read ;let mut s =String ::new () ;std ::io ::stdin () .read_to_string (&mut s ) .unwrap () ;s } ;let mut iter =s .split_whitespace () ;input_inner !{iter ,$($r ) *} } ;}
fn main() {
    input! { n, s: [chars; n] };
    let mut lr = vec![(0, 0); n];
    for i in 0..n {
        let mut st = vec![];
        for &ss in s[i].iter() {
            if ss == ')' {
                if st.last().map(|&c| c == '(').unwrap_or_default() {
                    st.pop();
                } else {
                    st.push(ss);
                }
            } else {
                st.push(ss);
            }
        }
        let l = st.iter().filter(|&&c| c == '(').count();
        let r = st.iter().filter(|&&c| c == ')').count();
        lr[i] = (l, r);
    }
    lr.sort_by_key(|&(l, r)| {
        if r == 0 {
            0
        } else if l >= r {
            r + 1
        } else {
            10_000_005 - l
        }
    });
    let mut cnt = 0;
    let mut ans = true;
    for &(l, r) in &lr {
        cnt -= r as i64;
        if cnt < 0 {
            ans = false;
        }
        cnt += l as i64;
    }
    ans &= cnt == 0;
    println!("{}", if ans { "Yes" } else { "No" });
}


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

int main(void) {
	int x[5];
	int k=0,i=0;
	scanf("%d%d%d%d%d",&x[0],&x[1],&x[2],&x[3],&x[4]);
	while(k==0){
		if(x[i] == 0){
			k++;
			printf("%d",i+1);
		}
		i++;
	}
}


Measured memory_bytes: 1712
package main

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

func main() {
	io := NewIo(os.Stdin, os.Stdout)
	defer io.Flush()
	l, r, d := io.NextInt(), io.NextInt(), io.NextInt()
	count := 0
	for i := l; i <= r; i++ {
		if i%d == 0 {
			count++
		}
	}
	io.Println(count)
}

// Io is I/O object
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

// NewIo returns a new Io instance
func NewIo(r io.Reader, w io.Writer) *Io {
	return &Io{
		reader: bufio.NewReader(r),
		writer: bufio.NewWriter(w),
	}
}

// Flush flushes writer
func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

// NextLine scans a line from stdin
func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

// Next return a word from stdin
func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

// NextInt returns an integer from stdin
func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

// Println is a wrapper of fmt.Fprintln
func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}


Measured memory_bytes: 1772
from collections import deque 
n = int(input())
a = list(map(int,input().split()))

a.sort()
fir = a[n-1]

sco = 0
sit = deque([fir])
for i in range(n-1):
    sco += sit.popleft()
    sit.append(a[n-i-2])
    sit.append(a[n-i-2])
print(sco)



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

int main(){
    string S, T;
    cin >> S >> T;
    int A, B;
    cin >> A >> B;
    string U;
    cin >> U;
    if (U == S) cout << A-1 << " " << B << endl;
    else cout << A << " " << B-1 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <limits.h>
#include <vector>
#include <queue>
 
using namespace std;
 
struct Node {
    int id;
    int cost;
    bool done;
    vector<int> next_node;
    vector<int> len_cost;
 
    bool operator<(const Node& right) const {
        return cost > right.cost;
    }
} node[10000];
 
int main() {
    int n, id, k;
 
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> id >> k;
        node[id].id = id;
        node[id].cost = INT_MAX;
        node[id].done = false;
        node[id].next_node.resize(k);
        node[id].len_cost.resize(k);
        for (int j = 0; j < k; j++) {
            cin >> node[id].next_node[j] >> node[id].len_cost[j];
        }
    }
 
    priority_queue<Node> q;
    node[0].cost = 0;
    q.push(node[0]);
    while (!q.empty()) {
        Node temp = q.top();
        q.pop();
 
        if (temp.done == true) {
            continue;
        }
        node[temp.id].done = true;
 
        for (int i = 0; i < temp.next_node.size(); i++) {
            int to = temp.next_node[i];
            int cost = temp.cost + temp.len_cost[i];
            if (node[to].cost > cost) {
                node[to].cost = cost;
                q.push(node[to]);
            }
        }
    }
 
    for (int i = 0; i < n; i++) {
        cout << i << " " << node[i].cost << endl;
    }
     
    return 0;
}

Measured memory_bytes: 27440
using System;

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var k = int.Parse(line[1]);
        line = Console.ReadLine().Trim().Split(' ');
        var h = Array.ConvertAll(line, int.Parse);
        if (k >= n) { Console.WriteLine(0); goto exit; }
        Array.Sort(h);
        var ans = 0L;
        for (int i = 0; i < n - k; i++) ans += h[i];
        Console.WriteLine(ans);
    exit:;
    }
}


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

int main(){
    int K,A,B;
    cin >> K >> A >> B;
    bool flg = false;
    
    for ( int i = A; i <= B; ++i){
        int amari = i % K;
        if ( amari == 0 ){
            flg = true;
        }
    }
    
    if ( flg ){
        cout << "OK" << endl;
    } else {
        cout << "NG" << endl;
    }
    return 0;
}


Measured memory_bytes: 3632
//shara's here
#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    if(a>=b&&a>=c&&b>=c)cout<<a*10+b+c;
    else if(a>=b&&a>=c&&c>=b)cout<<a*10+b+c;
    else if(b>=a&&b>=c&&a>=c)cout<<b*10+a+c;
    else if(b>=a&&b>=c&&c>=a)cout<<b*10+a+c;
    else if(c>=b&&c>=a&&a>=b)cout<<c*10+b+a;
    else if(c>=b&&c>=a&&b>=a)cout<<c*10+b+a;
return 0;
}


Measured memory_bytes: 256
// IlyM

#include <bits/stdc++.h>
#define pb push_back
#define sp " "
#define sl "\n"
#define fi first
#define se second
#define mp make_pair
#define sz(a) ((int)a.size())
#define tra(a,b) for (auto a:b) 
#define fo(a,b,c) for (int a=b;a<=c;a++) 
#define ms(a,b) memset(a,b,sizeof(a)) 
#define all(a) a.begin(),a.end()
#define rev(a) reverse(a.begin(),a.end())
#define bit(i,j) (i&(1<<j))

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef pair<int,ii> iii;

const int N=2e5+5,mod=998244353;
int u;
int main()
{
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	cin>>u;
	bool t=false;
	while (u) { if (u%10==7) t=true; u/=10; }
	if(t) cout<<"Yes";
	else cout<<"No";
	return 0;
}


Measured memory_bytes: 3640
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int num[5][3] = {};
    int ans = 0;
    int i,j,k,x=0;
    char c[5];
    for(i=0;i<4;i++){
        cin >> c[i];
        num[i][0] = c[i] - 48;
        num[i][1] = -num[i][0];
    }
    for(i=0;i<2;i++){
        for(j=0;j<2;j++){
            for(k=0;k<2;k++){
                ans = num[0][0] + num[1][i] + num[2][j] + num[3][k];
                if(ans == 7){
                    x=1;
                    break;
                }
                else {
                    ans = 0;   
                }
            }
            if(x==1) break;
        }
        if(x==1) break;
    }
    cout<<num[0][0];
    if(i==0) cout<<'+';
    cout<<num[1][i];
    if(j==0) cout<<'+';
    cout<<num[2][j];
    if(k==0) cout<<'+';
    cout<<num[3][k]<<"=7"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
int main()
{
    string str;cin >> str;
    int ans = 0;
    for(int a = 0;a < str.size();a++){
        ans += str.at(a)-'0';
    }
    for(int a = 0;a < str.size()-1;a++){
        string c = str;
        int s = 0;
        for(int b = 0;b < str.size();b++){
            if(b > a){
                c.at(b)='9';
            }
        }
        //cout<<c<<endl;
        for(int w = 0;w < str.size();w++){
            if(w==a){
                s += c.at(w)-'0'-1;
            }else{
                s+=c.at(w)-'0';
            }
        }
        ans = max(ans,s);
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int n,ans=1;
    string s;
    cin >> n >> s;
    string a,b;
    a = s.at(0);
    for (int i=0;i<n;i++){
        b = s.at(i);
        
        if (a != b){
            a = b;
            ans++;
        }
        
    }
    cout << ans <<endl;
    
}

Measured memory_bytes: 512
#include <iostream>

using namespace std;

int main() {
    int m, d;
    cin >> m >> d;

    int c = 0;
    for (int mm = 1; mm <= m; mm++) {
        for (int dd = 1; dd <= d; dd++) {
            string ddd = to_string(dd);
            if (ddd.length() == 1) {
                continue;
            }
            int d1 = ddd[1] - 48;
            int d10 = ddd[0] - 48;
            if (d1 >= 2 && d10 >= 2 && d1 * d10 == mm) {
                c++;
            }
        }
    }
    cout << c << "\n";
}

Measured memory_bytes: 888
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
typedef long long LL;
using namespace std;

char u;
void scan(int &x){
	int f=1;
    while(u = getchar(), u < '0' || u > '9'){if(u=='-') f=-1;};
    x = u-'0';
    while(u = getchar(), u >= '0' && u <= '9') x = x * 10 + u -'0';
    x*=f;
}
int main(){
	int n;
	string s;
	scan(n);
	cin >> s;
	for(int i=0; i<=s.size()-1; i++){
		s[i]+=n;
		if(s[i]>'Z') s[i]-=26;
		if(s[i]<'A')s[i]+=26; 
	}
	cout << s;
	return 0;
}




Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using static Input;
public class Hello
{
    private const int INF = 1000000007;
    private struct Pair { public long x, y; public Pair(long xx, long yy) { x = xx; y = yy; } }
    public static void Main()
    {
        int N = NextInt();
        int M = NextInt();
        int l = 1, r = N;
        for (int i = 0; i < M; i++)
        {
            //ゲートiはLiからRiまでの番号のカードで移動できる
            //内包区間を減らしていく
            int L = NextInt();
            int R = NextInt();
            if (r < L) { Console.WriteLine(0); return; }
            else { l = Math.Max(L, l); r = Math.Min(R, r); }
        }
        Console.WriteLine(r - l + 1);
    }
}

public class Input
{
    private static Queue<string> queue = new Queue<string>();
    private static void Confirm() { if (queue.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) queue.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(queue.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(queue.Dequeue()); }
    public static string NextString() { Confirm(); return queue.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(queue.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}


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

#define infi            1e9
#define infl            5e18
#define MX              500005
#define pi              2*acos(0.0)
#define ll              long long int
#define ff              first
#define ss              second
#define rr              read()
#define pb              push_back
#define pii             pair<int,int>
#define pll             pair<long long int,long long int>
#define ms(a,b)         memset(a, b, sizeof(a))
#define loop(i,n)       for(int i=0;i<n;i++)
#define pool(i,n)       for(int i=n-1;i>=0;i--)
#define loop1(i,n)      for(int i=1;i<=n;i++)
#define pool1(i,n)      for(int i=n;i>0;i--)

using namespace std;

inline ll read(){char c=getchar();ll num,sign=1;for(;c<'0'||c>'9';c=getchar())if(c=='-')sign=-1;for(num=0;c>='0'&&c<='9';){c-='0';num=num*10+c;c=getchar();}return num*sign;}
// inline ll pow(ll b, ll p){ll ans=1;while(p>0)ans = ans<<b,p--;return ans;}
// bool isPrime(ll n){if(!(n%2))return false;for(ll i=3;i<=sqrt(n);i+=2)if(!(n%i))return false;return true;}

//bool cmp(const ll &a, const ll &b)return a > b;
// //*************************************  Bitmask Opereations  **********************************//
// int Set(int N,int pos){return N=N | (1<<pos);}
// int reset(int N,int pos){return N= N & ~(1<<pos);}
// bool check(int N,int pos){return (bool)(N & (1<<pos));}
// //********************************************************************************************//


#define mod 1000000007

int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    //#ifdef rid.dle//freopen("in.txt", "r", stdin);//#endif
    //freopen("in.txt", "r", stdin);
    
    long long n=rr;
    
    long long res=1;

    for(long long i=1;i<=n;i+=(long long)1){
        res = ((res%mod)*(i%mod))%mod;
    }

    cout << res << endl;

    return 0;
}

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

typedef long long Int;

Int K, A, B;

int main()
{
  scanf("%lld%lld%lld", &K, &A, &B);

  Int bis = 1, yen = 0;
  if(K >= A-1) bis = A, K -= A-1;
  else bis += K, K = 0;

  bis = max(bis + (K/2)*(B-A) + (K&1), bis + K);
  printf("%lld\n", bis);

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod=998244353;
int n;
pair<int,int>p[200001];
int t[200001*4];
int far[200001];
int dp[200001];
void update(int x,int st,int ed,int pos,int ind)
{
	if(st==ed)
	{
		t[x]=ind;
		return;
	}
	int mid=(st+ed)/2;
	if(pos<=mid)update(x*2,st,mid,pos,ind);
	else update(x*2+1,mid+1,ed,pos,ind);
	t[x]=max(t[x*2],t[x*2+1]);
}
int query(int x,int st,int ed,int l,int r)
{
	if(st>=l&&ed<=r) return t[x];
	if(st>r||ed<l) return 0;
	int mid=(st+ed)/2;
	return max(query(x*2,st,mid,l,r),query(x*2+1,mid+1,ed,l,r));
}

signed main()
{
	scanf("%lld",&n);
	for(int i=1;i<=n;i++)
		scanf("%lld%lld",&p[i].first,&p[i].second);
	sort(p+1,p+n+1);
	for(int i=n;i>=1;i--)
	{
		int l=i-1,r=n+1;
		while(l+1<r)
		{
			int mid=(l+r)/2;
			if(p[mid].first<=p[i].first+p[i].second-1)
				l=mid;
			else
				r=mid;
		}
		far[i]=max(i,query(1,1,n,i+1,l));
		update(1,1,n,i,far[i]);
	}
	dp[n+1]=1;
	for(int i=n;i>=1;i--)
	{
		dp[i]=dp[i+1]+dp[far[i]+1];
		dp[i]%=mod;
	}
	printf("%d",dp[1]);
	return 0;
}
/*
4 2
2212
*/

Measured memory_bytes: 12800
import java.util.Scanner;
class Main {
    
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int[][][] data = new int[4][3][10];
    	int i, j, k;
        int n = sc.nextInt();
        
        for(i = 0; i < n; i++) {
        	int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            
            data[b-1][f-1][r-1] += v;
        }
        
        for(i = 0; i < 4; i++) {
        	for(k = 0; k < 3; k++) {
        		for(j = 0; j < 10; j++) {
        			System.out.print(" " + data[i][k][j]);
        		}
        		System.out.println();
        	}
        	if(i < 3) System.out.println("####################");
        }
    }
}


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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;
typedef vector < vector<ll> > Mat;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

ll Pow(ll A, ll N){
  if (N == 0) return 1;
  if (N % 2 == 0) return Pow(A * A % MOD, N / 2);
  return Pow(A * A % MOD, N / 2) * A % MOD;
}

int N;
ll X[int(1e5+5)];
ll fac[int(1e5+5)], rev[int(1e5+5)], DP[int(1e5+5)];

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

  fac[0] = 1; rev[0] = 1;
  for (ll i = 1; i <= N; i++){
    fac[i] = fac[i-1] * i % MOD;
    rev[i] = Pow(fac[i], MOD - 2);
  }

  DP[1] = 1;
  for (ll i = 2; i <= N; i++){
    DP[i] = DP[i-1] * i % MOD;
    DP[i] += fac[i-1]; DP[i] %= MOD;
  }

  ll ans = 0;
  for (int i = 1; i < N; i++){
    ll Dist = X[i] - X[i-1];
    Dist *= fac[N - 1]; Dist %= MOD;
    Dist *= rev[i]; Dist %= MOD;
    Dist *= DP[i]; Dist %= MOD;
    ans += Dist; ans %= MOD;
  } 
  cout << ans << endl;


  return 0;
}


Measured memory_bytes: 6708