akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,n;
  cin >> a >> b;
  if (b<10) {
    n = a*10 + b;
  }
  else if (b<100) {
    n = a*100 + b;
  }
  else if (b==100) {
    n = a*1000 + b;
  }
  
  bool found=false;
  for (int j=4;j<320;j++) {
    if (n == j*j) {
      cout << "Yes" << endl;
      found = true;
      break;
    }
  }
  
  if (!found) {
    cout << "No" << endl;
  }
}

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

using namespace std;


void hawawa()
{
  string str, maxstr = "zyxwvutsrqponmlkjihgfedcba";
  cin >> str;
  if (str == maxstr) {
    cout << -1 << "\n";
    return;
  }
  if (str.size() < 26) {
    for (char c = 'a'; c <= 'z'; c++) {
      if (count(begin(str), end(str), c)) {
        continue;
      } else {
        str += c;
        break;
      }
    }
  } else {
    for (int i = 1; i < 26; i++) {
      if (str.substr(i, 26 - i) == maxstr.substr(0, 26 - i)) {
        str[i - 1]++;
        str = str.substr(0, i);
        break;
      }
    }
    if (str.size() == 26) {
      bool cnt[26] = {};
      for (int i = 25; i >= 0; i--) {
        cnt[str[i] - 'a'] = true;
        for (char j = str[i] + 0x1; j <= 'z'; j++) {
          if (!count(begin(str), begin(str) + i, j)) {
            str[i] = j;
            str = str.substr(0, i + 1);
            break;
          }
        }
        if (!cnt[str[i] - 'a']) {
          break;
        }
        cnt[str[i] - 'a'] = false;
      }
    }
  }
  cout << str << "\n";
}

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define pb emplace_back
#define mp make_pair
#define mt make_tuple
#define all(v) v.begin(),v.end()
#define rep(i,start,lim) for(long long (i)=(start);i<(lim);i++)
#define revrep(i,n) for(long long i=n-1;i>=0;i--)
#define boost ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define osit ostream_iterator<int> output (cout," ")
#define endl '\n'
#define f first
#define s second
#define PI 3.141592653589793
#define MOD 1000000007
#define set0(x) memset(x,0,sizeof(x))
#define set1(x) memset(x,1,sizeof(x))
using namespace std;
typedef vector<int> vi;
typedef list<int> li;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef tuple<int, int, int> iii;
template<typename T> T gcd(T a,T b){if(a==0) return b; return gcd(b%a,a);}
template<typename P> P dectobin(P a){if(a==0)return 0; else return(a%2 + 10*dectobin(a/2));}
template<typename Y> Y bintodec(Y a){int ans=0,b=1,t=a; while (t){int ld=t%10; t/=10;ans+=ld* b;b=b*2;} return ans; }
template<typename H> H modExp(H x, H n){ int r=1; while(n>0){if(n%2==1){r=(r*x)%MOD;}x=(x*x)%MOD;n/=2;}return r;}
template<typename T> T isPowerOfTwo(T x){return x && (!(x & (x - 1)));}	
template<typename T> T lcm(T a,T b) {return a*b/gcd(a,b);}
//template<typename T> T extendedEuclid(T A,T B){if(B==0){d=A; x=1;y=0;}else{ extendedEuclid(B,A%B);int temp=x; x=y; y=temp-(A
//B)*y;}}
int32_t main(){
	boost;osit;
	int n,k;
	cin>>n>>k;
	int arr[n];
	rep(i,0,n) cin>>arr[i];
	int dp[n];
	dp[0]=0;
	dp[1]=abs(arr[1]-arr[0]);
	rep(i,2,n){
		int cnt=INT_MAX;
		rep(j,1,k+1){
			if(i>=j) cnt=min(cnt,dp[i-j]+abs(arr[i]-arr[i-j]));
		}
		if(cnt!=INT_MAX) dp[i]=cnt;
		else dp[i]=0;
	}
	cout<<dp[n-1];
	return 0;
}

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

typedef long long ll;         
using namespace std;
        
#define F first
#define S second
#define sqr(x) x*x
#define pb push_back
#define mp make_pair
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define rep(i, a, n) for(int i = (a); i < (n); ++i)
#define repr(i, a, n) for(int i = (n); i >= (a); --i)
#define repit(i, n) for(auto it = n.begin(); it != n.end(); ++it)
       
     
int main(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    ll N; cin >> N;
	ll ans = N - 1;
	rep(i, 1, 1000010) {
		if (N % i == 0) {
			ans = min(ans, i + N / i - 2);
		}
	}
	
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int64_t, int64_t>;

// std::cout << std::setprecision(20) << 1.1 << endl;

const vector<string> templates = {"dream", "dreamer", "erase", "eraser"};
string S;
int64_t N;

bool Dfs(const int64_t pos) {
  if (pos == N) {
    return true;
  } else if (pos > N) {
    return false;
  }
  for (const auto compare : templates) {
    const int64_t temp_length = static_cast<int64_t>(compare.length());
    if (S.substr(pos, temp_length) == compare) {
      const bool is_okay = Dfs(pos + temp_length);
      if (is_okay) {
        return true;
      }
    }
  }
  return false;
}

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

  cin >> S;
  N = static_cast<int64_t>(S.length());
  const bool is_okay = Dfs(0);
  if (is_okay) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

  return 0;
}


Measured memory_bytes: 2384
if __name__ == "__main__":
    _ = input()
    weights = list(map(int, input().split()))
    sum_of_weights = sum(weights)

    part = 0
    for i, weight in enumerate(weights):
        part += weight
        if (part >= sum_of_weights // 2):
            print(min(abs(part * 2 - sum_of_weights), abs(sum_of_weights - (part - weight) * 2)))
            break
        


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define LLI long long int
#define FOR(v, a, b) for(LLI v = (a); v < (b); ++v)
#define FORE(v, a, b) for(LLI v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define REV(v, a, b) for(LLI v = (a); v >= (b); --v)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define ITR(it, c) for(auto it = (c).begin(); it != (c).end(); ++it)
#define RITR(it, c) for(auto it = (c).rbegin(); it != (c).rend(); ++it)
#define EXIST(c,x) ((c).find(x) != (c).end())
#define fst first
#define snd second
#define popcount __builtin_popcount
#define UNIQ(v) (v).erase(unique(ALL(v)), (v).end())
#define bit(i) (1LL<<(i))

#ifdef DEBUG
#include <misc/C++/Debug.cpp>
#else
#define dump(...) ((void)0)
#endif

#define gcd __gcd

using namespace std;
template <class T> constexpr T lcm(T m, T n){return m/gcd(m,n)*n;}

template <typename I> void join(ostream &ost, I s, I t, string d=" "){for(auto i=s; i!=t; ++i){if(i!=s)ost<<d; ost<<*i;}ost<<endl;}
template <typename T> istream& operator>>(istream &is, vector<T> &v){for(auto &a : v) is >> a; return is;}

template <typename T, typename U> bool chmin(T &a, const U &b){return (a>b ? a=b, true : false);}
template <typename T, typename U> bool chmax(T &a, const U &b){return (a<b ? a=b, true : false);}
template <typename T, size_t N, typename U> void fill_array(T (&a)[N], const U &v){fill((U*)a, (U*)(a+N), v);}

struct Init{
  Init(){
    cin.tie(0);
    ios::sync_with_stdio(false);
  }
}init;

class Iterator{
public:
  int cur;
  int upper;
  bool end;

  int operator*() const {
    return cur;
  }

  auto operator++(){
    if(cur == 0) end = true;
    else cur = (cur-1) & upper;
    return *this;
  }

  bool operator!=(const Iterator &iter) const {
    if(end ^ iter.end) return true;
    return cur != *iter;
  }
};


class ForEachSubsetDesc{
public:
  int value;

  ForEachSubsetDesc(int value): value(value){}

  auto begin() const {
    return Iterator{value, value, false}; 
  }

  auto end() const {
    return Iterator{0, value, true};
  }
};


LLI dp[1<<16];
bool used[1<<16];
LLI score[1<<16];

LLI rec(vector<vector<int>> &a, int p){
  if(used[p]) return dp[p];
  used[p] = true;

  for(auto t : ForEachSubsetDesc(p)){
    chmax(dp[p], rec(a,t)+score[p^t]);
  }
  
                       
  return dp[p];
}

int main(){
  int N;
  while(cin >> N){
    vector<vector<int>> a(N, vector<int>(N)); cin >> a;

    fill_array(dp, 0);
    fill_array(used, false);
    fill_array(score, 0);

    REP(i,1<<N){
      if(__builtin_popcount(i) == 0) continue;
    
      REP(j,N){
        if((i>>j) & 1) continue;
        LLI t = score[i];
        REP(k,N) if(((i>>k) & 1) && j!=k) t += a[j][k];
        score[i | (1<<j)] = t;
      }
    }

    int p = 0;
    REP(i,N) p |= (1<<i);

    cout << rec(a, p) << endl;
  }
  
  return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i, a, b) for (int i = a; i < b; i++)
#define VREP(it, v) for (vector<int>::iterator it = v.begin(); it != v.end(); it++)
typedef pair<ll,ll> pi;
typedef vector<ll> vi;

template <typename T>
using pbds_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

template <typename K, typename V>
using pbds_map = tree<K, V, less<K>, rb_tree_tag, tree_order_statistics_node_update>;
int n;
int a, b, c, d;
string s;
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n;
	REP(i, 0, n){
		cin >> s;
		if (s == "AC"){
			a++;
		} else if (s == "WA"){
			b++;
		} else if (s == "TLE"){
			c++;
		} else {
			d++;
		}
	}
	cout << "AC x " << a << endl;
	cout << "WA x " << b << endl;
	cout << "TLE x " << c << endl;
	cout << "RE x " << d << endl;
}

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

using namespace std;

typedef long long ll;

#define faster ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)

#define endl "\n"

int main()
{
	faster;
	
	int n;
	cin >> n;
	string s;
	cin >> s;
	int r = n-1,l = 0,cnt = 0;

	while(r > l){
		while(l < n && s[l] == 'R') l++;
		while(r >= 0 && s[r] == 'W') r--;
		if(l > r) break;
		cnt++;
		s[l] = 'R',s[r] = 'W';
	}
	
	cout << cnt << endl;
	
	return 0;
}

Measured memory_bytes: 3712
import java.util.Scanner;

class Main {
    private static int[] calcPrimes(int n) {
        boolean[] table = new boolean[n + 1];
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (!table[i]) {
                for (int j = i + i; j <= n; j += i) {
                    table[j] = true;
                }
            }
        }
        int counter = 0;
        for (int i = 2; i <= n; i++) {
            if (!table[i]) {
                counter++;
            }
        }
        int[] result = new int[counter];
        int index = 0;
        for (int i = 2; i <= n; i++) {
            if (!table[i]) {
                result[index++] = i;
            }
        }
        return result;
    }

    private static void solve() {
        Scanner scanner = new Scanner(System.in);
        int[] primes = calcPrimes(1000000);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            int result = 0;
            for (int i = 0; i < primes.length ; i++) {
                if (primes[i] > n) {
                    break;
                } else {
                    result++;
                }
            }
            System.out.println(result);
        }
    }

    public static void main(String... args) {
        solve();
    }
}

Measured memory_bytes: 0
#include<stdio.h>
 
char s[100000],p[300];
int shuffle[101];
 
int main(void){
    int i,j,k,n,head,l;
 
    while(1){
        scanf("%s",s);
        if(s[0] == '-' && s[1] == '\0')
            break;
 
        scanf("%d",&n);
        for(i = 0;i < n;i++)
            scanf("%d",&shuffle[i]);
 
        head = 0;
        l = 0;
        while(s[l++] != '\0');
        l--;
 
        for(i = 0;i < n;i++){
            for(j = 0;j < shuffle[i];j++){
                s[head + l + j] = s[head + j];
            }
            s[head + l  + j] = '\0';
            head += shuffle[i];
        }
        printf("%s\n",&s[head]);
    }
    return 0;
}


Measured memory_bytes: 2056
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N, K = rl()
A = rl()

edges = {}
for i, a in enumerate(A):
	edges[i] = a-1

mem = {}
k = 0
n = 0
while True:
	if k == K:
		print(n+1)
		exit()
	if n in mem:
		break
	mem[n] = k
	k += 1
	n = edges[n]

p = k-mem[n]
idx = (K - k) % p

for i in range(idx):
	n = edges[n]
print(n+1)


Measured memory_bytes: 134444
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;

int main() {
  int c[5];
  c[1] = 6000;
  c[2] = 4000;
  c[3] = 3000;
  c[4] = 2000;
  REP(i, 4){
    int t, n; cin >>t >>n;
    cout <<n * c[t] <<endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include<stdio.h>
#include<string.h>
#define LENGTH 100005 // プロセスの制約 100000 のため

// 構造体
// Process という別名をつけている
typedef struct pp {
	char name[100];
	int time;
} Process;

Process Queue[LENGTH]; // Process structの配列
int head, tail, countOfProcess; // head ... 先頭ポインタ, tail ... 末尾ポインタ

void enqueue(Process process)
{
	Queue[tail] = process;
	tail = (tail + 1) % LENGTH;
}

Process dequeue()
{
	Process process = Queue[head];
	head = (head + 1) % LENGTH;
	return process;
}

int min(int a, int b ) { return a < b ? a : b; }

int main()
{
	// 変数は、使用する前に宣言しなければならない。
	// C言語では宣言はプログラムの冒頭でなければならなかったが、 C言語を拡張した C++ ではプログラムのどこでも宣言できる。
	int totalTime = 0, consumption;
	int i, quantum;
	Process process;
	scanf("%d %d", &countOfProcess, &quantum);

	for ( i = 1; i <= countOfProcess; i++)
	{
		scanf("%s", Queue[i].name);
		scanf("%d", &Queue[i].time);
	}
	head = 1; tail = countOfProcess + 1;

	while(head != tail){
		process = dequeue();
		consumption = min(quantum, process.time);
		process.time -= consumption;
		totalTime += consumption;
		if(process.time > 0){
			enqueue(process);
		}else{
			printf("%s %d\n", process.name, totalTime);
		}
	}
	return 0;
}


Measured memory_bytes: 12864
#include<iostream>

using namespace std;

int main(){
  string str;
  bool yes;

  cin >> str;

  if ((str.size() % 2 == 0) && str[str.size() - 2] == 'h' && str[str.size() - 1] == 'i') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x)+modulo)%modulo)
#define Inf 1000000000000


int main(){
	
	int N;
	cin>>N;
	vector<int> a(N);
	bool f = false;
	
	vector<int> cnt_0(30,0);
	vector<int> cnt_1(30,0);
	set<int> S;
	
	for(int i=0;i<N;i++){
		cin>>a[i];
		S.insert(a[i]);
		if(a[i]!=0){
			f=true;
		}
		for(int j=0;j<30;j++){
			if(a[i]%2==0){
				cnt_0[j]++;
			}
			else cnt_1[j]++;
			a[i]/=2;
		}
	}
	if(f==false){
		cout<<"Yes"<<endl;
		return 0;
	}
	
	if(N%3!=0){
		cout<<"No"<<endl;
		return 0;
	}
	
	bool ff = false;
	
	for(int i=0;i<30;i++){
		if(cnt_0[i]!=N&&cnt_0[i]*3!=N){
			ff=true;
			break;
		}
	}
	
	
	if(ff){
		cout<<"No"<<endl;
		return 0;
	}
	
	if(S.size()>3){
		cout<<"No"<<endl;
		return 0;
	}
	
	cout<<"Yes"<<endl;

	
	return 0;
}


Measured memory_bytes: 4224
N,A,B = map(int,input().split())

count = 0

'''                                                                            
def keta_sum(n):                                                               
    sum = 0                                                                    
    while n>0:                                                                 
        sum += n%10 #対象の桁を加算                                            
        n = n//10 # 次の桁をみる                                               
    return(sum)                                                                
'''

for i in range(N):
    keta = sum(list(map(int,str(i+1))))

    if keta >= A and keta<= B:
      #  print(keta)                                                           
        count += (i+1)

print(count)

Measured memory_bytes: 3060
N = int(input())
L = [int(i) for i in input().split()]
cnt = 0

for a in range(N-2):
  for b in range(a+1, N-1):
    for c in range(b+1, N):
        if L[a] != L[b] and L[b] != L[c] and L[c] != L[a]:
            if L[a]+L[b] > L[c] and L[b]+L[c] > L[a] and L[c]+L[a] > L[b]:
              cnt += 1
print(cnt)

Measured memory_bytes: 9204
#include<stdio.h>
#include<math.h>

int main(){

  long long n,T;
  scanf("%lld%lld",&n,&T);

  long long t[n];

  for(long long i=0;i<n;i++){
    scanf("%lld",&t[i]);
  }

  long long ans=0;

  for(long long i=0;i<n-1;i++){
    if(t[i+1]-t[i]<=T){
      ans=ans+t[i+1]-t[i];
    }
    else{
      ans=ans+T;
    }
  }
    

  printf("%lld\n",ans+T);

  return 0;
}


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

int main() {

  int N, K;
  cin >> N >> K;

  long count = 0;

  for (int i = 1; i <= N; i++) {
    if (i == 1) {
      count += 1 * K;
    } else {
      count = count * (K - 1);
    }
  }

  cout << count << endl;

}

Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

vector<int> eratosthenes(const int &n) {
  vector<int> v(n);
  v[0] = v[1] = false;
  loop(i, 2, v.size()) v[i] = true;
  for (int i = 2; i * i < n; i++) {
    if (v[i]) {
      for (int j = i * 2; j < n; j += i) {
        v[j] = false;
      }
    }
  }
  return v;
}

void solve() {
  vi v = eratosthenes(1000000);
  int n;
  while (cin >> n, n) {
    int i = 0, c = 0;
    while (n--) {
      while (!v[i]) i++;
      // cout << i << endl;
      c += i++;
    }
    cout << c << endl;
    // cout << endl;
  }
}

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

using ll = long long;
using namespace std;

const int N = 1e5 + 1;
int h[N], dp[N];

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

#ifdef LOCAL_DEFINE	
	freopen("in.txt", "r", stdin);
#endif
	
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i) cin >> h[i];

	dp[0] = 0;
	dp[1] = abs(h[1] - h[0]);

	for (int i = 2; i < n; ++i) {
		dp[i] = min(abs(h[i] - h[i - 1]) + dp[i - 1], abs(h[i] - h[i - 2]) + dp[i - 2]);
	}

	cout << dp[n - 1] << '\n';

	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
using namespace std;
int main()
{
  int k,x,i,l,r;
  cin >> k >> x;
  l=x-k+1;
  r=x+k-1;
  for(i=l;i<=r;i++)
    cout << i << " ";
  cout << endl;
  return 0;
}

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


int main() {
	int A, B;
	string op;
	cin >> A;

	if ((A / 10) % 111 == 0 || (A % 1000) % 111 == 0) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long   signed int LL;
typedef long long unsigned int LU;
#define incID(i, l, r) for(LL i = (l)    ; i <  (r); ++i)
#define incII(i, l, r) for(LL i = (l)    ; i <= (r); ++i)
#define decID(i, l, r) for(LL i = (r) - 1; i >= (l); --i)
#define decII(i, l, r) for(LL i = (r)    ; i >= (l); --i)
#define inc(i, n)  incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec(i, n)  decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))
#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
template<typename T> bool setmin  (T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmax  (T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
LL mo(LL a, LL b) { assert(b > 0); a %= b; if(a < 0) { a += b; } return a; }
LL fl(LL a, LL b) { assert(b > 0); return (a > 0 ? a / b : (a - b + 1) / b); }
LL ce(LL a, LL b) { assert(b > 0); return (a < 0 ? a / b : (a + b - 1) / b); }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
#define bit(b, i) (((b) >> (i)) & 1)
#define BC __builtin_popcountll
#define SC static_cast
#define SI(v) SC<int>(v.size())
#define SL(v) SC<LL >(v.size())
#define RF(e, v) for(auto & e: v)
#define ef else if
#define UR assert(false)

// ---- ----

const double TAU = atan2(0, -1) * 2.0;

double a, b, x;

int main() {
	cin >> a >> b >> x;
	
	double h = x / (a * a);
	double ans;
	if(h <= b / 2) {
		double s = a * h;
		ans = atan(b * b / (2 * s));
	} else {
		double s = a * (b - h);
		ans = atan(2 * s / (a * a));
	}
	
	printf("%.9f\n", ans * 360 / TAU);
	
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <math.h>
using namespace std;
typedef long long int ll;

int main(){
	int a,b;cin>>a>>b;
if((a+b)%2==0){
		cout << (a+b)/2 << endl;
	}
	else{
		cout << "IMPOSSIBLE" << endl;
	}
}


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

int main(){
    double n,a=0;
    cin>>n;
    for(int i=1;i<=n;i++){
        if(i%2==1)
        a++;
    }
    a=a/n;
    cout<<setprecision(8)<<a<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int dp[101][10010];
int main(){
  int n,W,v[110],w[110];
  cin>>n>>W;
  for(int i=0;i<101;i++)
    for(int j=0;j<10010;j++)
      dp[i][j]=1e9+1;
  for(int i=0;i<n;i++)cin>>v[i]>>w[i];
  for(int i=0;i<n;i++)
    for(int j=0;j<10010;j++){
      int nj=min(j+v[i],10010);
      if(j==0)dp[i+1][v[i]]=min(dp[i+1][v[i]],w[i]);
      if(dp[i][j]!=1e9+1)dp[i+1][nj]=min(dp[i+1][nj],dp[i][j]+w[i]);
      dp[i+1][j]=min(dp[i+1][j],dp[i][j]);
    }
  int ans=0;
  for(int i=0;i<=10000;i++){
    if(dp[n][i]<=W)ans=i;
  }
  cout<<ans<<endl;
  return 0;
}


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

bool finished(const vector<int> &v){
  if(v[0] != 1) return false;
  int n = v.size();

  for(int i = 1; i < n; i++){
    if(v[i] - 1 != v[i - 1]){
      return false;
    }
  }
  return true;
}

int main(){
  int n;

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

    for(int i = 0; i < n; i++){
      int x;
      cin >> x;
      v.push_back(x);
    }

    int ans = 0;

    while(!finished(v)){
      vector<int> nv;
      int size = v.size();

      for(int i = 0; i < size; i++){
        if(v[i] > 1){
          nv.push_back(v[i] - 1);
        }
      }
      v = nv;
      v.push_back(size);
      ans++;
      if(ans > 10000){
        break;
      }
    }

    cout << (ans > 10000 ? -1 : ans) << endl;
  }
}

Measured memory_bytes: 1248
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

double n, x, t;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n >> x >> t;
	cout << (int)(ceil(n / x) * t);
}


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

int main() {
  int n, k;
  cin >> n >> k;
  vector<int> p(n);
  rep(i, n) cin >> p[i];
  sort(p.begin(), p.end());
  int ans = 0;
  rep(i, k) ans += p[i];
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 3628
def knap_sack_1(weight_and_value, w):
    n = len(weight_and_value)
    dp = [[0 for i in range(w + 1)] for j in range(n + 1)]
    for w in range(1, w + 1):
        for i in range(1, len(weight_and_value) + 1):
            w_i, v_i = weight_and_value[i-1]
            if w >= w_i:
                dp[i][w] = max(dp[i][w], dp[i-1][w - w_i] + v_i)
            dp[i][w] = max(dp[i][w], dp[i-1][w])
    return dp[-1][-1]

def get_input():
    n, k = list(map(int, input().split()))
    data = []
    for i in range(n):
        el = list(map(int, input().split()))
        data.append(el)
    return data, k

data, w = get_input()
print(knap_sack_1(data, w))

Measured memory_bytes: 171656
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for i in range(N)]

count = 0

for i in range(N):
    S = C
    for j in range(M):
        S += A[i][j] * B[j]
    if S > 0:
        count += 1

print(count)

Measured memory_bytes: 3064
a, b = map(int, input().split())

res1 = int(a // 0.08)
res11 = int((a + 1) // 0.08)
res2 = int(b // 0.1)
res21 = int((b + 1) // 0.1)
ans = -1

#print(res1)
#print(res11)
#print(res2)
#print(res21)

ran1 = max(res1, res2)
ran2 = min(res11, res21)
for i in range(ran1-1, ran2):
    ans1 = int(i * 0.08)
    ans2 = int(i * 0.1)
    if ans1 == a and ans2 == b:
        ans = i
        break

print(ans)

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

int main(){
  int N;
  cin >> N;
  string S;
  int P;
  vector<tuple<string, int, int>> T(N);
  for(int i=0; i<N; i++){
    cin >> S >> P;
    T.at(i)=make_tuple(S, 100-P, i+1);
  }
  sort(T.begin(), T.end());
  for(int i=0; i<N; i++){
    cout << get<2>(T.at(i)) << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int n, a[100005];

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
    cin >> n;
    for(int i = 0; i < n; i++) cin >> a[i];
    sort(a, a+n);
    int v = a[n-1], vi = 0;
    for(int i = 0; i < n-1; i++){
        int w = (2 * a[i] > a[n-1] ? a[i] - (a[n-1]+1)/2 : a[n-1]/2-a[i]);
        if(v > w){
            v = w;
            vi = i;
        }
    }
    cout << a[n-1] << ' ' << a[vi] << '\n';
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> Pii;

int N, K, C;
string S;

int main() {
    cin >> N >> K >> C >> S;
    
    if (C != 0) {
        set<int> fr;
        int cnt = 0;
        for (int i = 0; i < S.length(); i++) {
            if (cnt >= K) break;
            if (S[i] == 'o') {
                fr.insert(i);
                i += C;
                cnt++;
            }
        }

        set<int> bc;
        cnt = 0;
        for (int i = S.length() - 1; i >= 0; i--) {
            if (cnt >= K) break;
            if (S[i] == 'o') {
                bc.insert(i);
                i -= C;
                cnt++;
            }
        }

        set<int> aANDb;
        set_intersection(fr.begin(), fr.end(),
                        bc.begin(), bc.end(),
                        inserter(aANDb, aANDb.end()));

        for (auto itr = aANDb.begin(); itr != aANDb.end(); itr++) {
            cout << *itr + 1 << endl;
        }
    }
    else {
        int cnt = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S[i] == 'o') {
                cnt++;
            }
        }

        if (cnt == K) {
            for (int i = 0; i < S.length(); i++) {
                if (S[i] == 'o') {
                    cout << i+1 << endl;
                }
            } 
        }
    }
    

    return 0;
}

Measured memory_bytes: 3332
#include <bits/stdc++.h>
using namespace std;
typedef  long long ll;
//double pi=3.1415926535898;
//double pi=acos(-1.0);
#define scarr(a,s,e) for(int i=s;i<=int(e);i++) scanf("%d ",&a[i]);
#define prarr(a,s,e) for(int i=s;i<=int(e);i++) printf("%d ",a[i]);
#define speed      ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
#define rng(i,a,b) for(int i=a;i>=int(b);i--)
#define rep(i,a,b) for(int i=a;i<=int(b);++i)
#define lop(i,n)   for(int i=0;i<int(n);i++)
#define ms(x,a)    memset(x,a,sizeof(x))
#define all(x)     (x).begin(),(x).end()
#define sz(x)      int(x.size())
#define pb         push_back
#define mkp        make_pair
#define sc(x)      scanf("%d",&x)
#define scl(x)     scanf("%lld",&x)
#define pr(x)      printf("%d ",x)
#define prl(x)     printf("%lld ",x)
#define prln(x)    printf("%d\n",x)
#define prlln(x)   printf("%lld\n",x)
#define r0         return 0;
#define CC         continue;
#define scd(x)     scanf("%lf",&x)
#define prd(x)     printf("%.10f\n",x)
#define bb(x)      cerr<< x <<endl;
#define pii        pair<int,int>
#define vi         vector<int>
#define fr         first
#define se         second
//#define max(a,b) a<b?b:a
//#define min(a,b) a<b?a:b
const ll M  = 1e9+7 ;
const ll inf = 1e18 ;
const int si = 1e5+9;
const int N = 1e5+5 ;
//////////////////////    Hi    ^_^  hack me if you can :P

int main()
{
    int n;
    ll a=0,t=0,rt,ra,r;
    cin >> n;
    lop(i,n)
    {
        cin >> rt >> ra;
        r=max(max(((t+a-1)/(rt+ra)+1),((t-1)/rt+1)),((a-1)/ra+1));
        t=rt*r;
        a=ra*r;
    }
    cout << a+t <<endl;
    r0;
}

/*

ll pwmod(ll a, ll n, ll mod) {
    ll ret = 1;
    while (n) {
        if (n & 1) ret = ret * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return ret;
}
Wj0944296025*
*/
/*
freopen("output.txt","w",stdout);
freopen("input.txt","r",stdin);
for (int i=0;i<n;i++)            Hi    ^_^  hack me if you can :P
int mx[]= {0,0,1,-1, 1,1,-1,-1};
int my[]= {1,-1,0,0, 1,-1,1,-1};
bool inside (int i,int j) {return (i>=0 && i<n && j>=0 && j<m);}

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void gcd(LL n,LL m,LL &d,LL &xx,LL &yy){
    if(!m) {d=n; xx=1; yy=0;}
    else {gcd(m,n%m,d,yy,xx); yy-=xx*(n/m);}
}

int getm(int l,int r)
{
    if(l>r)
        return N;
    if(l==r)
        return 0;
    if(l==r-1)
        return s[l] != s[r];
    if(s[l]==s[r])
        return getm(l+1,r-1);
    else
        return 1+min(getm(l+1,r),getm(l,r-1));
}

int BIT[si], a[si], n;
void update(int x, int delta)
{
    for(; x <= N; x += x&-x)
        BIT[x] += delta;
}
int query(int x)
{
    int sum = 0;
    for(; x > 0; x -= x&-x)
        sum += BIT[x];
    return sum;
}

*/


Measured memory_bytes: 256
//C
#include <cassert>
//#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

//ここまで標準include

using namespace std;

long aCb(long a, long b) {
	long out = 1;
	for (long i = 1; i <= b; i++) {
		out = out * (a + 1 - i) / i;
	}
	return out;
}

long long gcd(long long a, long long b) {
	long long r = -1;
	if (a < b) {
		swap(a, b);
	}
	while (r != 0) {
		r = a % b;
		if (r == 0) {
			return b;
		}
		else {
			a = b;
			b = r;
		}
	}
}

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

int main() {
	char s, t;
	cin >> s >> t;
	if (s == '9' || t == '9') {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    typedef long double ld;
    typedef unsigned long long ull;
    typedef vector<int> vi;
    typedef vector<long long> vll;
    typedef pair<ll,ll> pll;
     
    const ll mod = 1e9 + 7;
    const ld PI = 3.1415926535897932384626;
    const ld eps = 1e-9;                            
     
    #define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
    #define sidha(i,a,b) for(ll i=(ll)(a);i<(ll)(b);++i)
    #define ulta(i,a,b) for(ll i=(ll)(a);i>=(ll)(b);--i)
    #define stl(container,itr) \
        for(auto itr = container.begin(); itr != container.end(); itr++)
    #define sab(v) v.begin(), v.end()
    #define rall(v) v.rbegin(), v.rend()            
    #define test ll t;cin>>t;while(t--)
    #define sz size()
    #define pb push_back
    #define mp make_pair
    #define fi first
    #define se second
    #define LOG2(X) (63ll - __builtin_clzll(X))
    #define endl '\n'
    #define modinv(x) power(x, mod-2)
    #define MAX 100005
     
    ll power(ll x, ll y) { 
        ll ans=1;
        x=x%mod;
        while(y>0) { 
            if (y&1) 
                ans=(ans*x)%mod; 
            y=y>>1;
            x=(x*x)%mod; 
        } 
        return ans; 
    }
    
    // vector<ll> arr[MAX];
    // ll visit[MAX];
    // void dfs(ll n){
    //     visit[n]=1;
    //     for(ll i=0;i<arr[n].size();++i){
    //         if(visit[arr[n][i]]==0) dfs(arr[n][i]);
    //     }
    // }
    
    // ll spf[MAX];
    // void sieve(){
    //     sidha(i,1,MAX)  spf[i]=i;
    //     for(ll i=4;i<MAX;i+=2)  spf[i]=2;
    //     for(ll i=3;i*i<=MAX;i++){
    //         if(spf[i]==i){
    //             for(ll j=i*i;j<MAX;j+=i){
    //                 if(spf[j]==j)   spf[j]=i;
    //             }
    //         }
    //     }
    // }

    int main()
    {
        boost;
        ll n,ans=0;
        cin>>n;
        ll arr[n];
        sidha(i,0,n)    cin>>arr[i];
        sidha(i,0,n){
            sidha(j,i+1,n){
                sidha(k,j+1,n){
                    if(arr[i]!=arr[j] && arr[j]!=arr[k] && arr[i]!=arr[k]){
                        vector<ll> v;
                        v.pb(arr[i]);
                        v.pb(arr[j]);
                        v.pb(arr[k]);
                        sort(sab(v));
                        if(v[0]+v[1]>v[2])  ans++;
                    }
                }
            }
        }
        cout<<ans;
        return 0;
    }
    

Measured memory_bytes: 3656
#include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<iomanip>
#include<algorithm>

using namespace std;

#define debug(x) cout<< #x <<" : "<< x << endl;
#define repi(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) repi(i, 0, n);
#define int long long

const int INF = (1<<30);
const int MOD = (int)1e9 + 7;

const int MAX = 510;

#define x0 first.first.first
#define y0 first.first.second
#define x1 first.second.first
#define y1 first.second.second

int con;
vector<vector<int>> field;
vector<int> ans;

void solve(vector<pair<pair<pair<int,int>,pair<int,int>>,int>> p){
    if(p.size() == 0) return;
    
    sort(p.begin(), p.end());

    ans.push_back(p[0].second);

    // cout<<"id =  "<<p[0].second<<" size"<<p.size()<<" "<<p[0].x0<<" "<<p[0].y0<<" "<<p[0].x1<<" "<<p[0].y1<<endl;

    int num1 = p[0].x0, num2 = p[0].x1;
    
    for(int i = p[0].x1+1; i < MAX; i++){
        if(i == 501 || field[p[0].y1][i] != 0 && field[p[0].y1-1][i] != 0 && field[p[0].y1][i] == field[p[0].y1-1][i]){
            // cout<<"i = "<<i<<" "<<p[0].y1<<" [][] "<<field[p[0].y1+1][i]<<" "<<field[p[0].y1][i]<<endl;
            num2 = i-1;
            break;
        }
    }

    vector<pair<pair<pair<int,int>,pair<int,int>>,int>> b, c;
    for(int i = 1; i < p.size(); i++){
        // cout<<"i = "<<i<<" "<<num1<<" "<< p[i].x0<<" "<<p[i].x1<<" "<<num2<<"   <><> "<<p[i].y1<<" <= "<<p[0].y1<<endl;
        if(num1 <= p[i].x0 && p[i].x1 <= num2 &&p[i].y1 <= p[0].y1) b.push_back(p[i]);
        else c.push_back(p[i]);
    }

    solve(b);
    solve(c);
    
}

signed main(){
    int t = 0;

    while(true){
        vector<pair<pair<pair<int,int>,pair<int,int>>,int>> p;
        int n;

        

        cin>>n;

        if(!n) break;

        if(t++) cout<<endl;
        p.resize(n);
        
        ans.clear();
        //ns.resize(n+1);
        
        field.clear();
        field.resize(MAX, vector<int>(MAX, 0));
    
        for(int i = 0; i < n; i++){
            cin>>p[i].x0>>p[i].y0>>p[i].x1>>p[i].y1;

            p[i].second =  i+1;
            if(p[i].x0 > p[i].x1){
                swap(p[i].first.first, p[i].first.second);
            }

            if(p[i].y0 > p[i].y1){
                swap(p[i].y0, p[i].y1);
            }

        
            for(int j = p[i].y0; j < p[i].y1; j++){
                for(int k = p[i].x0; k < p[i].x1; k++){
                    field[j][k] = i+1;
                }
            }
        }

        solve(p);

        vector<int> test(ans);

        for(int i = 0; i < ans.size(); i++){
            test[ans[i]-1] = i;
        }
        for(int i = 0; i < ans.size(); i++){
               cout<<test[i]+1<<endl;
        }
        //cout<<endl;
    }
   

    return 0;
}




Measured memory_bytes: 4916
import java.util.Scanner;

public class Main {

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

		int a = sc.nextInt();
		int b = sc.nextInt();
		String s = sc.next();

		String ans = "Yes";
		for (int i = 0; i < s.length(); i++) {
			if (i == a) {
				if (s.charAt(i) != '-') {
					ans = "No";
					break;
				}
			} else {
				if (s.charAt(i) == '-') {
					ans = "No";
					break;
				}
			}
		}
		System.out.println(ans);
		sc.close();
	}

}


Measured memory_bytes: 21844
S = input()
N = len(S)
dp = [[0 for i in range(13)] for j in range(N+1)]

MOD = 10**9 + 7
dp[0][0] = 1

for i in range(1,N+1):
    if S[i-1] == "?":
        for j in range(13):
            for k in range(10):
                dp[i][(j*10+k)%13] += dp[i-1][j]
                dp[i][(j*10+k)%13] %= MOD
    else:
        t = int(S[i-1])
        for j in range(13):
            dp[i][(j*10+t)%13] += dp[i-1][j]
            dp[i][(j*10+t)%13] %= MOD

print(dp[N][5])


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

int main(){
    int a;
    cin >> a;
    int key = 0;
    while(1){
        int count = 0;
        for(int i = 1;i<=a;i++){
            if(a%i == 0)
                count++;
        }
        if(count == 2){
            key = 1;
            break;
        }
        a++;
    }
    cout << a << endl;
}
    

Measured memory_bytes: 256
N = int(input())
s = []
for _ in range(N):
    s.append(input())

M = int(input())
t = []
for _ in range(M):
    t.append(input())

sets = set(s)

ans = [0]
for word in sets:
    tmp = 0
    tmp += s.count(word)
    tmp -= t.count(word)
    ans.append(tmp)

print(max(ans))


Measured memory_bytes: 3060
import itertools as it

n = int(input())
fibn = 1
for i in range(1,n+1):
    fibn *= i
xp = [0] * n
yp = [0] * n
for i in range(n):
    x,y = map(int,input().split())
    xp[i] = x
    yp[i] = y

s = ''
for i in range(n):
    s += str(i)
g = 0.0
for sb in it.permutations(s, n):
    tmpli = list(sb)
    for j in range(n-1):
        length_x = abs(xp[int(tmpli[j])]-xp[int(tmpli[j+1])])
        length_y = abs(yp[int(tmpli[j])]-yp[int(tmpli[j+1])])
        length_t = (length_x*length_x + length_y*length_y)**0.5
        g += length_t
print(g/fibn)

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

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<ll, ll> pii;

#define REP(a,b,c) for(ll (a)=(b);(a)<(c);(a)++)
#define PER(a,b,c) for(ll (a)=(b);(a)>=(c);(a)--)

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


Measured memory_bytes: 256
use std::cmp;

const N: usize = 33;
const INF: u64 = 1 << 50;

fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());

    let n: usize = sc.read();
    let t: u64 = sc.read();

    let mut a0 = vec![];
    let mut ab = vec![];
    for _ in 0..n {
        let a: u64 = sc.read();
        let b: u64 = sc.read();
        if a == 0 {
            a0.push(b);
        } else {
            ab.push((a, b));
        }
    }

    ab.sort_by(|&(ai, bi), &(aj, bj)| {
        let xi = aj * (bi + 1);
        let xj = ai * (bj + 1);
        xi.cmp(&xj)
    });
    a0.sort();

    let mut dp = vec![INF; N];
    dp[0] = 0;
    for (a, b) in ab.into_iter() {
        for i in (0..(N - 1)).rev() {
            dp[i + 1] = cmp::min(dp[i + 1], (a + 1) * (dp[i] + 1) + b);
        }
    }

    let mut ans = 0;
    for i in 0..N {
        if dp[i] > t {
            continue;
        }
        let mut count = i;
        let mut time = dp[i];
        for &b in a0.iter() {
            if time + 1 + b <= t {
                time += b + 1;
                count += 1;
            }
        }

        ans = cmp::max(ans, count);
    }

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

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: std::ops::Deref<Target = str>>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


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

#define ALL(c)  std::begin(c), std::end(c)

using namespace std;
using ll = long long;

void solve() {
    ll n, t;
    cin >> n >> t;
    vector<ll> ts(n);
    cin >> ts[0];
    for (int i = 0; i < n - 1; ++i) {
        cin >> ts[i + 1];
        ts[i] = min(ts[i + 1] - ts[i], t);
    }
    ts[n - 1] = t;

    ll sum = 0;
    for (int j = 0; j < n; ++j) {
        sum += ts[j];
    }
    cout << sum << endl;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);

    solve();
    return 0;
}


Measured memory_bytes: 1792
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
 
int main(void){
    ll N,D;
    cin >> N>>D;
    D=D*D;
    ll ans=0;
    ll x,y;
    for(int i=0;i<N;i++){
        cin >> x >> y;
        if(x<0)x*=-1;
        if(y<0)y*=-1;
        if(x*x+y*y<=D){
            ans++;
        }
    }
    cout <<ans<<endl;
}


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

int main() {
  string s;
  cin >> s;
  int start_addr, end_addr;
  
  for (int i = 0; i < s.size(); i++) {
    if (s.at(i) == 'A') {
      start_addr = i;
      break;
    }
  }
  
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s.at(i) == 'Z') {
      end_addr = i;
      break;
    }
  }
  
  cout << end_addr - start_addr + 1 << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <ctype.h>

using namespace std;

int main()
{
	int n, k;
	cin >> n >> k;

	string s;
	cin >> s;

	string s2 = s;
	s2[k - 1] = tolower(s2[k - 1]);

	cout << s2;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define repr(i,n) for(int i=(n)-1;0<=i;--i)
#define each(e,v) for(auto&& e:(v))
#define all(v) begin(v),end(v)
#define dump(x) cerr<<#x<<": "<<(x)<<endl
#define INF 100000000
#define IINF 9999999999999;
using vint = std::vector<int>;
using ll = long long;
using vll = std::vector<ll>;
template <class T> void chmin(T& a, const T& b) { a = std::min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = std::max(a, b); }


int main() {
    string S;
    cin >> S;
    int w;
    cin >> w;
    for(int i = 0; i < S.length(); i += w) {
        cout << S[i];
    }
}

Measured memory_bytes: 384
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int d = sc.nextInt();
    
    if (Math.abs(c-a) <= d || Math.abs(b-a) <= d && Math.abs(c-b) <= d) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
}

Measured memory_bytes: 21844
package main

import "fmt"

func main() {
	var N int
	var S, T string
	fmt.Scan(&N, &S, &T)
	v := ""
	for i := 0; i < N; i++ {
		v += S[i:i+1] + T[i:i+1]
	}
	fmt.Println(v)
}


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

using namespace std;

int main()
{
	uint64_t N;
	cin >> N;
	uint64_t sum = 0;
	for (uint64_t a = 1; a < sqrt(N); ++a)
	{
		if ((N - a) % a == 0)
		{
			auto m = (N - a) / a;
			if (m > a)
			{
				sum += m;
			}
		}
	}

	cout << sum;
}

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

int main(void){
  int i;
  char s[20], t[20];

  scanf("%s", &s);
  scanf("%s", &t);

  //printf("%d", sizeof(s));

  for(i = 0; s[i] == t[i] && i < strlen(s); i++){

  }

  if(i == strlen(s)){
    printf("Yes");
  }else{
    printf("No");
  }

}


Measured memory_bytes: 1716