akhauriyash/Code-Regression huggingface dataset:
using static System.Math;
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System;

class Program
{
    #region Reader
    static string ReadStr => Console.ReadLine();
    static string[] ReadStrs => Console.ReadLine().Split(' ');
    static int ReadInt => Convert.ToInt32(Console.ReadLine().Trim());
    static int[] ReadInts => Console.ReadLine().Trim().Split(' ').Select(s => Convert.ToInt32(s)).ToArray();
    static long ReadLong => Convert.ToInt64(Console.ReadLine().Trim());
    static long[] ReadLongs => Console.ReadLine().Trim().Split(' ').Select(s => Convert.ToInt64(s)).ToArray();
    #endregion
    #region Method
    const int mod = 1000000007;
    public static int Mod(int a, int mod) { return a % mod >= 0 ? a % mod : a % mod + mod; }
    public static long Mod(long a, long mod = mod) { return a % mod >= 0 ? a % mod : a % mod + mod; }
    #endregion





    /// <summary>
    /// 最大公約数
    /// </summary>
    /// <param name="a"></param>
    /// <param name="b"></param>
    /// <returns></returns>
    public static long Gcd(long a, long b)
    {
        if (a < b)
            // 引数を入替えて自分を呼び出す
            return Gcd(b, a);
        while (b != 0)
        {
            var remainder = a % b;
            a = b;
            b = remainder;
        }
        return a;
    }



    public static Dictionary<int, int> PrimeFactors(int n)
    {
        int i = 2;
        int tmp = n;
        Dictionary<int, int> d = new Dictionary<int, int>();

        while (i * i <= n) //※1
        {
            if (tmp % i == 0)
            {
                tmp /= i;
                if (d.ContainsKey(i)) d[i]++;
                else d.Add(i, 1);
            }
            else
            {
                i++;
            }
        }
        if (tmp != 1)
        {
            if (d.ContainsKey(tmp)) d[tmp]++;
            else d.Add(tmp, 1);
        }
        return d;
    }


    #region Mod
    public static long GetInv(long a, long mod = 1000000007)
    {
        return PowerMod(a, mod - 2, mod);
    }
    public static long Combination(long a, long b, long mod = 1000000007)
    {
        if (b < 0 || b > a) return 0;
        if (b > a / 2) b = a - b;
        long numerator = Factorial(a, mod);
        long denominator = (Factorial(b, mod) * Factorial(a - b, mod)) % mod;

        return (numerator * GetInv(denominator, mod)) % mod;
    }
    public static long Factorial(long n, long mod = 1000000007)
    {
        if (n == 0) return 1;
        if (n == 1) return 1;
        long ans = n;
        for (int i = 2; i < n; i++)
        {
            ans = (ans * i) % mod;
        }

        return ans;
    }
    private static long PowerMod(long a, long n, long mod = 1000000007)
    {
        if (n == 0) return 1;
        if (n == 1) return a;

        long p = PowerMod(a, n / 2, mod);
        if (n % 2 == 1) return ((p * p) % mod * a) % mod;
        else return (p * p) % mod;
    }
    #endregion

    static void Main()
    {
        string s = ReadStr;




        WriteLine(s[s.Length-1] == 's'?s+"es":s+"s");
    }
}



Measured memory_bytes: 25848
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<set>
#include<stack>
#include<iomanip>
#include<algorithm>
#include<unordered_map>
#include <numeric>
#include<string_view>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define all(i) i.begin(),i.end()
template<typename T =ll> using v = vector<T>;
template<typename T =ll> using vv = v<v<T>>;
template<typename T =ll,typename U =ll> using p = pair<T,U>;
template<typename T> T chmin(T &a,T b) {return a=min(a,b);}
template<typename T> T chmax(T &a,T b) {return a=max(a,b);}
const ll INF = (ll)1e9;
template <int MOD>
struct ModInt {
    using lint = long long;
    int val;

    // constructor
    ModInt(lint v = 0) : val(v % MOD) {
        if (val < 0) val += MOD;
    };

    // unary operator
    ModInt operator+() const { return ModInt(val); }
    ModInt operator-() const { return ModInt(MOD - val); }
    ModInt inv() const { return this->pow(MOD - 2); }

    // arithmetic
    ModInt operator+(const ModInt& x) const { return ModInt(*this) += x; }
    ModInt operator-(const ModInt& x) const { return ModInt(*this) -= x; }
    ModInt operator*(const ModInt& x) const { return ModInt(*this) *= x; }
    ModInt operator/(const ModInt& x) const { return ModInt(*this) /= x; }
    ModInt pow(lint n) const {
        auto x = ModInt(1);
        auto b = *this;
        while (n > 0) {
            if (n & 1) x *= b;
            n >>= 1;
            b *= b;
        }
        return x;
    }

    // compound assignment
    ModInt& operator+=(const ModInt& x) {
        if ((val += x.val) >= MOD) val -= MOD;
        return *this;
    }
    ModInt& operator-=(const ModInt& x) {
        if ((val -= x.val) < 0) val += MOD;
        return *this;
    }
    ModInt& operator*=(const ModInt& x) {
        val = lint(val) * x.val % MOD;
        return *this;
    }
    ModInt& operator/=(const ModInt& x) { return *this *= x.inv(); }

    // compare
    bool operator==(const ModInt& b) const { return val == b.val; }
    bool operator!=(const ModInt& b) const { return val != b.val; }

    // I/O
    friend std::istream& operator>>(std::istream& is, ModInt& x) noexcept { return is >> x.val; }
    friend std::ostream& operator<<(std::ostream& os, const ModInt& x) noexcept { return os << x.val; }
};

constexpr int MOD = 1e9 + 7;
using mint = ModInt<MOD>;
void a(){
    ll N,X,T; cin >> N >> X >> T;
    cout << N/X*T+(N%X!=0?T:0) << endl;
}

void b(){
    char c='0';
    ll num = 0;
    while('0'<=c&&c<='9'){
        scanf("%c",&c);
        if(c-'0'<0) break;
        num+=c-'0';
        num%=9;
    }

    if(num==0){
        cout << "Yes"<<endl;
    }else{
        cout << "No"<<endl;
    }
}

void c(){

}


void d(){

}

int main(void){
    b();
    return 0;
 }

Measured memory_bytes: 3728
#include <stdio.h>

int main(void) {
	// your code goes here
	int a,n,i,min=1000000,max=-1000000;
	long int sum=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a);
		if(min>a){
			min=a;
		}
		if(max<a){
			max=a;
		}
		sum+=a;
	}
	printf("%d %d %ld\n",min,max,sum);
	return 0;
}



Measured memory_bytes: 2124
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String A = sc.next();
    String B = sc.next();
    int count = 0;
    for(int i = 0; i<A.length();i++){
      if(A.charAt(i) != B.charAt(i)){
        count++;
      }
    }
    System.out.println(count);
  }
}


Measured memory_bytes: 41180
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod = 1000000007;

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

template<class Type>
Type modpow(Type a, Type n, Type mod)
{
	Type res = 1;
	while (0 < n)
	{
		if (n & 1)
		{
			res = res * a % mod;
		}
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

template<class Type>
Type gcd(Type x, Type y)
{
	Type r;
	if (x < y)
	{
		swap(x, y);
	}

	while (0 < y)
	{
		r = x % y;
		x = y;
		y = r;
	}
	return x;
}

template<class Type>
Type lcm(Type x, Type y)
{
	return x * y / gcd(x, y);
}

template<class Type>
bool isPrime(Type x)
{
	if (x == 2) return true;
	if (x < 2 || x % 2 == 0) return false;

	for (Type i = 3; i <= sqrt(x); i += 2)
	{
		if (x % i == 0) return false;
	}
	return true;
}

template<class Type>
vector<bool> eratos(Type n)
{
	vector<bool> isPrime(n + 1, true);
	isPrime[0] = isPrime[1] = false;
	for (Type i = 2; i <= n; i++)
	{
		if (isPrime[i])
		{
			Type j = i + i;
			while (j <= n)
			{
				isPrime[j] = false;
				j = j + i;
			}
		}
	}
	return isPrime;
}

bool binarySearchJudge(vector<int> a, int index, int key)
{
	if (key <= a[index]) return true;
	else return false;
}

int binarySearch(vector<int> a, int key)
{
	int ng = -1;
	int ok = a.size();
	while (1 < abs(ng - ok))
	{
		int mid = (ng + ok) / 2;
		if (binarySearchJudge(a, mid, key)) ok = mid;
		else ng = mid;
	}
	return a[ok] == key;
}

template<class Type>
bool is_prime(Type n)
{
	if (n == 2) return true;
	if (n < 2 || n % 2 == 0) return false;
	for (int i = 3; i <= sqrt(n); i++)
	{
		if (n % i == 0) return false;
	}
	return true;
}

int main()
{
	int x;
	cin >> x;
	while (!is_prime(x)) x++;
	cout << x << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#define INFTY 1000000
#define WHITE 0
#define GRAY 1
#define BLACK 2

int n,M[100][100];
int prim(){
  int i,v,u,sum=0,mincost,d[100],color[100],p[100];
  for(i=0;i<n;i++){
    d[i]=INFTY;
    p[i]=-1;
    color[i]=WHITE;
  }
  d[0]=0;
  while(1){
    mincost=INFTY;
    for(i=0;i<n;i++){
      if(color[i]!=BLACK&&d[i]<mincost){
	mincost=d[i];
	u=i;
      }
    }
    if(mincost==INFTY)break;
    color[u]=BLACK;

    for(v=0;v<n;v++){
      if(color[v]!=BLACK&&M[u][v]!=-1){
	if(M[u][v]<d[v]){
	  d[v]=M[u][v];
	  p[v]=u;
	  color[v]=GRAY;
	}
      }
    }
  }
  for(i=0;i<n;i++){
    if(p[i]!=-1)sum+=M[i][p[i]];
  }
  return sum;
}

int main(){
  int i,j;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      scanf("%d",&M[i][j]);
    }
  }
  printf("%d\n",prim());

  return 0;
}



Measured memory_bytes: 2104
#include <iostream>
#include <string>
#include <regex>

using namespace std;

int main()
{
  string s_a, s_b, s_reg;

  cin >> s_a;
  cin.ignore();
  cin >> s_b;

  for (int i = 0; i != s_b.size(); i++) {
    if (s_b[i] != '_') {
      s_reg += s_b[i];
    } else {
      s_reg += "[A-Z]";
    }
  }

  regex_search(s_a, regex(s_reg)) ?
    cout << "Yes" << endl : cout << "No" << endl;
}



Measured memory_bytes: 3536
#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int A=in(),B=in();
	
	out(max(A-2*B,0));
	return 0;
}

Measured memory_bytes: 384
import java.io.*;
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.StringTokenizer; 
import java.util.*;


public  class Main 
{

	   
	   static class FastReader 
	    { 
	        BufferedReader br; 
	        StringTokenizer st; 
	       
	  
	        public FastReader() 
	        { 
	            br = new BufferedReader(new
	                     InputStreamReader(System.in)); 
	        } 
	  
	        String next() 
	        { 
	            while (st == null || !st.hasMoreTokens()) 
	            { 
	                try
	                { 
	                    st = new StringTokenizer(br.readLine()); 
	                } 
	                catch (IOException  e) 
	                { 
	                    e.printStackTrace(); 
	                } 
	            } 
	            return st.nextToken();
	            
	        } 
	  
	        int nextInt() 
	        { 
	            return Integer.parseInt(next()); 
	        } 
	  
	        long nextLong() 
	        { 
	            return Long.parseLong(next()); 
	        } 
	  
	        double nextDouble() 
	        { 
	            return Double.parseDouble(next()); 
	        } 
	  
	        String nextLine() 
	        { 
	            String str = ""; 
	            try
	            { 
	                str = br.readLine(); 
	            } 
	            catch (IOException e) 
	            { 
	                e.printStackTrace(); 
	            } 
	            return str; 
	        }

			public Character charAt(int i) {
				// TODO Auto-generated method stub
				return null;
			} 
	    } 

  

	  // Complete the hurdleRace function below.
//    public static void solve() {
//    	FastReader s=new FastReader();

   
    public static void main(String[] args) throws IOException {
    	FastReader s=new FastReader();
    	int n = s.nextInt();
    	if(n%10==2 || n%10==4 || n%10==5 || n%10==7 || n%10==9)System.out.println("hon");
    	else if(n%10==0 || n%10==1 || n%10==6 || n%10==8)System.out.println("pon");
    	else if(n%10==3)System.out.println("bon");

		

    	
    }	
}



Measured memory_bytes: 32696
//#include "stdafx.h"
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <string>
#include <cstring>
#include <functional>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <tuple>
#include <numeric>
#include <assert.h>
#include <functional>
#include <unordered_map>

using namespace std;

/*-----------------------------------------------------------------------------
　定義
 -------------------------------------------------------------------------------*/
#define REP(i, n)				for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n)			for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define INF						2e9
#define MOD						(1000 * 1000 * 1000 + 7)
#define Ceil(x, n)				(((((x))+((n)-1))/n))		/* Nの倍数に切り上げ割り算 */
#define CeilN(x, n)				(((((x))+((n)-1))/n)*n)		/* Nの倍数に切り上げ */
#define FloorN(x, n)			((x)-(x)%(n))				/* Nの倍数に切り下げ */
#define IsOdd(x)				(((x)&0x01UL) == 0x01UL)			
#define IsEven(x)				(!IsOdd((x)))						
#define	BitSetV(Val,Bit)		((Val) |= (Bit))			
#define	BitTstV(Val,Bit)		((Val) & (Bit))				
#define ArrayLength(x)			(sizeof( x ) / sizeof( x[ 0 ]))
#define	MAX_QWORD				((QWORD)0xFFFFFFFFFFFFFFFF)
#define	MIN_QWORD				((QWORD)0x0000000000000000)
#define	MAX_SQWORD				((SQWORD)0x7FFFFFFFFFFFFFFF)
#define	MIN_SQWORD				((SQWORD)0x8000000000000000)
#define M_PI					3.14159265358979323846
typedef long long				ll;
typedef unsigned long			DWORD;
typedef unsigned long long int	QWORD;
typedef pair<ll, ll>			P;

/*-----------------------------------------------------------------------------
　処理
 -------------------------------------------------------------------------------*/
/* 素因数分解 */
map<ll, ll> factMap;
void primeFactor(ll n)
{
    if ((n % 2) == 0){
        while((n % 2) == 0) {
            factMap[2]++;
            n = n / 2;
        }
    }

    for(ll i = 3; (i * i) <= n; i += 2){
        while ((n % i) == 0){
            factMap[i]++;
            n = n / i;
        }
    }

	if (n != 1) {
		factMap[n]++;
	}
}


// テーブルを作る前処理
const int MAX = 2 * 1000 * 1000;
long long fac[MAX], finv[MAX], inv[MAX];
void CombInit() 
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算(nCk)
long long CombExec(int n, int k)
{
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

// メイン
int main()
{
	// 入力
	ll N, M;
	cin >> N >> M;

	// 素因数分解
	primeFactor(M);

	// コンビネーション
	// 各素数をN分割した結果(n+k-1Ck)の組み合わせ(乗算)
	ll ans = 1;
	CombInit();
	for (auto one : factMap) {
		ans *= CombExec(N + one.second - 1, one.second);
		ans %= MOD;
	}

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



Measured memory_bytes: 47104
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <string>
#include <cmath>
using namespace std;
#define MOD 1000000007
#define INF 1<<30
#define LINF (ll)1<<62
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> P;
typedef vector<pair<ll, ll>> vpl;
 
int main(){
    ll n; cin >> n;
    vl a(n);
    rep(i,n) cin >> a[i];
    if(n % 2 == 1){
        ll index = n-1;
        while(index >= 0){
            cout << a[index] << " ";
            index -= 2;
        }
        index += 3;
        while(index <= n-2){
            cout << a[index] << " ";
            index += 2;
        }
    }else{
        ll index = n-1;
        while(index >= 1){
            cout << a[index] << " ";
            index -= 2;
        }
        index++;
        while(index <= n-2){
            cout << a[index] << " ";
            index += 2;
        }
    }
}

Measured memory_bytes: 3712
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        for(;;x++){
            if(isPrime(x)) break;
        }
        System.out.println(x);
    }
    public static boolean isPrime(int x){
        if((x%2==0 && x!=2||x==1)) return false;
        for(int i=3; i<=Math.sqrt(x); i+=2){
            if(x % i == 0) return false;
        }
        return true;
    }
}

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

using namespace std;

typedef long long ll;
typedef vector<ll> vll;

#define pb push_back

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define vin(v, n) for (int i = 0; i < (ll)(n); i++) cin >> (v)[i];

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

    int x1,x2,x3,x4,x5;
    cin>>x1>>x2>>x3>>x4>>x5;
    if(x1==0)
        cout<<1;
    else if(x2==0)
        cout<<2;
    else if(x3==0)
        cout<<3;
    else if(x4==0)
        cout<<4;
    else if(x5==0)
        cout<<5;
}


Measured memory_bytes: 3600
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            int N = sc.nextInt();
            long M = sc.nextLong();
            long[] A = new long[N];
            for (int i = 0; i < N; i++) {
                A[i] = sc.nextLong() / 2;
            }

            long lcm = 1;
            for (int i = 0; i < N; i++) {
                lcm = lcm(lcm, A[i]);
                if (lcm > M) {
                    System.out.println(0);
                    return;
                }
            }

            for (int i = 0; i < N; i++) {
                if ((lcm / A[i]) % 2 == 0) {
                    System.out.println(0);
                    return;
                }
            }

            long ans = (M / lcm + 1) / 2;

            System.out.println(ans);
        }
    }

    public static long gcd(long M, long N) {
        if (M < N) {
            return gcd(N, M);
        }
        return N > 0 ? gcd(N, M % N) : M;
    }

    public static long lcm(long M, long N) {
        return M * N / gcd(M, N);
    }

}


Measured memory_bytes: 58868
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; }
template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

ll n;
V< P<ll, ll> > rc;
vvll dp;

ll rec(ll l, ll r) {
    if (l == r) return dp[l][r] = 0;
    if (dp[l][r] != HIGHINF) return dp[l][r];
    for (ll i = l; i <= r - 1; i++) {
        chmin(dp[l][r], rec(l, i) + rec(i + 1, r) + rc[l].first * rc[i].second * rc[r].second);
    }
    return dp[l][r];
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    rc.resize(n);
    for (ll i = 0; i < n; i++) cin >> rc[i].first >> rc[i].second;
    dp.resize(n, vll(n, HIGHINF));
    cout << rec(0, n - 1) << '\n';

    // for (ll i = 0; i < n; i++) DEBUG_VLL(dp[i])
    return 0;
}



Measured memory_bytes: 3280
import java.util.Scanner;

public class Main {

	public static final long CONST = 100000007L;

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int numA = scan.nextInt();
		int numB = scan.nextInt();

		int count = 0;
		int max = 1;

		if (numB != 1) {
			count++;
			max = numA;
			while (true) {
				if (max >= numB) {
					break;
				}
				count++;
				max += numA - 1;
			}
		}
		System.out.println(count);
	}
}


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

int main()
{
  bool chk=true;
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i=0; i<N; i++)
  {
    cin >>A.at(i);
  }
  for(int i=0; i<N; i++)
  {
    if((A.at(i)%2==0)&&(A.at(i)%3!=0)&&(A.at(i)%5!=0))
    {
      chk=false;
    }
  }
  if(chk)
  {
    cout << "APPROVED" <<endl;
  }
  else
  {
    cout << "DENIED" <<endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define f(i,a,n) for(int i=a ; i<n ; i++)
#define inf 1e17
#define MAX_SIZE 1000005 

void pr(int arr[], int size) 
{ for (ll i=0; i < size; i++) {printf("%d ", arr[i]); }cout << endl;}

int main () {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  
  ll n , k;
  cin >> n >> k;
  ll a[n+1];
  for(ll i = 1;i < n+1;i++){
      cin >> a[i];
  }
  ll xi[n+1] = {};
  for(ll i = 0;i < k;i++){
      ll x , y;
      cin >> x >> y;
      if(a[x] == a[y]){
          xi[x]++;
          xi[y]++;
      }
      if(a[x] < a[y]){
          xi[x]++;
      }
      if(a[x] > a[y]){
          xi[y]++;
      }
  }
  ll cnt = 0;
  for(ll i = 1 ;i < n+1;i++){
      if(xi[i] == 0){
        //   cout << i << " ";
          cnt++;
      }
  }
  cout << cnt << endl;
  
    
  return 0;
}


Measured memory_bytes: 5204
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int a, b, c, d;
  		cin >> a;
  
  		b = a%10; // 1の位 //
          c = (a-b)%100/10; //10の位 //
          d = (a-b-c)/100; //100の位//
  			cout << b+c+d << endl;
}

Measured memory_bytes: 256
(function(input) {
    var p = input.split('\n');
    while (true) {
        var n = Number(p.shift());
        if (n === 0) {
            return;
        }
        var s = p.shift().split(' ', n).map(Number);
        console.log(standardDeviation(s));
    }

})(require('fs').readFileSync('/dev/stdin', 'utf8'));

function mean(a) {
    return a.reduce(function(a, b) {
        return a + b;
    }) / a.length;
}

function variance(a) {
    var m = mean(a);
    var v = 0;
    a.forEach(function(e) {
        v += Math.pow(e - m, 2) / a.length;
    });
    return v;
}

function standardDeviation(a) {
    return Math.sqrt(variance(a));
}

Measured memory_bytes: 8672
#include <bits/stdc++.h>
using namespace std;
constexpr int MAX_N = 1E6, MOD = 1E9 + 7;
int sum(int a, int b) {return (a += b) >= MOD ? a -= MOD : a;}
int power(int a, int b) {
    int ans = 1;
    while (b > 0) {
        if (b & 1)
            ans = 1LL * ans * a % MOD;
        a = 1LL * a * a % MOD;
        b >>= 1;
    }
    return ans;
}
int n;
int f[MAX_N + 1][3], fac[MAX_N + 1], facinv[MAX_N + 1], inv[MAX_N + 1];
int binom(int n, int m) {return 1LL * fac[n] * facinv[m] % MOD * facinv[n - m] % MOD;}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    fac[0] = 1;
    for (int i = 1; i <= n; ++i)
        fac[i] = 1LL * fac[i - 1] * i % MOD;
    facinv[n] = power(fac[n], MOD - 2);
    for (int i = n; i >= 1; --i)
        facinv[i - 1] = 1LL * facinv[i] * i % MOD;
    for (int i = 1; i <= n; ++i)
        inv[i] = 1LL * facinv[i] * fac[i - 1] % MOD;
    f[0][0] = 1;
    for (int i = 1; i <= n; ++i) {
        f[i][0] = sum(f[i - 1][1], f[i - 1][2]);
        f[i][1] = sum(f[i - 1][0], f[i - 1][2]);
        f[i][2] = sum(f[i - 1][0], f[i - 1][1]);
    }
    int ans = 0;
    for (int i = 1; i <= n; ++i)
        ans = (ans + 1LL * f[i][1] * binom(n, i) % MOD * inv[i]) % MOD;
    cout << 1LL * ans * power(3, MOD - 1 - n) % MOD * power(n, MOD - 2) % MOD << "\n";
    return 0;
}

Measured memory_bytes: 23680
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i];if(i<len-1) s<<" ";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i]<<endl;
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){
	s<<"{ ";
	for(auto itr=v.begin();itr!=v.end();++itr) {
		if (itr!=v.begin()) {s<< ", ";}
		s<<(*itr);
	}
	s<<" }";
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){
	s<<"{"<<endl;
	for(auto itr=m.begin();itr!=m.end();++itr){
		s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;
	}
	s<<"}"<<endl;
	return s;
}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	cin>>s;
	rep(i,s.size()-1){
		if(s[i]=='A' && s[i+1]=='C'){
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout<<"No"<<endl;
}

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

int main()
{
	int N;
	scanf("%d",&N);
	char x[20];
	char *u;
	u = (char *)malloc(sizeof(char)*3);
	double sum = 0;
	for ( int i = 0; i < N; i++ ) {
		scanf("%s %s",x,u);
		if ( u[0] == 'J' ) {
			sum += atoi(x);
		} else {
			sum += atof(x) * 380000.0;
		}
	}
	printf("%f\n",sum);
  	free(u);
	return 0;
}

Measured memory_bytes: 128
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
fn main(){
    input!{
        n:i64,
        m:i64,
        abn:[(i64,i64);n],
    }
    let mut abn = abn;
    abn.sort_by_key(|k| k.0);
    let mut ans = (m,0);
    for &(cost,num) in &abn{
        if ans.0 < num {
            ans = (0, ans.1 + ans.0*cost);
        } else {
            ans = (ans.0-num,ans.1 + cost*num);
        }
    }
    println!("{}",ans.1);
}

Measured memory_bytes: 6396
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();

        if(a <= b){
            System.out.println(a);
        }else{
            System.out.println(a-1);
        }

    }
}

Measured memory_bytes: 23764
#include <iostream>
using namespace std;
int main(){
int a,b,c;
  cin >> a>>b>>c;
  int sum = a+b+c;
int max = 0;
if(a>=b && a>=c) max = (a*9+sum);
else if(b>=a && b>=c) max =(b*9+sum);
else max = (c*9+sum);
cout << max << endl;
  return 0;
}


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

#define ll long long
#define fr first
#define se second

using namespace std;

const long long N = 2e6 + 7;

int res;
int main()
{
        string s;
        cin >> s;
        string t;
        cin >> t;
        for ( int i=0; i<s.size(); i++ ){
            if ( s[i] != t[i] ){
                cout << "No";
                return 0;
            }
        }
        cout << "Yes";
}


Measured memory_bytes: 3628
n,m = map(int, input().split())
p = list(map(int,input().split()))
d = [list() for _ in range(n+1)]
cnt = 0
for _ in range(m):
  x,y = map(int, input().split())
  d[x].append(y)
  d[y].append(x)
gr = [0]*(n+1)
gr[0] = -1
gn = 0
for x in range(1,n+1):
  if gr[x] == 0:
    gn += 1
    gr[x] = gn
    l = [x]
    while l:
      cur = l.pop()
      for i in d[cur]:
        if i not in l and gr[i] == 0:
          gr[i] = gn
          l.append(i)
for i in range(n):
  if gr[i+1] == gr[p[i]]:
    cnt += 1
print(cnt)

Measured memory_bytes: 71276
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const ll inf = numeric_limits<ll>::max()/3;

int n,m;
vector< string > a(n);
vector< string > b(m);

bool ok(int p,int q){
  for(int i = 0;i < m;++i){
    for(int j = 0;j < m;++j){
      if(b[i][j] == '#' && a[p+i][p+j] == '.')
        return false;
    }
  }
  return true;
}


int main(void){
  cin >> n >> m;
  a.clear();b.clear();
  a.resize(n);b.resize(m);
  for(int i = 0;i < n;++i){
    cin >> a[i];
  }
  for(int i = 0;i < m;++i){
    cin >> b[i];
  }
  for(int p = 0;p + m - 1 < n;++p){
    for(int q = 0;q + m - 1 < n;++q){
      if(ok(p,q)){
        puts("Yes");
        return 0;
      }
    }
  }
  puts("No");
  return 0;
}



Measured memory_bytes: 256
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization("unroll-loops")

#include "bits/stdc++.h"
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define endl '\n'
#define f first
#define s second
#define IO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define cf ll testcases;cin>>testcases;while(testcases--)
#define prn(x) if(x) cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define minel(x) (*min_element(all(x)))
#define maxel(x) (*max_element(all(x)))
#define cou dbg=1;cout
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pi;
typedef vector<ll> vi;
typedef vector<ld> vd;
typedef vector<pi> vp;
ll dbg=0;
template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p);
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v);
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p);
template<typename A> istream& operator>>(istream& cin, vector<A> &v);
int dx[] = {-1, -1, -1,  0, 0,  1, 1, 1};
int dy[] = {-1,  0,  1, -1, 1, -1, 0, 1};

void solve(){
    string s;
    cin>>s;
    ll sum=0;
    for(ll i=0;i<s.size();i++){
        sum+=s[i]-'0';
    }
    if(sum%9==0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
}

int main(){
    IO;
    // cf
    solve();
    return 0;
}


template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { 
    if(dbg){
        dbg=0;
        return cout << "(" << p.f << ", " << p.s << ")"; 
    }else{
        return cout<<p.f<<' '<<p.s;
    }}
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
    if(dbg){
        dbg=0;
        cout << "["; for(ll i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";
    }else{
        for(ll i=0;i<v.size()-1;i++) cout<<v[i]<<' ';
        return cout<<v[v.size()-1];
    }
}
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p) {
   cin >> p.first;
   return cin >> p.second;
}
template<typename A> istream& operator>>(istream& cin, vector<A> &v) {
   for(ll i=0;i<v.size()-1;i++) cin>>v[i];
   return cin >> v[v.size()-1];
}

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

int main() {
    int N;
    cin >> N;
    
    vector<int> vec(N);
    for (int i = 0; i < N; i++){
        int a;
        cin >> a;
        vec.at(i) = a;
    }
    
    int M = 0;
    
    for (int i = 0; i < N; i++){
        if (vec.at(i) > M){
            M = vec.at(i);
        }
    }
    
    
    int times = 1;
    int bottom = M;
    
    for (int k = 0; k < N; k++){
        
        M = 0;
    
      for (int i = 0; i < N; i++){
          if (M < vec.at(i) && vec.at(i) < bottom){
              M = vec.at(i);
          }
      }

    if (M != bottom && M != 0){
        bottom = M;
        times++;
        
      }
    }
    
    cout << times << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IOS {ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);}
#define endl "\n"
#define float long double
#define int long long int
#define f(i, a, b) for(int i=a; i<b; i++)
#define fb(i, a, b) for(int i=a; i>=b; i--)
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define LB lower_bound
#define UB upper_bound
#define g(t, n) get<n>(t)
#define fp(x, y) fixed<<setprecision(y)<<x
#define PI 3.141592653589793238462643383279502884
using namespace std;

const int M = (int)2e5+5;
const int mod = (int)1e9+7;

int visited[M], curr = 0;
vi adj[M];

void dfs(int v)
{
	visited[v] = 1;
	curr++;
	for(auto x : adj[v])
	{
		if(!visited[x])
		{
			dfs(x);
		}
	}
}

void solve()
{
	int n, m, ans = 0;
	cin>>n>>m;
	int u, v;
	f(i, 0, m)
	{
		cin>>u>>v;
		u--, v--;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	f(i, 0, n)
	{
		if(!visited[i])
		{
			curr = 0;
			dfs(i);
			ans = max(ans, curr);
		}
	}
	cout<<ans<<endl;
}

int32_t main()
{
    IOS
    int t = 1;
    // cin>>t;
    f(tno, 1, t+1)
    {
        // cout<<"Case #"<<tno<<": ";
        solve();
    }
    return 0;
}

Measured memory_bytes: 22396
import itertools
N,M=map(int,input().split())
m=[[0 for i in range(N)] for i in range(N)]
for i in range(M):
    a,b=map(int,input().split())
    m[a-1][b-1]+=1
    m[b-1][a-1]+=1
S=list(itertools.permutations(range(1,N),N-1))
#print(S)
T=0
for sg in S:
    root=[0]
    for i in sg:
        root.append(i)
    flag=0
    for i in range(N-1):
        if m[root[i+1]][root[i]]==0:
            flag=1
            break
    if flag==0:
        T+=1
print(T)


Measured memory_bytes: 3700
import sys
input=sys.stdin.readline
a,b,q=map(int,input().split())
s=[-10**11]
t=[-10**11]
for i in range(a):
	s.append(int(input()))
s.append(10**11)
for i in range(b):
	t.append(int(input()))
t.append(10**11)
import bisect
for i in range(q):
	x=int(input())
	s_l=bisect.bisect_left(s,x)
	t_l=bisect.bisect_left(t,x)
	ans1=x-min(s[s_l-1],t[t_l-1])
	ans2=max(s[s_l],t[t_l])-x
	ans3=min(s[s_l]-x,x-t[t_l-1])+s[s_l]-t[t_l-1]
	ans4=min(t[t_l]-x,x-s[s_l-1])+t[t_l]-s[s_l-1]
	print(min(ans1,ans2,ans3,ans4))

Measured memory_bytes: 12200
#include <stdio.h>
#include <iostream>
#define NUM 100000

int x[NUM];
int y[NUM];
int memo[NUM];

int culc_height(int p, int D){
    if(memo[p] == -1){
        if(p <= D){
            memo[p] = 0;
        }else{
            memo[p] = culc_height(p - D, D) + abs(x[p] - x[p - D]) + abs(y[p] - y[p - D]);
        }
    }
    return memo[p];;
}

int main(void){
    for(int i = 0; i < NUM; i++){
            memo[i] = -1;
    }

    int H;
    int W;
    int D;
    scanf("%d", &H);
    scanf("%d", &W);
    scanf("%d", &D);

    int a;
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            scanf("%d", &a);
            x[a] = j;
            y[a] = i;
        }
    }

    int Q;
    scanf("%d", &Q);

    for(int i = 0; i < Q; i++){
        int L, R;
        scanf("%d", &L);
        scanf("%d", &R);
        printf("%d\n", culc_height(R, D) - culc_height(L, D));
    }
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } }
#define INF 2e9
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef pair<int, int> p;
typedef priority_queue<p> pq;
typedef priority_queue<p, vector<p>, greater<p>> gpq;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    string s;
    cin >> n >> s;

    int ans = 0;
    char prev = 'A';
    REP(i, n)
    {
        char cur = s[i];

        if(prev != cur)
        {
            ans++;
        }
        prev = cur;
    }

    cout << ans << endl;
}

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

int main(){
	int a, b, n;

	cin >> a >> b;

	n = a + b;

	if( n % 3 == 0 )
		cout << "Possible" << endl;

	else if( a % 3 == 0)
		cout << "Possible" << endl;

	else if( b % 3 == 0)
		cout << "Possible" << endl;

	else
		cout << "Impossible" << endl;


	return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <unordered_map>
#include <map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
using namespace std;
typedef long long ll;

string S,T;

int main(){
    cin>>S>>T;

    rep(i,S.size()){
        char x=S[S.size()-1];
        S.pop_back();
        S=x+S;
        if(S==T){
            cout<<"Yes"<<endl;
            return 0;
        }
    }

    cout<<"No"<<endl;
}

Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

const int MAX_N = 200000;
int n, k;
int a[MAX_N];

bool check(int m) {
    int total = 0;
    for (auto x : a) {
        if (x > m) {
            if (x % m == 0)
                total += x / m - 1;
            else
                total += x / m;
        }
    }

    return total <= k;
}

int main() {
    fastio();

    cin >> n >> k;

    forn(i, n) {
        cin >> a[i];
    }

    int l = 0, r = TEN(9);
    while (r - l > 1) {
        int m = (l + r) / 2;
        if (check(m)) {
            r = m;
        } else {
            l = m;
        }
    }

    cout << r << endl;

    return 0;
}

Measured memory_bytes: 4404
#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)
#define ALL(obj) (obj).begin(), (obj).end()
#define sz(v) (int)v.size()
#define pb push_back

using namespace std;
typedef long long ll;
string S;
ll K;
int main(){
    cin >> S >> K;
    int ct = 0;
    rep(i,sz(S)){
        if(S[i] == '1') ct++;
        else break;
    }
    
    if(K <= ct) cout << 1 << endl;
    else cout << S[ct] << endl;
    
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>

#include <stdio.h>
using namespace std;

int main(void) {
	double a, b, c;
	double C;
	double S, L, h;
	cin >> a >> b >> C;
	S = 0.5 * a * b * sin(C * M_PI / 180.);
	c = sqrt(a * a + b * b - 2. * a * b * cos(C * M_PI / 180.));
	L = a + b + c;
	h = 2. * S / a;
	printf("%.7f\n", S);
	printf("%.7f\n", L);
	printf("%.7f\n", h);
	return 0;
}



Measured memory_bytes: 3576
import sys
input = sys.stdin.buffer.readline
import heapq

def main():
    N = int(input())
    a = list(map(int,input().split()))

    l = a[:N]
    heapq.heapify(l)
    ls = sum(l)
    use = [ls]
    for i in range(N):
        num = a[N+i]
        ln = heapq.heappop(l)
        if ln > num:
            heapq.heappush(l,ln)
        else:
            heapq.heappush(l,num)
            ls += num-ln
        use.append(ls)

    b = []
    for num in a[::-1]:
        b.append(-1*num)
        
    r = b[:N]
    heapq.heapify(r)
    rs = sum(r)
    use[-1] += rs
    for i in range(N):
        num = b[N+i]
        rn = heapq.heappop(r)
        if rn < num:
            heapq.heappush(r,num)
            rs += (num-rn)
        else:
            heapq.heappush(r,rn)
        use[-i-2] += rs

    print(max(use))
    
if __name__ == "__main__":
    main()


Measured memory_bytes: 34856
#include <cstdio>
#include <cstdint>
#include <algorithm>
#include <vector>

int testcase_ends() {
  int n;
  scanf("%d", &n);

  int h;
  scanf("%d", &h);
  int des=0, asc=0;

  for (int i=1; i<n; ++i) {
    int hh;
    scanf("%d", &hh);
    if (h < hh) {
      asc = std::max(asc, hh-h);
    } else if (h > hh) {
      des = std::max(des, h-hh);
    }
    h = hh;
  }

  printf("%d %d\n", asc, des);
  return 0;
}

int main() {
  int t;
  scanf("%d", &t);
  for (int i=0; i<t; ++i)
    testcase_ends();
}



Measured memory_bytes: 2684
def is_bipartite(graph, start, n):
    stack = [start]
    visited = [-1] * (n+1)
    visited[start] = 0
    while stack:
        u = stack.pop()
        for v,w in graph[u].items():
            if visited[v] != -1:
                continue
            visited[v] = (visited[u] ^ 1) if w % 2 else visited[u]
            stack.append(v)
    return visited

n = int(input())
graph = {}

for i in range(n-1):
    u,v,w = map(int , input().split())
    if u not in graph:
        graph[u] = {}
    if v not in graph:
        graph[v] = {}
    graph[u][v] = w
    graph[v][u] = w

[print(color) for color in is_bipartite(graph, 1, n) if color > -1]


Measured memory_bytes: 51148
from operator import itemgetter
import sys
sys.setrecursionlimit(1000000)
ans=0

n=int(input())
a=[]
b=[]
c=0
for i in input().split():
    x=int(i)
    if x<0:
        c+=1
    a.append(x)
    b.append(abs(x))

b.sort()
ans=sum(b[1:])
if c%2==1:
    ans+=-b[0]
else:
    ans+=b[0]
print(ans)


Measured memory_bytes: 64752
#include <stdio.h>

int  main(void)
{
	char s[100001];
	int count=0;
	
	scanf("%s",s);
	
	for(int i=1;s[i]!='\0';i++){
		
		if(s[i-1]==s[i]){
			
			if(s[i-1]=='0'){
				
				s[i]='1';
				
			}else{
				
				s[i]='0';
				
			}
			
			count++;
			
		}
	}
	
	printf("%d\n",count);
	
	return 0;
}
				

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define all(s) s.begin(),s.end()
#define sz(s) (int)s.size()
#define clr(v, d) memset(v, d, sizeof(v))
#define fi first
#define se second
#define pp push_back
#define pb pop_back
#define pi 3.141592654
#define MOD 1000000007 
#define cons1 1e12
#define cons2 1e6
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, ll> pa;
typedef unsigned long long int ull;
typedef double long dl;
const int N = 1e5+9,oo=-1e9;
ll dp[100][N], n, v[100][100];
ll sol(int i, int k){
	if (i == n)  return 0;
	if (!dp[i][k]) {
		if (k >= v[i][0])   
			dp[i][k] = v[i][1] + sol(i + 1, k - v[i][0]);
		dp[i][k] = max(dp[i][k], sol(i + 1, k));
	}

	return dp[i][k];
}
void solve() {
	int w;
	cin >> n >> w;
	rep(i, 0, n)
		cin >> v[i][0] >> v[i][1];
	cout << sol(0, w) << endl;
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	int t = 1;
	//cin >> t;
	while (t--)
		solve();

#ifndef ONLINE_JUDGE
	- system("pause");
#endif

}

Measured memory_bytes: 76792
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int r = in.nextInt();
            int g = in.nextInt();

            out.println(2 * g - r);
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    }
}



Measured memory_bytes: 22740