akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
ll max(ll a, ll b){
    return a > b? a: b;
}
int main() {
    int n, W;
    cin >> n >> W;
    vector< vector<ll> > dp(n+1, vector<ll>(W+1, 0));
    for(int i = 1; i <= n; i++) {
        int wt, v;
        cin >> wt >> v;
        for(int w = 0; w <= W; w++) {
            dp[i][w] = dp[i-1][w];
            if(w >= wt)
            dp[i][w] = max(dp[i][w], v + dp[i-1][w-wt]);
        }
    }
    ll ans = 0;
    for(ll a: dp[n]){
        ans = max(ans, a);
    }
    cout << ans << endl;
}


Measured memory_bytes: 80256
N = int(input())
ans = 0


for i in range(1,N+1,2):
    divisor = 1
    for j in range(1, i//2 +1):
        if i % j == 0:
            divisor += 1
        if divisor > 8:
            break
    else:
        if divisor == 8:
            ans += 1

print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,n,m) for(int i=n;i<(int)(m);i++)
#define rrep(i,n,m) for(int i=((int)(n)-1);i>=m;i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int MOD=1000000007;
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int> h(n);
    rep(i,0,n) cin>>h.at(i);
    h.at(0)--;
    
    string ans="Yes";
    
    rep(i,1,n-1){
        if(h.at(i-1)<=h.at(i)-1&&h.at(i)-1<=h.at(i+1)) h.at(i)--;
        else{
            if(h.at(i-1)<=h.at(i)&&h.at(i)<=h.at(i+1)) continue;
            else ans="No";
        }
    }
    
    cout<<ans<<endl;
}


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

//#include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
// using cint = cpp_int;

// Define
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const ll MOD = 1e9 + 7;
const ll INF = LONG_MAX;
const ull MAX = ULONG_MAX;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define x first
#define y second
#define endl '\n'
#define space ' '
#define def inline auto
#define func inline constexpr ll
#define run __attribute__((constructor)) def _
#define all(v) begin(v), end(v)
#define input(a) scanf("%lld", &(a))
#define print(a) printf("%lld\n", (a))

// Debug
#define debug(...)                                                             \
    {                                                                          \
        cerr << __LINE__ << ": " << #__VA_ARGS__ << " = ";                     \
        for (auto &&X : {__VA_ARGS__}) cerr << "[" << X << "] ";               \
        cerr << endl;                                                          \
    }

#define dump(a, h, w)                                                          \
    rep(i, h) {                                                                \
        rep(j, w) cerr << a[i][j] << space;                                    \
        cerr << endl;                                                          \
    }
#define lldump(a, n) dump(vector<vector<ll>>{a}, 1, n)

// Loop
#define inc(i, a, n) for (ll i = (a), _##i = (n); i <= _##i; ++i)
#define dec(i, a, n) for (ll i = (a), _##i = (n); i >= _##i; --i)
#define each(i, a) for (auto &&i : a)
#define rep(i, n) inc(i, 0, n - 1)

// Stream
#define fout(n) cout << fixed << setprecision(n)
#define fasten cin.tie(0), ios::sync_with_stdio(0)

// Speed
run() { fasten, fout(10); }
#pragma GCC optimize("O3")
#pragma GCC optimization_level 3
#pragma GCC target("avx")

// Math
func gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
func lcm(ll a, ll b) { return a * b / gcd(a, b); }

def in() {
    ll A;
    cin >> A;
    return A;
}

ll A, B;
signed main() {
    cin >> A >> A >> B;
    if ((A * 10 + B) % 4 == 0)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}

// for compilation: g++ -Ofast -march=native -o _ _.cpp -std=c++17


Measured memory_bytes: 256
import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.array;

void main() {
  ulong times;
  while((times = readln.chomp.to!(ulong)) != 0) {
    ulong[][ulong] table;
    foreach(i; 0..times) {
      ulong[] data = readln.chomp.split(" ").map!(to!(ulong)).array;
      if (data[0] in table) {
        table[data[0]][0] += data[1] * data[2];
      }
      else {
        table[data[0]] = new ulong[](3);
        table[data[0]][0] = data[1] * data[2];
        table[data[0]][1] = i;
        table[data[0]][2] = data[0];
      }
    }
    ulong[] result =
      sort!((x, y) => x[1] < y[1])(table.values.filter!((x) => x[0] >= 1e6).array).map!(x => x[2]).array;
    writeln(result == [] ? "NA" : result.map!(to!(string)).join("\n"));
  }
}

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

int main() {

  int N;
  cin >> N;

  string tmp;
  map<string, int> m;
  int max = 0;
  for(int i = 0; i < N; i++){
    cin >> tmp;
    m[tmp]++;
    if(m[tmp] > max){
      max = m[tmp];
    }
  }

  for(auto iter = begin(m); iter != end(m); iter++){
    if(iter->second == max){
      cout << iter->first << endl;
    }
  }
}

Measured memory_bytes: 25216
#include <cstdio>
#include <algorithm>
using namespace std;

int n;
int x;
int as[100000];
long long int ans;

int main() {
  scanf("%d%d", &n, &x);
  for (int i=0; i<n; i++) {
    scanf("%d", &as[i]);
  }

  for (int i=0; i<n-1; i++) {
    if (as[i]+as[i+1] >= x) {
      int k = min(as[i+1], as[i]+as[i+1]-x);
      ans += k;
      as[i+1] -= k;
    }

    if (as[i]+as[i+1] >= x) {
      int k = as[i]+as[i+1]-x;
      ans += k;
      as[i] -= k;
    }
  }

  printf("%lld\n", ans);
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  string s;
  cin >> s;
  if(s.at(2) == s.at(3) && s.at(4) == s.at(5)) cout << "Yes" << endl;
  else cout << "No" << endl;

}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main () {
  int N, A, B;
  cin >> N >> A >> B ;
  int ans = 0;
  for (int a = 1; a <= N; a ++) {
    int b4 = a / 10000;
    int b3 = (a % 10000) / 1000;
    int b2 = (a % 1000) / 100;
    int b1 = (a % 100) / 10;
    int b0 = (a % 10);
    if (b4 + b3 + b2 + b1 + b0 <= B && b4 + b3 + b2 + b1 + b0 >= A) {
      ans += a;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[300];
int main()
{
    int n,l,ans=0,j=1;
    cin>>n>>l;
    for(int i=1;i<=n;i++)
    {
        a[i]=l+i-1,ans+=a[i];
        if(abs(a[i])<abs(a[j])) j=i;
    }
    cout<<ans-a[j]<<endl;
    return 0;
}

Measured memory_bytes: 256
def examD():
    N = I()
    g, s, c = [0]*2, [0]*2, [0]*2
    for i in range(2):
        g[i],s[i],c[i] = LI()
    dp1 = [0]*(N+1)
    v1 = [g[1]-g[0],s[1]-s[0],c[1]-c[0]]
    w1 = [g[0],s[0],c[0]]
    v2 = [g[0]-g[1],s[0]-s[1],c[0]-c[1]]
    w2 = [g[1],s[1],c[1]]
    for i in range(N):
        if i+w1[0]<=N:
            dp1[i+w1[0]] = max(dp1[i+w1[0]],dp1[i]+v1[0])
        if i+w1[1]<=N:
            dp1[i+w1[1]] = max(dp1[i+w1[1]],dp1[i]+v1[1])
        if i+w1[2]<=N:
            dp1[i+w1[2]] = max(dp1[i+w1[2]],dp1[i]+v1[2])
    newN = max(dp1)+N
#    print(newN)
    dp2 = [0]*(newN+1)
    for i in range(newN):
        if v2[0]>0 and i+w2[0]<=newN:
            dp2[i+w2[0]] = max(dp2[i+w2[0]],dp2[i]+v2[0])
        if v2[1]>0 and i+w2[1]<=newN:
            dp2[i+w2[1]] = max(dp2[i+w2[1]],dp2[i]+v2[1])
        if v2[2]>0 and i+w2[2]<=newN:
            dp2[i+w2[2]] = max(dp2[i+w2[2]],dp2[i]+v2[2])
    ans = dp2[newN]+newN
    print(ans)

from string import digits
import sys,copy,bisect,itertools,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examD()

Measured memory_bytes: 229148
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
using vl = vector<ll>;
using Map = map<ll,ll>;
using T = tuple<ll,ll,ll>;
using vvl = vector<vector<ll>>;
#define all(v) v.begin(), v.end()
#define prt(v) cout<<(v)<<"\n";
#define fi(v) get<0>(v)
#define se(v) get<1>(v)
#define th(v) get<2>(v)
#define endl "\n"
template <typename T> bool chmax(T &a, const T &b){if (a<b){a=b;return 1;}return 0;}
template <typename T> bool chmin(T &a, const T &b){if (a>b){a=b;return 1;}return 0;}
const ll INF=1LL<<60;
const ll MOD=1000000007;


signed main(void){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    ll X;
    cin >> X;
    if(X==3||X==5||X==7)prt("YES")else prt("NO")
    return 0;
}


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

using ll = long long;
long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}

// おまけ
long long lcm(long long a, long long b){
    return a * (b / gcd(a, b));
}

int main(){
    ll n;
    std::cin >> n;
    ll ans = 1;
    for(int i = 0; i < n; i++){
        ll t;
        std::cin >> t;
        ans = lcm(ans, t);
    }

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


Measured memory_bytes: 256
#define _LIBCPP_DEBUG 0
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1e9+7;

int main(){

    ll H; cin>>H;

    ll foo = log2(H);
    foo = pow(2,foo);

    cout<<foo*2-1<<endl;
    return 0;
}

Measured memory_bytes: 512
import math 
import itertools



def factorize(n):
   
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct


def resolve(N):

    ans = 0
    factorize_N = factorize(N)

    if not factorize_N:
        print(0)
        return

    for key, value in itertools.groupby(factorize_N):
        count = len(list(value))
        for i in range(1, count + 1):
            count -= i
            if (count < 0):
                break
            ans += 1

    print(ans)


if __name__ == "__main__":
    n = int(input())
    resolve(n)

Measured memory_bytes: 9224
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N, X;
  cin >> N >> X;
  vector<int> m(N);
  int sum, count = 0;
  
  for(int i = 0; i < N ; i ++){
    cin >> m[i];
    X -= m[i];
    count ++;
    sum = X;
  }
  sort(m.begin(), m.end());
  
  count += sum / m[0];
  
  cout << count<< endl;
}
    

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<char> vchar;
typedef vector<vector<char>> vvchar;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef priority_queue<long long> prque;
#define ain(i,n,a) for(long long i=0;i<(long long)(n);i++){cin>>a[i];}
#define aout(i,n,a) for(long long i=0;i<(long long)(n);i++){if(i){cout<<" ";}cout<<a[i];if(i==n-1){cout<<endl;}}
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define vsort(v) sort((v).begin(),(v).end())
#define vrsort(v) sort((v).rbegin(),(v).rend())
#define vreverse(v) reverse((v).begin(),(v).end())
#define pf(a) push_front(a)
#define pb(a) push_back(a)
#define INF 1998021900
#define MOD 1000000007
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  //input
  ll h,j,k;cin>>h>>j>>k;
  if((h-j)>=k){cout<<0<<endl;return 0;}
  cout<<k-(h-j)<<endl;
  //caricurate
  //output
}

Measured memory_bytes: 256
#include<iostream>

int main(){
int a[10];
int max = 0;
int max2 = 0;
int max3 = 0;
int i;
int tmp;

for(i = 0; i < 10; i++){
std::cin >> a[i];
}

for(i = 0; i< 10; i++){
if(max < a[i]){
max = a[i];
tmp = i;
}
}


int tmp2;
for(int i = 0; i< 10; i++){
if(max2 < a[i] && tmp != i){
max2 = a[i];
tmp2 = i;
}
}

for(i = 0; i< 10; i++){
if(max3 < a[i]&& tmp != i&& tmp2 != i) max3 = a[i];
}

std::cout << max<< std::endl;
std::cout << max2<< std::endl;
std::cout << max3<< std::endl;



	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define debug(...) { printf("#  "); printf(__VA_ARGS__); puts(""); }
#define fi first
#define se second
#define endl "\n" 
using ll = long long;
using pII = pair <int, int>;
using pLL = pair <ll, ll>;
using VI = vector <int>;
using VL = vector <ll>;
constexpr int mod = 1e9 + 7;
template <class T1, class T2> inline void chadd(T1 &x, T2 y) { x += y; if (x >= mod) x -= mod; else if (x < 0) x += mod; } 
template <class T1, class T2> inline void chmax(T1 &x, T2 y) { if (x < y) x = y; }
template <class T1, class T2> inline void chmin(T1 &x, T2 y) { if (x > y) x = y; }
inline int rd() { int x; cin >> x; return x; }
template <class T> inline void rd(T &x) { cin >> x; }
template <class T> inline void rd(vector <T> &vec) { for (auto &it : vec) cin >> it; }
template <class T> inline void out(T s) { cout << s << "\n"; }
template <class T> inline void out(vector <T> &vec) { for (auto &it : vec) cout << it << " "; cout << endl; } 
inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
inline ll qpow(ll base, ll n) { ll res = 1; while (n) { if (n & 1) res = res * base % mod; base = base * base % mod; n >>= 1; } return res; }
constexpr int N = 1e5 + 10;
int n; 
void run() {
	cout << n * n * n << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);
	cout << fixed << setprecision(20);
	while (cin >> n) run();
	return 0;
}


Measured memory_bytes: 256
N,M=map(int,input().split())
ac=[0]*N
wa=[0]*N
WA=0
for i in range(M):
  lst=list(map(str,input().split()))
  n=int(lst[0])-1
  if lst[1]=='WA':
    if ac[n]:
      pass
    else:
      wa[n]+=1
  else:
    if ac[n]:
      pass
    else:
      ac[n]=1
      WA+=wa[n]
print(' '.join([str(sum(ac)),str(WA)]))

Measured memory_bytes: 51288
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i=0;i < (int)(n);i++)


int main(){
    int n;
    cin >> n;
    vector<pair<int,int>> v(n);

    rep(i,n){
        int a,b;
        cin >> a >> b;
        v[i] = {b,a};
    }
    int now = 0;
    sort(v.begin(),v.end());
    rep(i,n){
        now+=v[i].second;
        if (now > v[i].first){
            cout << "No" << endl;
            return 0;
        }    
    }
    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vll = vector<vl>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9+7;
const ll INF = 2e15;
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; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

int main(){
  string alpha = "abcdefghijklmnopqrstuvwxyz";
  string s;
  cin >> s;
  string t = "";
  if (s == "zyxwvutsrqponmlkjihgfedcba"){
    print(-1);
    return 0;
  }
  vector<bool> z(26,true);
  rep(i,sz(s)){
    rep(j,26){
      if(s[i]==alpha[j]){
        z[j] = false;
        break;
      }
    }
  }
  if(sz(s)<26){
    rep(i,26){
      if(z[i]){
        s.pb(alpha[i]);
        break;
      }
    }
  }
  else{
    char last;
    ll ind = 0;
    for (ll i = 25; i >= 0; i--){
      while(s[i]!=alpha[ind]){
        ind++;
      }
      if(i==25&&s[i]==alpha[ind]){
        last = alpha[ind];
      }
      t.pb(alpha[ind]);
      if(ind>25){
        last = s[sz(s) - 1];
      }
      s.erase(s.begin() + i);
      if(ind>25){
        i = -1;
        break;
      }
    }
    rep(i,sz(t)){
      if(last<t[i]){
        s.pb(t[i]);
        break;
      }
    }
  }
  print(s);
  //yzxwvutsrqponmlkjihgfedcba
}


Measured memory_bytes: 3632
n = gets.chomp.to_i
s_arr = n.times.map{gets.chomp}

hash = {}
s_arr.each do |s|
  hash[s] ||= 0
  hash[s] += 1
end

puts "AC x #{hash['AC'].to_i}"
puts "WA x #{hash['WA'].to_i}"
puts "TLE x #{hash['TLE'].to_i}"
puts "RE x #{hash['RE'].to_i}"


Measured memory_bytes: 20668
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
 
int main(){
  ll a,b,c,d;
  cin >> a >> b >> c >> d;
  ll g=c/__gcd(c,d)*d;
  ll ans=-(a-1)/c+b/c-(a-1)/d+b/d+(a-1)/g-b/g;
  cout << b-(a-1)-ans << endl;
    
    
  
}
  

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

using namespace std;

int main() {
  long double a, b, c;
  cin >> a >> b >> c;
  long double eps = 1e-14;
  if (sqrt(a) + sqrt(b) + eps < sqrt(c)) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
import sys
lines = [line.split() for line in sys.stdin]
T = H = 0
n = int(lines[0][0])
for w1,w2 in lines[1:]:
    if w1 > w2:
        T += 3
    elif w1 < w2:
        H += 3
    else:
        T += 1
        H += 1
print (str(T) + " " + str(H))

Measured memory_bytes: 7840
#include <stdio.h>
#include <vector>
using namespace std;
const int INF = 999999;

vector<vector<int> > A;
vector<int> v;
vector<int> w;

int main(){
  int N,W;
  int MAX;
  v = vector<int>(101,0);
  w = vector<int>(101,0);
  A = vector<vector<int> >(101,vector<int>(10001,0));
  scanf("%d %d",&N,&W);
  for (int i = 0; i < N; i++) scanf("%d %d",&v[i],&w[i]);
  MAX = 0;
  A[0][0] = 0;
  for (int j = 1; j <= W; j++) A[0][j] = -INF;
  for (int i = 1; i <= N; i++) A[i][0] = 0;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= W; j++) {
      if (j < w[i-1]) A[i][j] = A[i-1][j];
      else A[i][j] = max(A[i-1][j],max(v[i-1]+A[i-1][j-w[i-1]],v[i-1]+A[i][j-w[i-1]]));
      if (MAX < A[i][j]) MAX = A[i][j];
    }
  }
  printf("%d\n",MAX);

  return 0;
}



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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,t;cin>>n>>t;
    vector<int> a(n+1);
    rep(i,n)cin>>a[i];
    a[n]=a[n-1]+t;
    ll tot=0;
    rep(i,n){
        tot+=min(a[i+1]-a[i],t);
    }
    cout<<tot<<endl;
    return 0;
}


Measured memory_bytes: 1024
<?php

fscanf(STDIN, "%d", $k);
$result = 0;
$list = [];

for ($a = 1; $a <= $k; $a++) {
    for ($b = 1; $b <= $k; $b++) {
        $tmp = gcd($a, $b);

        for ($c = 1; $c <= $k; $c++) {
            $result += gcd($tmp, $c);
        }
    }
}

echo "{$result}\n";
exit;

function gcd(int $a, int $b) : int
{
    return ($a % $b) ? gcd($b, $a % $b) : $b;
}

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

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout<<setprecision(32);

	int n;
	cin>>n;
	vector<pair<int, int> > a(n);
	for(int i = 0; i < n; i++){
		cin>>a[i].first;
		a[i].second = i;
	}
	sort(a.begin(), a.end());
	vector<int> pos(n);
	for(int i = 0; i < n; i++){
		pos[a[i].second] = i;
	}
	int k = n/2;
	for(int i = 0; i < n; i++){
		if(pos[i] >= k)cout<<a[k - 1].first<<'\n';
		else cout<<a[k].first<<'\n';
	}

	return 0;
}

Measured memory_bytes: 4608
import math
a,b,h,m = map(int,input().split())
short = h*30+m/2
long = m*6
ang = abs(short-long)
ang = ang if ang <= 180 else 360-ang
hen = math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(ang)))
print(hen)

Measured memory_bytes: 9424
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String line = sc.next();
		double r = Double.parseDouble(line);

		double area, length;
		area = r * r * Math.PI;
		length = 2 * r * Math.PI;
		System.out.printf("%.6f %.6f", area, length);
	}

}


Measured memory_bytes: 26324
// created by mtnshh
 
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;

#define ll long long
#define ld long double
 
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
 
#define err() cout<<"=================================="<<endl;
#define errA(A) for(auto i:A)   cout<<i<<" ";cout<<endl;
#define err1(a) cout<<#a<<" "<<a<<endl
#define err2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define err3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl
#define err4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<endl

#define pb push_back
#define all(A)  A.begin(),A.end()
#define allr(A)    A.rbegin(),A.rend()
#define ft first
#define sd second
 
#define pll pair<ll,ll>
#define V vector<ll>
#define S set<ll>
#define VV vector<V>
#define Vpll vector<pll>
 
#define endl "\n"
 
const ll logN = 20;
const ll M = 1000000007;
const ll INF = 1e12;
#define PI 3.14159265
 
const ll N = 100005;

void solve(){
	ll k,a,b;
	cin>>k>>a>>b;
	ll p = k*(a/k);
	if(a%k!=0)	p+=k;
	if(p<=b){
		cout<<"OK"<<endl;
	}
	else{
		cout<<"NG"<<endl;
	}
	return;
}

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll no;
	// cin>>no;
	no = 1;
	while(no--){
		solve();
	}
    return 0;
}

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


int main()
{
    int n;
    cin>>n;
    int arr[200005];
    int brr[200005];
    for(int i=1;i<=n;i++){
        cin>>arr[i];
        brr[arr[i]]=i;
    }
   int ans=0,sum=0;
   for(int i=1;i<=n;i++){
     if((brr[i] - brr[i-1]) >0 && i!=1)sum++;
     else sum=1;
     ans=max(ans,sum);
   }
   cout<<n-ans;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  string co;
  cin >> co;
  string CO = "CODEFESTIVAL2016";
  int ans = 16;
  rep(i, 16) {
    if(CO.at(i) == co.at(i)) {
      ans--;
    }
  }
  cout << ans << endl;
}


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

typedef long long ll;

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


int main(){
	ll a,b;
	while(cin >> a >> b){
		ll g = gcd(a,b);
		ll lcm = a*b/g;
		cout << g << " " << lcm << endl;
	}
}

Measured memory_bytes: 3052
import heapq

N, M = map(int, input().split())
dic = {}
for i in range(N):
    A, B = map(int, input().split())
    if A not in dic:
        dic[A] = [-B]
    else:
        dic[A].append(-B)
# print(dic, sorted(dic.keys()))

ans = 0
heap = []

for i in range(M):
    # print(i)
    if i + 1 in dic:
        for j in dic[i + 1]:
            heapq.heappush(heap, j)
    # print(heap)
    if heap:
        ans = ans - heapq.heappop(heap)

print(ans)


Measured memory_bytes: 26020
n=int(input())
ls = list(map(int,input().split()))
ls2 = [0]*(n+1)
for i in range(n-1):
  if ls[i]<ls[i+1]:
    ls2[i+1]=ls2[i]*0
  elif ls[i]>=ls[i+1]:
    ls2[i+1]=ls2[i]+1
print(max(ls2))

Measured memory_bytes: 14224
#include<bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define MOD 1000000009

using namespace std;
typedef long long unsigned ll;
ll myPow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
int main()
{
  ll n;
  ll Nmod = 998244353;
  cin >> n;
  vector <ll> P(n);
  REP(i, n) {
    cin >> P[i];
    if(i != 0&&P[i] == 0){
      cout << 0 << endl;
      return 0;
    }
  }
  sort(P.begin(),P.end());
  // REP(i,n){cout << P[i] << endl;}
  ll sizenum = P[n - 1];
  vector <ll> num(sizenum + 1, 0);
  REP(i, n){
    num[P[i]] ++ ;
  }
  // cout << "num " << sizenum + 1<<endl;
  // REP(i,sizenum + 1){cout << i << ": " << num[i] << endl;}
  // cout << "first check" <<  endl;
  if(num[0] != 1){
    cout << 0 << endl;
    return 0;
  }else if(sizenum == 1){
    cout << 1 << endl;
    return 0;
  }
  REP(i, sizenum + 1){
    if(num[i] == 0){
      cout << 0 << endl;
      return 0;
    }
  }
  //  cout << "first check done" <<  endl;
  vector<ll > tmpans(sizenum + 1,0);
  tmpans[0] = 1;
  tmpans[1] = 1;
  ll ans = 1;
  ll M = 0;
  ll tmp = 0;
  for(ll i = 2; i < sizenum + 1;i ++){
    M = num[i - 1];
    tmp = M;
    tmpans[i] = myPow(tmp,num[i], Nmod)%Nmod;
  }
  // cout << "tmpans" <<  endl;
  // REP(i, sizenum + 1){cout << i <<": " << tmpans[i] << endl;}

  REP(i, sizenum + 1){
    ans *= tmpans[i];
    ans = ans%Nmod;
  }

  // ll ans = 0;
  cout << ans%Nmod << endl;
}


Measured memory_bytes: 2560
import java.util.Scanner;

class Main {

	public static final String LIGHT = "light";
	public static final String FLY = "fly";
	public static final String BANTAM = "bantam";
	public static final String FETHER = "feather";
	public static final String WELTER = "welter";
	public static final String MIDDLE = "middle";
	public static final String HEAVY = "heavy";

	public static void main(String[] args) {

		Scanner scanner = null;
		try {
			scanner = new Scanner(System.in);
			while (scanner.hasNextDouble()) {
				double weight = scanner.nextDouble();

				System.out.println(getClassName(weight));
			}

		} finally {
			scanner.close();
		}
	}

	public static String getClassName(double num) {
		StringBuilder sb = new StringBuilder();

		if (num <= 48.00 || (57.00 < num && num <= 64.00)
				|| (69.00 < num && num <= 75.00)
				|| (81.00 < num && num <= 91.00)) {
			sb.append(LIGHT);
			sb.append(" ");
		}
		if (num <= 51.00) {
			sb.append(FLY);
		} else if (num <= 54.00) {
			sb.append(BANTAM);
		} else if (num <= 57.00) {
			sb.append(FETHER);
		} else if (num <= 60.00) {
			// Light
		} else if (num <= 69.00) {
			sb.append(WELTER);
		} else if (num <= 81.00) {
			sb.append(MIDDLE);
		} else {
			sb.append(HEAVY);
		}

		return sb.toString().trim();

	}

}

Measured memory_bytes: 27748
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstring>

using namespace std;

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

int main(){
	int x, y; cin >> x >> y;
	vector<string> str;

	REP(i, x){
		string s; cin >> s;
		str.push_back(s);
	}

	REP(i, y + 2) cout << "#";
	
	cout << endl;

	REP(i, x) cout << "#" << str[i] << "#" << endl;

	REP(i, y + 2) cout << "#";

	cout << endl;

	return 0;
}

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

int main(){
  string s;
  cin>>s;
  for (int i = 0; i < s.size(); i+=2)
  {
    /* code */
    cout<<s[i];
      }
  
  }

Measured memory_bytes: 512
#include<cstdio>
#include<cctype>
#include<iostream>
#include<cstring>
using namespace std;
int main(){
    int a=0;
    string s,t;
    int ap;
    cin>>t;
    for(int i=0;i<t.size();i++){
        t[i]=tolower(t[i]);
    }
    while(1){
    cin>>s;
    if(s=="END_OF_TEXT") break;
    for(int i=0;i<s.size();i++){
        s[i]=tolower(s[i]);
    }
    ap=s.find(t);
    if(ap!=-1&&t.size()==s.size())a+=1; 
    }
    cout<<a<<endl;
}


Measured memory_bytes: 3216
import math

n = int(input())
nc = n
ans = list()

i = 2
while(i <= math.sqrt(n)):
  if(n % i == 0):
    ans.append(str(i))
    n = n // i
  else:
    i += 1
    
if(n != 1):
  ans.append(str(n))

print(str(nc) + ': ' + ' '.join(ans))


Measured memory_bytes: 5660
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;

int main() {
    int deff = 0;
    vector<int> vec(5);

    for (int i = 0; i < 5; i++) {
        int N;
        cin >> N;
        int N_hum = N / 100;
        int N_ten = (N - N_hum * 100) / 10;
        int N_one = N % 10;

        if (N_one == 0) {
            vec.at(i) = N;
        }

        else {
            vec.at(i) = N_hum * 100 + (N_ten + 1) * 10;
        }

        int a = vec.at(i) - N;

        deff = max(deff,a);

    }

    int S = -deff;

    for (int i = 0; i < 5; i++) {
        S += vec.at(i);
    }

    cout << S << endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(void) {
        string a, b;
        cin >> a >> b;
        int count=0;

        for (int i = 0; i < a.size(); i++)
                if (a[i] != b[i])
                        count++;

        cout << count << endl;

        return 0;
}

Measured memory_bytes: 3880
#include <bits/stdc++.h>
 
using namespace std;
 
const int N = 200000;

long long n, k;
int a[N];
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    cin >> n >> k;
    
    for (int i = 0; i < n; i++)
        cin >> a[i];
    
    int l = 1, r = 1e9;
    while (l < r)
    {
        int m = (l + r) / 2;
        long long curr = 0;
        for (int i = 0; i < n; i++)
            curr += (a[i] - 1) / m;
        
        if (curr > k)
            l = m + 1;
        else
            r = m;
    }
    
    cout << l;
    
    return 0;
}


Measured memory_bytes: 4396
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functional>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
using namespace std;
#define ll           long long
#define all(v)       (v).begin() , (v).end()
#define vi           vector <ll>
#define vii          vector <pair<ll,ll>>
#define ii           pair<ll,ll>
#define sz(v)	     ((int)((v).size()))
#define lp(i,a,b)    for(int i=a;i<b;i++)
#define pb           push_back
#define pf           push_front
#define F            first
#define S            second
#define endl         "\n"
#define IOS          ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const double PI = 3.14159265358979323846;
const ll inf=2e9,MOD=998244353,MAX=1e7+2;

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    IOS;
    int n;
    cin>>n;
    int ans=0,res=1;
    lp(i,1,n+1){
        int x=i,cnt=0;
        while(x%2==0)
            cnt++,x/=2;
        if(cnt>ans)
            ans=cnt,res=i;
    }
    cout<<res;
}

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

int main() {
  ll n,ans=0;
  string s;

  cin >> n >> s;
  vector<int> r,g,b;
  rep(i,n){
    if (s[i]=='R') r.push_back(i);
    else if (s[i]=='G') g.push_back(i);
    else if (s[i]=='B') b.push_back(i);
  }
  ans = r.size()*g.size()*b.size();

  rep(i,n)
    for(int j=i+1;j<n;++j){
      int k = j + j - i;
      if (k<n){
        if ((s[i]!=s[j])&&(s[j]!=s[k])&&(s[i]!=s[k])) --ans;
      }
    }
  cout << ans << endl;
}

Measured memory_bytes: 3628
#include<stdio.h>
#include<math.h>
int main()
{
	double x1,x2,y1,y2;
	double distance;
	scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
    double x=pow(x1-x2,2);
    double y=pow(y1-y2,2);
    distance=sqrt(x+y);
    printf("%.8f",distance);
    return 0;
	
}

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  
  int L = A + B;
  int R = C + D;

  if( L > R ){
    cout << "Left" << endl;
  } else if ( L < R ) {
    cout << "Right" << endl;   
  } else {
    cout << "Balanced" << endl;       
  }  
}

Measured memory_bytes: 256
def main():
    n = int(input())
    a_s = list(map(int,input().split()))
    heikin = round(sum(a_s) / len(a_s))
    counter = 0
    for a in a_s:
        counter += abs(heikin-a)**2
    print(counter)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

int main(void){
  int N, M;
  cin >> N >> M;

  vector <vector<int>> E(N + 1, vector<int>());
  for(int i = 0; i < M; i++){
    int Ai, Bi;
    cin >> Ai >> Bi;
    E[Ai].push_back(Bi);
    E[Bi].push_back(Ai);
  }

  vector <int> res(N + 1, -1);
  res[1] = 0;

  queue<pair<int, int>> q;
  for(int i = 0; i < E[1].size(); i++)
    q.push(make_pair(E[1][i], 1));
  
  while(!q.empty()){
    int next, prev;
    next = q.front().first;
    prev = q.front().second;
    q.pop();
    if(res[next] != -1)
      continue;
    
    res[next] = prev;

    for(int i = 0; i < E[next].size(); i++)
	q.push(make_pair(E[next][i], next));
  }
  
  cout << "Yes" << endl;
  for(int i = 2; i < N + 1; i++)
    cout << res[i] << endl;

  return 0;
}


Measured memory_bytes: 12232
import Control.Monad

main :: IO ()
main = do
  n <- readLn
  ls <- replicateM n getLine
  let ls' = map (map (read :: String -> Int)) $ map divByC' ls
      ansL = map decide (map differ ls')
  mapM_ putStrLn ansL

divByC :: String -> [String] -> [String]
divByC "" ls = ls
divByC (s:':':ss) ls = [(head (head ls)):s:[],ss]
divByC (s:ss) ls = divByC ss [[s]]

divByC' :: String -> [String]
divByC' ss = divByC ss []

differ :: [Int] -> Double
differ [a,b] = min d (abs (360.0 - d))
  where x = 30.0 * (fromIntegral a) + 0.5 * (fromIntegral b)
        y = 6.0 * (fromIntegral b)
        d = abs (x - y)
decide :: Double -> String
decide d
  | d < 30.0 = "alert"
  | d >= 90.0 = "safe"
  | otherwise = "warning"

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

namespace atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = Console.ReadLine().Split(' ');
            int n = int.Parse(a[0]);
            int x = int.Parse(a[1]);
            
            var tmp = Console.ReadLine().Split(' ');
            int[] l = tmp.Select(s=>int.Parse(s)).ToArray();

            int bound = 0;
            int cnt = 1;

            for(int i = 0; i<n; i++)
            {
                bound = bound + l[i];
                if(bound<=x)
                {
                    cnt ++;
                }
                else
                {
                    break;
                }
            }

            Console.WriteLine(cnt);
        }
    }
}

Measured memory_bytes: 13268
'''1. LR で region を区切る
2. 区切った中で、(Rの数+1)/2+(Lの数)/2 が十分時間が経った偶数回後にRの上にいる数、
   (Rの数)/2+(Lの数+1)/2 がLの上にいる数。'''
import re

S = input()

LRpos = [s.start() for s in re.finditer('LR', S)]
LRpos.insert(0, -1)
LRpos.append(len(S))

final_state = [0]*len(S)

for i in range(len(LRpos)-1):
    part_str = S[LRpos[i]+1:LRpos[i+1]+1]
    RLpos = part_str.find('RL')
    num_R = RLpos+1
    num_L = len(part_str) - num_R

    final_state[LRpos[i]+RLpos+1] = (num_R+1)//2 + num_L//2
    final_state[LRpos[i]+RLpos+2] = (num_R)//2 + (num_L+1)//2

print(' '.join(str(i) for i in final_state))


Measured memory_bytes: 12660
#include<bits/stdc++.h>
using namespace std;
int f[55],e[55][55];
inline int ff(int a){
    if(f[a]==a)
        return a;
    return f[a]=ff(f[a]);
}
int main(int argc, char** argv) {
    int n,m,ans=0;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        int u,v;
        cin>>u>>v;
        e[u][v]=1;
        e[v][u]=1;
    }
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            if(!e[i][j])	continue;
            e[i][j]=0;
            for(int k=1;k<=n;k++)	f[k]=k;
            for(int k=1;k<=n;k++){
                for(int l=k+1;l<=n;l++){
                    if(e[k][l])		f[ff(l)]=ff(k);
                }
            }
            for(int k=2;k<=n;k++){
                if(ff(k)!=ff(k-1)){
                    ++ans;
                    break;
                }
            }
            e[i][j]=1;
        }
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
n = int(input())
al = [chr(i) for i in range(97,97+26)]

dpn = ['a']
dpp = []
if n == 1:
    print('a')
    exit()
for i in range(1,n):
    for j in dpn:
        for k in al[:max(list(map(ord,list(j))))-97+2]:
            if i != n-1:
                dpp.append(j + k)
            else:
                print(j+k)
    if i != n-1:
        dpn = dpp
        dpp = []


Measured memory_bytes: 48348
#include <stdio.h>
#include <string.h>

int main(void)
{
    int n;
    int ans = 0;
    scanf("%d", &n);

    for (int i = 1; i <= n; i++)
    {
        char temp[10];
        sprintf(temp, "%d", i);
        if (strlen(temp) % 2 == 1)
            ans++;
    }
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 128
import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int a = scanner.nextInt(), b = scanner.nextInt();
        System.out.println(a <= 0 && 0 <= b ? "Zero" : b < 0 && Math.abs(a - b) % 2 == 0 ? "Negative" : "Positive");
    }
}

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

using namespace std;

using ll = long long;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int main () {
  cin.tie(0);
  cout << fixed << setprecision(10);

  vector<int> a(5);
  int k;
  for(int i=0;i<5;++i) {
    cin >> a[i];
  }
  cin >> k;
  sort(a.begin(), a.end());

  if(a[4] - a[0] <= k) {
    cout << "Yay!" << endl;
  } else {
    cout << ":(" << endl;
  }

}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }

        static readonly long Mod = 1000000000 + 7;

        static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            var NL = Sarray();
            var N = NL[0];
            var L = NL[1];
            var Si = new List<string>();
            for (var i = 0; i < N; ++i)
                Si.Add(ReadLine());
            Si.Sort(StringComparer.OrdinalIgnoreCase);
            foreach (var s in Si)
                Write(s);

            //Out.Flush();
        }
    }
}

Measured memory_bytes: 11348
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-9;
const long double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
long double ABS(long double a){return max(a,-a);}
vector<int>g[210000];
int dp1[210000];
int dp2[210000];
void dfs(int a,int b){
	dp1[a]=0;
	int se=0;
	int fi=0;
	for(int i=0;i<g[a].size();i++){
		if(b==g[a][i])continue;
		dfs(g[a][i],a);
		dp1[a]=max(dp1[a],dp1[g[a][i]]+1);
		if(fi<dp1[g[a][i]]+1){
			se=fi;
			fi=dp1[g[a][i]]+1;
		}else if(se<dp1[g[a][i]]+1){
			se=dp1[g[a][i]]+1;
		}
	}
	dp2[a]=fi+se;
}
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a-1;i++){
		int p,q;scanf("%d%d",&p,&q);p--;q--;
		g[p].push_back(q);
		g[q].push_back(p);
	}
	dfs(0,-1);
	int ret=0;
	for(int i=0;i<a;i++){
		ret=max(ret,dp2[i]);
	}
	if(ret%3==1){
		printf("Second\n");
	}else printf("First\n");
}

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

int main(){
  int N;
  int64_t L[87];
  cin >> N;
  L[0]=2,L[1]=1;
  for(int i=2; i<=N; i++)L[i]=L[i-1]+L[i-2];
  cout << L[N] << endl;
}
  

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	string s;
	ll n,i;
	char ch;
	cin>>n;
	cin>>s;
	for(i=0;i<s.length();i++) {
		ch=(char)(s[i]+n);
		if((int)ch>90) ch-=26;
		cout<<ch;
	}
}

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(K: int, X: int):
    if K*500>=X:
        print(YES)
    else:
        print(NO)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    solve(K, X)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
class UnionFind:
    def __init__(self, n):
        self.depth  = [0] * n
        self.parent = list(range(n))

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

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.depth[x] < self.depth[y]:
            self.parent[x] = y
        else:
            self.parent[y] = x
            if self.depth[x] == self.depth[y]:
                self.depth[x] += 1

    def are_same(self, x, y):
        return self.find(x) == self.find(y)

    def is_root(self, x):
        return x == self.find(x)


N, M = map(int, input().split())

T = UnionFind(N)

for m in range(M):
    X, Y, Z  = map(int, input().split())
    T.unite(X-1, Y-1)

print(sum([T.is_root(i) for i in range(N)]))


Measured memory_bytes: 9844
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main() {
  ll a;
  cin>>a;
  cout << 3*a*a << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdlib>
#include <map>
#include <math.h>
#include <numeric>
using namespace std;
int main(){
  int N;
  cin >> N;
  int A[N+1];
  for(int i=0;i<N+1;i++){
    A[i]=0;
  }
  for(int i=1;i<N+1;i++){
    int tmp_B;
    cin >> tmp_B;
    if(i==1){
      A[i]=tmp_B;
    }else{
      if(A[i]>tmp_B){
        A[i]=tmp_B;
      }
    }
    A[i+1]=tmp_B;
  }
  int sum=0;
  for(int i=1;i<N+1;i++){
    sum=sum+A[i];
  }
  cout << sum << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String o = getString(sc);
		String e = getString(sc);

		String[] oArr = o.split("");
		String[] eArr = e.split("");

		String pass = "";
		for (int i = 0; i < eArr.length; i++) {
			pass += oArr[i] + eArr[i];
		}
		if (oArr.length > eArr.length) {
			pass += oArr[oArr.length - 1];
		}

		System.out.println(pass);
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をlongで返却
	 *
	 * @return
	 */
	public static long getLong(Scanner sc) {

		return Long.parseLong(sc.next());
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をintで返却
	 *
	 * @return
	 */
	public static int getInt(Scanner sc) {

		return Integer.parseInt(sc.next());
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をStringで返却
	 *
	 * @return
	 */
	public static String getString(Scanner sc) {

		return sc.next();
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をint配列で返却
	 *
	 * @return
	 */
	public static int[] getIntArray(Scanner sc) {
		String line = "";
		// 直前にnext()を実行していると改行コードだけ取ってしまうのでその対策
		while (line.equals("")) {
			line = sc.nextLine();
		}

		String[] strArray = line.split(" ");
		int[] intArray = new int[strArray.length];
		for (int i = 0; i < strArray.length; i++) {
			intArray[i] = Integer.parseInt(strArray[i]);
		}
		return intArray;
	}

}


Measured memory_bytes: 21844
y = [0 for i in range(26)]
while True:
      try:
            s = input()
      except:
            break
      for i in range(len(s)):
            m = ord(s[i])-ord('A')
            if(m >= 0 and m < 26):
                  y[m]+=1
            m = ord(s[i])-ord('a')
            if(m >= 0 and m < 26):
                  y[m]+=1
for i in range(26):
      print(chr(i+ord('a')),":",y[i])


Measured memory_bytes: 5564
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    n, k = rli()
    lp = rli()
    lp.sort()
    print(sum(lp[:k]))


if __name__ == '__main__':
    main()


Measured memory_bytes: 9240
#include  <iostream>
#include  <stdio.h>
#include <algorithm>
using namespace std;
#include <vector>
#define rep(i,n) for (int i = 0; i < (n) ; i++)
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vint vector<int>
#define vll vector<ll>

//#include <stack>
//#include <queue>

/*
#include <math.h>
int standerd = int(pow(10.0,9.0)) + 7;
*/
string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 

ll A;
ll B;
ll C;
ll N;

int main(){

    string S;
    cin >> S;
    int countA=0;
    int countB=0;
    rep(ni,3){
        if(S.substr(ni,1)=="A"){
            countA++;
        }else if(S.substr(ni,1)=="B"){
            countB++;
        }
    }

    if(countA>0 && countB>0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    

}

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

int N;

int main(){

    cin >> N;
    double temp, ans;

    if (N%2 == 0){
        temp = N/2.0;
        ans = temp/N;
    }
    else{
        temp = N/2 + 1;
        ans = temp/N;
    }

    cout << fixed << setprecision(15);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define ll long long
int main(){
	map<string,ll> m;
	string s; ll n; cin>>n; ll f=0;
	while(n--){
		cin>>s;
		f=max(f,++m[s]);
	}
	for(auto it:m){
		if(it.second==f) cout<<it.first<<endl;
	}
}


Measured memory_bytes: 19228
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
  int n;cin>>n;
  vector<pair<int, int>> v(n);
  rep(i,n){
	int a,b;cin>>a>>b;
    v[i] = make_pair(b,a);
  }
  sort(v.begin(),v.end());
  long long ans=0;
  for(auto p:v) {
    ans += p.second;
    if(ans > p.first) {
      puts("No");
      return 0;
    }
  }
  
  puts("Yes");
}


Measured memory_bytes: 1792
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>

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

/* a と b の最大公約数を返す関数 */
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

int main()
{
	int N, c_total;
	vector<vector<int>> vec(2, vector<int>(110));

	cin >> N;
	rep(j, 2)
	{
		rep(i, N)
		{
			cin >> vec.at(j).at(i);
		}
	}

	int max_val = 0;

	rep(i, N)
	{
		c_total = 0;
		for (int j = 0; j <= i; ++j)
		{
			c_total += vec.at(0).at(j);
		}
		for (int k = i; k < N; ++k)
		{
			c_total += vec.at(1).at(k);
		}

		max_val = max(max_val, c_total);
	}

	cout << max_val << endl;

	return 0;
}

Measured memory_bytes: 256