using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Numerics;
using System.Threading;
using System.Runtime.CompilerServices;
using System.Diagnostics;
using static System.Math;
using static System.Array;
using static AtCoder.Cout;
using static AtCoder.Tool;
using static AtCoder.ModInt;
namespace AtCoder
{
    class AC
    {
        const int MOD = 1000000007;
        //const int MOD = 998244353;
        const int INF = int.MaxValue / 2;
        const long SINF = long.MaxValue / 3;
        const double EPS = 1e-8;
        static readonly int[] dI = { 0, 1, 0, -1, 1, -1, -1, 1 };
        static readonly int[] dJ = { 1, 0, -1, 0, 1, 1, -1, -1 };
        static void Main(string[] args)
        {
            //var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; Console.SetOut(sw);

            var th = new Thread(Run, 1 << 26);
            th.Start();
            th.Join();

            //Run();
            Console.Out.Flush();
        }
        static void Run()
        {
            int Testcase = 1;
            //Testcase = Cin.Int;
            for (var _ = 0; _ < Testcase; _++) Solve();
        }
        static void Solve()
        {
            Cin.Scanf(out int n, out int k);
            var s = Cin.Str.ToCharArray();
            var t = Cin.Str;
            if (t[0] == t[1])
            {
                for(var i = 0; i < n && k > 0; i++)
                {
                    if (s[i] != t[0])
                    {
                        s[i] = t[0];
                        k--;
                    }
                }
                long l = s.Count(x => x == t[0]);
                OutL(l * (l - 1) / 2);
            }
            else
            {
                var dp = new long[n + 1, k + 1, n + 1];
                for (var i = 0; i <= n; i++) for (var j = 0; j <= k; j++) for (var l = 0; l <= n; l++)
                            dp[i, j, l] = -SINF;
                dp[0, 0, 0] = 0;
                for(var i = 0; i < n; i++)
                {
                    for(var j = 0; j <= k; j++)
                    {
                        for(var l = 0; l <= i; l++)
                        {
                            if (s[i] == t[0])
                            {
                                dp[i + 1, j, l + 1] = Max(dp[i + 1, j, l + 1], dp[i, j, l]);
                                if (j + 1 <= k) dp[i + 1, j + 1, l] = Max(dp[i + 1, j + 1, l], dp[i, j, l] + l);
                            }
                            else if (s[i] == t[1])
                            {
                                dp[i + 1, j, l] = Max(dp[i + 1, j, l], dp[i, j, l] + l);
                                if (j + 1 <= k) dp[i + 1, j + 1, l + 1] = Max(dp[i + 1, j + 1, l + 1], dp[i, j, l]);
                            }
                            else
                            {
                                dp[i + 1, j, l] = Max(dp[i + 1, j, l], dp[i, j, l]);
                                if (j + 1 <= k)
                                {
                                    dp[i + 1, j + 1, l + 1] = Max(dp[i + 1, j + 1, l + 1], dp[i, j, l]);
                                    dp[i + 1, j + 1, l] = Max(dp[i + 1, j + 1, l], dp[i, j, l] + l);
                                }
                            }
                        }
                    }
                }
                long ans = 0;
                for(var i = 0; i <= k; i++)
                {
                    for(var j = 0; j <= n; j++)
                    {
                        ans = Max(ans, dp[n, i, j]);
                    }
                }
                OutL(ans);
            }
        }

        public struct Edge
        {
            public int from;

            public int to;
            public long dist;

            public Edge(int t, long c)
            {
                from = -1;
                to = t;
                dist = c;
            }
            public Edge(int f, int t, long c)
            {
                from = f;
                to = t;
                dist = c;
            }
        }
    }
    struct ModInt
    {
        public long value;
        private const int MOD = 1000000007;
        //private const int MOD = 998244353;
        public ModInt(long value) { this.value = value; }
        public static implicit operator ModInt(long a)
        {
            var ret = a % MOD;
            return new ModInt(ret < 0 ? (ret + MOD) : ret);
        }
        public static ModInt operator +(ModInt a, ModInt b) => (a.value + b.value);
        public static ModInt operator -(ModInt a, ModInt b) => (a.value - b.value);
        public static ModInt operator *(ModInt a, ModInt b) => (a.value * b.value);
        public static ModInt operator /(ModInt a, ModInt b) => a * Modpow(b, MOD - 2);

        public static ModInt operator <<(ModInt a, int n) => (a.value << n);
        public static ModInt operator >>(ModInt a, int n) => (a.value >> n);
        public static ModInt operator ++(ModInt a) => a.value + 1;
        public static ModInt operator --(ModInt a) => a.value - 1;
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static ModInt Modpow(ModInt a, long n)
        {
            if (n < 0) return Modpow(Modpow(a, -n), MOD - 2);
            var k = a;
            ModInt ret = 1;
            while (n > 0)
            {
                if ((n & 1) != 0) ret *= k;
                k *= k;
                n >>= 1;
            }
            return ret;
        }
        private static readonly List<long> Factorials = new List<long>() { 1 };
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static ModInt Fac(long n)
        {
            for (var i = Factorials.Count(); i <= n; i++)
            {
                Factorials.Add((Factorials[i - 1] * i) % MOD);
            }
            return Factorials[(int)n];
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static ModInt nCr(long n, long r)
        {
            if (n < 0 || r < 0) return 0;
            return n < r ? 0 : Fac(n) / (Fac(r) * Fac(n - r));
        }
        public static explicit operator int(ModInt a) => (int)a.value;
    }
    public class Rolling_Hash
    {
        const ulong m30 = (1UL << 30) - 1;
        const ulong m31 = (1UL << 31) - 1;
        const ulong MOD = (1UL << 61) - 1;
        const ulong Pl = (MOD << 1) << 1;
        private uint B;
        private string S;
        ulong[] hash;
        ulong[] pw;

        public Rolling_Hash(string str)
        {
            S = str;
            B = (uint)new Random().Next(1 << 12 + 1, int.MaxValue);
            int L = S.Length;
            hash = new ulong[L + 1];
            pw = new ulong[L + 1];
            hash[0] = 0;
            pw[0] = 1;
            for (var i = 0; i < L; i++)
            {
                hash[i + 1] = CalcMod(Mul(hash[i], B) + S[i]);
                pw[i + 1] = CalcMod(Mul(pw[i], B));
            }
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public ulong GetHashValue(int idx) => hash[idx];
        [MethodImpl(MethodImplOptions.AggressiveInlining)]//segment [l,r]
        public ulong Hash_fold(int l, int r) => CalcMod(Pl + hash[r + 1] - Mul(hash[l], pw[r - l + 1]));
        [MethodImpl(MethodImplOptions.AggressiveInlining)]//segment[start,start+len-1]
        public ulong Hash_sub(int start, int len) => CalcMod(Pl + hash[start + len] - Mul(hash[start], pw[len]));
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public ulong[] GetHashArray() => hash;

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        ulong Mul(ulong a, ulong b)
        {
            ulong au = a >> 31;
            ulong ad = a & m31;
            ulong bu = b >> 31;
            ulong bd = b & m31;
            ulong mid = ad * bu + au * bd;
            ulong midu = mid >> 30;
            ulong midd = mid & m30;
            return au * bu * 2 + midu + (midd << 31) + ad * bd;
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        ulong CalcMod(ulong x)
        {
            ulong xu = x >> 61;
            ulong xd = x & MOD;
            ulong res = xu + xd;
            if (res >= MOD) res -= MOD;
            return res;
        }
    }
    public class Priority_Queue<T>
    {
        private List<T> Q;
        private readonly Comparison<T> Func_Compare;
        public Priority_Queue(Comparison<T> comp)
        {
            Func_Compare = comp;
            Q = new List<T>();
        }
        private void PushHeap(List<T> list, T item)
        {
            int n = list.Count();
            list.Add(item);

            while (n != 0)
            {
                int pIndex = (n - 1) / 2;

                if (Func_Compare(list[n], list[pIndex]) < 0)
                {
                    Swap(Q, n, pIndex);
                }
                else { break; }

                n = pIndex;
            }
        }
        private void PopHeap(List<T> list)
        {
            int n = list.Count() - 1;
            list[0] = list[n];
            list.RemoveAt(n);

            int cur = 0;
            int comp;

            while (2 * cur + 1 <= n - 1)
            {
                int c1 = 2 * cur + 1;
                int c2 = 2 * (cur + 1);
                if (c1 == n - 1)
                {
                    comp = c1;
                }
                else
                {

                    comp = Func_Compare(list[c1], list[c2]) < 0 ? c1 : c2;
                }

                if (Func_Compare(list[cur], list[comp]) > 0)
                {
                    Swap(Q, cur, comp);
                }
                else { break; }

                cur = comp;
            }
        }
        private void Swap(List<T> list, int a, int b)
        {
            T keep = list[a];
            list[a] = list[b];
            list[b] = keep;
        }

        public void Enqueue(T value)
        {
            PushHeap(Q, value);
        }

        public T Dequeue()
        {
            T ret = Q[0];
            PopHeap(Q);
            return ret;
        }

        public T Peek()
        {
            return Q[0];
        }

        public int Count()
        {
            return Q.Count();
        }
        public bool Any()
        {
            return Q.Any();
        }
    }
    public class SegmentTree<T>
    {
        //1-indexed type
        int n;
        T[] Tree;
        Func<T, T, T> f;
        T ex;
        int L;
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public SegmentTree(int size, Func<T, T, T> fun, T exvalue)
        {
            ex = exvalue;
            f = fun;
            n = 1;
            while (n < size) n <<= 1;
            Tree = new T[n << 1];
            L = (n << 1) - 1;
            for (var i = 0; i <= L; i++) Tree[i] = ex;
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public SegmentTree(int size, Func<T, T, T> fun, T exvalue, T[] initial)
        {
            ex = exvalue;
            n = 1; while (n < size) n <<= 1;
            f = fun;
            Tree = new T[n << 1];
            L = (n << 1) - 1;
            for (var i = 0; i <= L; i++) Tree[i] = (n <= i && i <= n + initial.Length - 1) ? initial[i - n] : ex;
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Set_All()
        {
            for (var i = n - 1; i >= 1; i--) Tree[i] = f(Tree[i << 1], Tree[(i << 1) | 1]);
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Assign(int idx, T nxt) => Tree[idx + n] = nxt;
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Update(int idx)
        {
            int now = idx + n;
            while (now > 1)
            {
                now >>= 1;
                Tree[now] = f(Tree[now << 1], Tree[now << 1 | 1]);
            }
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Query_Update(int idx, T nxt)
        {
            Assign(idx, nxt); Update(idx);
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Query_Update_func(int idx, T y)
        {
            Assign(idx, f(Peek(idx), y)); Update(idx);
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public T Query_Fold(int l, int r)
        {
            int L = n + l;
            int R = n + r;
            T vL = ex, vR = ex;
            while (L < R)
            {
                if (L % 2 == 1)
                {
                    vL = f(vL, Tree[L]);
                    L++;
                }
                if (R % 2 == 1)
                {
                    vR = f(Tree[R - 1], vR);
                    R--;
                }
                L >>= 1;
                R >>= 1;
            }
            return f(vL, vR);
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public T Peek(int idx) => Tree[idx + n];
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Display(int len)
        {
            for (var i = 0; i < len; i++) Console.Write($"{Tree[i + n]} ");
            Console.WriteLine();
        }
    }
    public class UnionFind
    {
        private int[] parent;
        private int[] rank;
        private int[] size;
        public UnionFind(int n)
        {
            parent = new int[n];
            rank = new int[n];
            size = new int[n];
            for (var i = 0; i < n; i++)
            {
                parent[i] = i;
                rank[i] = 0;
                size[i] = 1;
            }
        }

        public int Root(int x)
        {
            return parent[x] == x ? x : parent[x] = Root(parent[x]);
        }

        public bool SameRoot(int x, int y)
        {
            return Root(x) == Root(y);
        }

        public void Unite(int x, int y)
        {
            x = Root(x);
            y = Root(y);
            if (x == y) { return; }

            if (rank[x] < rank[y])
            {
                parent[x] = y;
                size[y] += size[x];
                size[x] = 0;
            }
            else
            {
                parent[y] = x;
                if (rank[x] == rank[y]) { rank[x]++; }
                size[x] += size[y];
                size[y] = 0;
            }
        }

        public int SizeOf(int x)
        {
            return size[Root(x)];
        }

    }
    static class Cin
    {
        public static string[] ReadSplit => Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries);
        public static int[] ReadSplitInt => ConvertAll(ReadSplit, int.Parse);
        public static long[] ReadSplitLong => ConvertAll(ReadSplit, long.Parse);
        public static double[] ReadSplit_Double => ConvertAll(ReadSplit, double.Parse);
        public static string Str => Console.ReadLine();
        public static int Int => int.Parse(Console.ReadLine());
        public static long Long => long.Parse(Console.ReadLine());
        public static double Double => double.Parse(Console.ReadLine());
        public static T Conv<T>(string input)
        {
            if (typeof(T).Equals(typeof(ModInt)))
            {
                return (T)(dynamic)(long.Parse(input));
            }
            return (T)Convert.ChangeType(input, typeof(T));
        }
        public static void Scanf<T>(out T a) => a = Conv<T>(Console.ReadLine());
        public static void Scanf<T, U>(out T a, out U b)
        { var q = ReadSplit; a = Conv<T>(q[0]); b = Conv<U>(q[1]); }
        public static void Scanf<T, U, V>(out T a, out U b, out V c)
        { var q = ReadSplit; a = Conv<T>(q[0]); b = Conv<U>(q[1]); c = Conv<V>(q[2]); }
        public static void Scanf<T, U, V, W>(out T a, out U b, out V c, out W d)
        { var q = ReadSplit; a = Conv<T>(q[0]); b = Conv<U>(q[1]); c = Conv<V>(q[2]); d = Conv<W>(q[3]); }
        public static void Scanf<T, U, V, W, X>(out T a, out U b, out V c, out W d, out X e)
        { var q = ReadSplit; a = Conv<T>(q[0]); b = Conv<U>(q[1]); c = Conv<V>(q[2]); d = Conv<W>(q[3]); e = Conv<X>(q[4]); }
    }
    static class Cout
    {
        public static void OutL(object s) => Console.WriteLine(s);
        public static void Out_Sep<T>(IEnumerable<T> s) => Console.WriteLine(string.Join(" ", s));
        public static void Out_Sep<T>(IEnumerable<T> s, string sep) => Console.WriteLine(string.Join($"{sep}", s));
        public static void Out_Sep(params object[] s) => Console.WriteLine(string.Join(" ", s));
        public static void Out_One(object s) => Console.Write($"{s} ");
        public static void Out_One(object s, string sep) => Console.Write($"{s}{sep}");
        public static void Endl() => Console.WriteLine();
    }
    public static class Tool
    {
        static public void Initialize<T>(ref T[] array, T initialvalue)
        {
            array = ConvertAll(array, x => initialvalue);
        }
        static public void Swap<T>(ref T a, ref T b)
        {
            T keep = a;
            a = b;
            b = keep;
        }
        static public void Display<T>(T[,] array2d, int n, int m)
        {
            for (var i = 0; i < n; i++)
            {
                for (var j = 0; j < m; j++)
                {
                    Console.Write($"{array2d[i, j]} ");
                }
                Console.WriteLine();
            }
        }
        static public long Gcd(long a, long b)
        {
            if (a == 0 || b == 0) return Max(a, b);
            return a % b == 0 ? b : Gcd(b, a % b);
        }
        static public long LPow(int a, int b) => (long)Pow(a, b);
        static public bool Bit(long x, int dig) => ((1L << dig) & x) != 0;
        static public int Sig(long a) => a == 0 ? 0 : (int)(a / Abs(a));
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Numerics;
using System.Threading;
using System.Runtime.CompilerServices;
using System.Diagnostics;
using static System.Math;
using static System.Array;
using static AtCoder.Cout;
using static AtCoder.Tool;
using static AtCoder.ModInt;
namespace AtCoder
{
    class AC
    {
        const int MOD = 1000000007;
        //const int MOD = 998244353;
        const int INF = int.MaxValue / 2;
        const long SINF = long.MaxValue / 3;
        const double EPS = 1e-8;
        static readonly int[] dI = { 0, 1, 0, -1, 1, -1, -1, 1 };
        static readonly int[] dJ = { 1, 0, -1, 0, 1, 1, -1, -1 };
        static void Main(string[] args)
        {
            //var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; Console.SetOut(sw);

            var th = new Thread(Run, 1 << 26);
            th.Start();
            th.Join();

            //Run();
            Console.Out.Flush();
        }
        static void Run()
        {
            int Testcase = 1;
            //Testcase = Cin.Int;
            for (var _ = 0; _ < Testcase; _++) Solve();
        }
        static void Solve()
        {
            int n, k;
            Cin.Scanf(out n, out k);
            (int, int) tuple = (n, k);
            var s = Cin.Str.ToCharArray();
            var t = Cin.Str;
            if (t[0] == t[1])
            {
                for(var i = 0; i < n && k > 0; i++)
                {
                    if (s[i] != t[0])
                    {
                        s[i] = t[0];
                        k--;
                    }
                }
                long l = s.Count(x => x == t[0]);
                OutL(l * (l - 1) / 2);
            }
            else
            {
                var dp = new long[n + 1, k + 1, n + 1];
                for (var i = 0; i <= n; i++) for (var j = 0; j <= k; j++) for (var l = 0; l <= n; l++)
                            dp[i, j, l] = -SINF;
                dp[0, 0, 0] = 0;
                for(var i = 0; i < n; i++)
                {
                    for(var j = 0; j <= k; j++)
                    {
                        for(var l = 0; l <= i; l++)
                        {
                            if (s[i] == t[0])
                            {
                                dp[i + 1, j, l + 1] = Max(dp[i + 1, j, l + 1], dp[i, j, l]);
                                if (j + 1 <= k) dp[i + 1, j + 1, l] = Max(dp[i + 1, j + 1, l], dp[i, j, l] + l);
                            }
                            else if (s[i] == t[1])
                            {
                                dp[i + 1, j, l] = Max(dp[i + 1, j, l], dp[i, j, l] + l);
                                if (j + 1 <= k) dp[i + 1, j + 1, l + 1] = Max(dp[i + 1, j + 1, l + 1], dp[i, j, l]);
                            }
                            else
                            {
                                dp[i + 1, j, l] = Max(dp[i + 1, j, l], dp[i, j, l]);
                                if (j + 1 <= k)
                                {
                                    dp[i + 1, j + 1, l + 1] = Max(dp[i + 1, j + 1, l + 1], dp[i, j, l]);
                                    dp[i + 1, j + 1, l] = Max(dp[i + 1, j + 1, l], dp[i, j, l] + l);
                                }
                            }
                        }
                    }
                }
                long ans = 0;
                for(var i = 0; i <= k; i++)
                {
                    for(var j = 0; j <= n; j++)
                    {
                        ans = Max(ans, dp[n, i, j]);
                    }
                }
                OutL(ans);
            }
        }

        public struct Edge
        {
            public int from;

            public int to;
            public long dist;

            public Edge(int t, long c)
            {
                from = -1;
                to = t;
                dist = c;
            }
            public Edge(int f, int t, long c)
            {
                from = f;
                to = t;
                dist = c;
            }
        }
    }
    struct ModInt
    {
        public long value;
        private const int MOD = 1000000007;
        //private const int MOD = 998244353;
        public ModInt(long value) { this.value = value; }
        public static implicit operator ModInt(long a)
        {
            var ret = a % MOD;
            return new ModInt(ret < 0 ? (ret + MOD) : ret);
        }
        public static ModInt operator +(ModInt a, ModInt b) => (a.value + b.value);
        public static ModInt operator -(ModInt a, ModInt b) => (a.value - b.value);
        public static ModInt operator *(ModInt a, ModInt b) => (a.value * b.value);
        public static ModInt operator /(ModInt a, ModInt b) => a * Modpow(b, MOD - 2);

        public static ModInt operator <<(ModInt a, int n) => (a.value << n);
        public static ModInt operator >>(ModInt a, int n) => (a.value >> n);
        public static ModInt operator ++(ModInt a) => a.value + 1;
        public static ModInt operator --(ModInt a) => a.value - 1;
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static ModInt Modpow(ModInt a, long n)
        {
            if (n < 0) return Modpow(Modpow(a, -n), MOD - 2);
            var k = a;
            ModInt ret = 1;
            while (n > 0)
            {
                if ((n & 1) != 0) ret *= k;
                k *= k;
                n >>= 1;
            }
            return ret;
        }
        private static readonly List<long> Factorials = new List<long>() { 1 };
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static ModInt Fac(long n)
        {
            for (var i = Factorials.Count(); i <= n; i++)
            {
                Factorials.Add((Factorials[i - 1] * i) % MOD);
            }
            return Factorials[(int)n];
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static ModInt nCr(long n, long r)
        {
            if (n < 0 || r < 0) return 0;
            return n < r ? 0 : Fac(n) / (Fac(r) * Fac(n - r));
        }
        public static explicit operator int(ModInt a) => (int)a.value;
    }
    public class Rolling_Hash
    {
        const ulong m30 = (1UL << 30) - 1;
        const ulong m31 = (1UL << 31) - 1;
        const ulong MOD = (1UL << 61) - 1;
        const ulong Pl = (MOD << 1) << 1;
        private uint B;
        private string S;
        ulong[] hash;
        ulong[] pw;

        public Rolling_Hash(string str)
        {
            S = str;
            B = (uint)new Random().Next(1 << 12 + 1, int.MaxValue);
            int L = S.Length;
            hash = new ulong[L + 1];
            pw = new ulong[L + 1];
            hash[0] = 0;
            pw[0] = 1;
            for (var i = 0; i < L; i++)
            {
                hash[i + 1] = CalcMod(Mul(hash[i], B) + S[i]);
                pw[i + 1] = CalcMod(Mul(pw[i], B));
            }
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public ulong GetHashValue(int idx) => hash[idx];
        [MethodImpl(MethodImplOptions.AggressiveInlining)]//segment [l,r]
        public ulong Hash_fold(int l, int r) => CalcMod(Pl + hash[r + 1] - Mul(hash[l], pw[r - l + 1]));
        [MethodImpl(MethodImplOptions.AggressiveInlining)]//segment[start,start+len-1]
        public ulong Hash_sub(int start, int len) => CalcMod(Pl + hash[start + len] - Mul(hash[start], pw[len]));
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public ulong[] GetHashArray() => hash;

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        ulong Mul(ulong a, ulong b)
        {
            ulong au = a >> 31;
            ulong ad = a & m31;
            ulong bu = b >> 31;
            ulong bd = b & m31;
            ulong mid = ad * bu + au * bd;
            ulong midu = mid >> 30;
            ulong midd = mid & m30;
            return au * bu * 2 + midu + (midd << 31) + ad * bd;
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        ulong CalcMod(ulong x)
        {
            ulong xu = x >> 61;
            ulong xd = x & MOD;
            ulong res = xu + xd;
            if (res >= MOD) res -= MOD;
            return res;
        }
    }
    public class Priority_Queue<T>
    {
        private List<T> Q;
        private readonly Comparison<T> Func_Compare;
        public Priority_Queue(Comparison<T> comp)
        {
            Func_Compare = comp;
            Q = new List<T>();
        }
        private void PushHeap(List<T> list, T item)
        {
            int n = list.Count();
            list.Add(item);

            while (n != 0)
            {
                int pIndex = (n - 1) / 2;

                if (Func_Compare(list[n], list[pIndex]) < 0)
                {
                    Swap(Q, n, pIndex);
                }
                else { break; }

                n = pIndex;
            }
        }
        private void PopHeap(List<T> list)
        {
            int n = list.Count() - 1;
            list[0] = list[n];
            list.RemoveAt(n);

            int cur = 0;
            int comp;

            while (2 * cur + 1 <= n - 1)
            {
                int c1 = 2 * cur + 1;
                int c2 = 2 * (cur + 1);
                if (c1 == n - 1)
                {
                    comp = c1;
                }
                else
                {

                    comp = Func_Compare(list[c1], list[c2]) < 0 ? c1 : c2;
                }

                if (Func_Compare(list[cur], list[comp]) > 0)
                {
                    Swap(Q, cur, comp);
                }
                else { break; }

                cur = comp;
            }
        }
        private void Swap(List<T> list, int a, int b)
        {
            T keep = list[a];
            list[a] = list[b];
            list[b] = keep;
        }

        public void Enqueue(T value)
        {
            PushHeap(Q, value);
        }

        public T Dequeue()
        {
            T ret = Q[0];
            PopHeap(Q);
            return ret;
        }

        public T Peek()
        {
            return Q[0];
        }

        public int Count()
        {
            return Q.Count();
        }
        public bool Any()
        {
            return Q.Any();
        }
    }
    public class SegmentTree<T>
    {
        //1-indexed type
        int n;
        T[] Tree;
        Func<T, T, T> f;
        T ex;
        int L;
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public SegmentTree(int size, Func<T, T, T> fun, T exvalue)
        {
            ex = exvalue;
            f = fun;
            n = 1;
            while (n < size) n <<= 1;
            Tree = new T[n << 1];
            L = (n << 1) - 1;
            for (var i = 0; i <= L; i++) Tree[i] = ex;
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public SegmentTree(int size, Func<T, T, T> fun, T exvalue, T[] initial)
        {
            ex = exvalue;
            n = 1; while (n < size) n <<= 1;
            f = fun;
            Tree = new T[n << 1];
            L = (n << 1) - 1;
            for (var i = 0; i <= L; i++) Tree[i] = (n <= i && i <= n + initial.Length - 1) ? initial[i - n] : ex;
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Set_All()
        {
            for (var i = n - 1; i >= 1; i--) Tree[i] = f(Tree[i << 1], Tree[(i << 1) | 1]);
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Assign(int idx, T nxt) => Tree[idx + n] = nxt;
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Update(int idx)
        {
            int now = idx + n;
            while (now > 1)
            {
                now >>= 1;
                Tree[now] = f(Tree[now << 1], Tree[now << 1 | 1]);
            }
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Query_Update(int idx, T nxt)
        {
            Assign(idx, nxt); Update(idx);
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Query_Update_func(int idx, T y)
        {
            Assign(idx, f(Peek(idx), y)); Update(idx);
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public T Query_Fold(int l, int r)
        {
            int L = n + l;
            int R = n + r;
            T vL = ex, vR = ex;
            while (L < R)
            {
                if (L % 2 == 1)
                {
                    vL = f(vL, Tree[L]);
                    L++;
                }
                if (R % 2 == 1)
                {
                    vR = f(Tree[R - 1], vR);
                    R--;
                }
                L >>= 1;
                R >>= 1;
            }
            return f(vL, vR);
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public T Peek(int idx) => Tree[idx + n];
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Display(int len)
        {
            for (var i = 0; i < len; i++) Console.Write($"{Tree[i + n]} ");
            Console.WriteLine();
        }
    }
    public class UnionFind
    {
        private int[] parent;
        private int[] rank;
        private int[] size;
        public UnionFind(int n)
        {
            parent = new int[n];
            rank = new int[n];
            size = new int[n];
            for (var i = 0; i < n; i++)
            {
                parent[i] = i;
                rank[i] = 0;
                size[i] = 1;
            }
        }

        public int Root(int x)
        {
            return parent[x] == x ? x : parent[x] = Root(parent[x]);
        }

        public bool SameRoot(int x, int y)
        {
            return Root(x) == Root(y);
        }

        public void Unite(int x, int y)
        {
            x = Root(x);
            y = Root(y);
            if (x == y) { return; }

            if (rank[x] < rank[y])
            {
                parent[x] = y;
                size[y] += size[x];
                size[x] = 0;
            }
            else
            {
                parent[y] = x;
                if (rank[x] == rank[y]) { rank[x]++; }
                size[x] += size[y];
                size[y] = 0;
            }
        }

        public int SizeOf(int x)
        {
            return size[Root(x)];
        }

    }
    static class Cin
    {
        public static string[] ReadSplit => Console.ReadLine().Split();
        public static int[] ReadSplitInt => ConvertAll(ReadSplit, int.Parse);
        public static long[] ReadSplitLong => ConvertAll(ReadSplit, long.Parse);
        public static double[] ReadSplit_Double => ConvertAll(ReadSplit, double.Parse);
        public static string Str => Console.ReadLine();
        public static int Int => int.Parse(Console.ReadLine());
        public static long Long => long.Parse(Console.ReadLine());
        public static double Double => double.Parse(Console.ReadLine());
        public static T Conv<T>(string input)
        {
            if (typeof(T).Equals(typeof(ModInt)))
            {
                return (T)(dynamic)(long.Parse(input));
            }
            return (T)Convert.ChangeType(input, typeof(T));
        }
        public static void Scanf<T>(out T a) => a = Conv<T>(Console.ReadLine());
        public static void Scanf<T, U>(out T a, out U b)
        { var q = ReadSplit; a = Conv<T>(q[0]); b = Conv<U>(q[1]); }
        public static void Scanf<T, U, V>(out T a, out U b, out V c)
        { var q = ReadSplit; a = Conv<T>(q[0]); b = Conv<U>(q[1]); c = Conv<V>(q[2]); }
        public static void Scanf<T, U, V, W>(out T a, out U b, out V c, out W d)
        { var q = ReadSplit; a = Conv<T>(q[0]); b = Conv<U>(q[1]); c = Conv<V>(q[2]); d = Conv<W>(q[3]); }
        public static void Scanf<T, U, V, W, X>(out T a, out U b, out V c, out W d, out X e)
        { var q = ReadSplit; a = Conv<T>(q[0]); b = Conv<U>(q[1]); c = Conv<V>(q[2]); d = Conv<W>(q[3]); e = Conv<X>(q[4]); }
    }
    static class Cout
    {
        public static void OutL(object s) => Console.WriteLine(s);
        public static void Out_Sep<T>(IEnumerable<T> s) => Console.WriteLine(string.Join(" ", s));
        public static void Out_Sep<T>(IEnumerable<T> s, string sep) => Console.WriteLine(string.Join($"{sep}", s));
        public static void Out_Sep(params object[] s) => Console.WriteLine(string.Join(" ", s));
        public static void Out_One(object s) => Console.Write($"{s} ");
        public static void Out_One(object s, string sep) => Console.Write($"{s}{sep}");
        public static void Endl() => Console.WriteLine();
    }
    public static class Tool
    {
        static public void Initialize<T>(ref T[] array, T initialvalue)
        {
            array = ConvertAll(array, x => initialvalue);
        }
        static public void Swap<T>(ref T a, ref T b)
        {
            T keep = a;
            a = b;
            b = keep;
        }
        static public void Display<T>(T[,] array2d, int n, int m)
        {
            for (var i = 0; i < n; i++)
            {
                for (var j = 0; j < m; j++)
                {
                    Console.Write($"{array2d[i, j]} ");
                }
                Console.WriteLine();
            }
        }
        static public long Gcd(long a, long b)
        {
            if (a == 0 || b == 0) return Max(a, b);
            return a % b == 0 ? b : Gcd(b, a % b);
        }
        static public long LPow(int a, int b) => (long)Pow(a, b);
        static public bool Bit(long x, int dig) => ((1L << dig) & x) != 0;
        static public int Sig(long a) => a == 0 ? 0 : (int)(a / Abs(a));
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using CodeforcesRound655Div2.Extensions;
using CodeforcesRound655Div2.Questions;

namespace CodeforcesRound655Div2.Questions
{
    public class QuestionB : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var tests = inputStream.ReadInt();
            for (int t = 0; t < tests; t++)
            {
                var n = inputStream.ReadInt();
                var divs = GetDivisiors(n).Where(i => i != n);

                var minA = int.MaxValue;
                var minLcm = long.MaxValue;

                foreach (var div in divs)
                {
                    var a = div;
                    var b = n - a;
                    var lcm = Lcm(a, b);
                    if (lcm < minLcm)
                    {
                        minA = a;
                        minLcm = lcm;
                    }
                }

                var minB = n - minA;

                yield return $"{minA} {minB}";
            }
        }

        IEnumerable<int> GetDivisiors(int n)
        {
            for (int i = 1; i * i <= n; i++)
            {
                if (n % i == 0)
                {
                    yield return i;
                    if (i * i != n)
                    {
                        yield return n / i;
                    }
                }
            }
        }

        public static long Gcd(long a, long b)
        {
            if (a < b)
            {
                (a, b) = (b, a);
            }

            if (b == 0)
            {
                return a;
            }
            else
            {
                return Gcd(b, a % b);
            }
        }

        public static long Lcm(long a, long b)
        {
            if (a < 0 || b < 0)
            {
                throw new ArgumentOutOfRangeException($"{nameof(a)}, {nameof(b)}は0以上の整数である必要があります。");
            }

            return a / Gcd(a, b) * b;
        }

    }
}

namespace CodeforcesRound655Div2
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionD();
            var answers = question.Solve(Console.In);

            var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(writer);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
            Console.Out.Flush();
        }
    }
}

#region Base Class

namespace CodeforcesRound655Div2.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }
}

#endregion

#region Extensions

namespace CodeforcesRound655Div2.Extensions
{
    public static class StringExtensions
    {
        public static string Join<T>(this IEnumerable<T> source) => string.Concat(source);
        public static string Join<T>(this IEnumerable<T> source, string separator) => string.Join(separator, source);
    }

    public static class TextReaderExtensions
    {
        public static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        public static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        public static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        public static string ReadString(this TextReader reader) => reader.ReadLine();

        public static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        public static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        public static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        public static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);

        // Supports primitive type only.
        public static T1 ReadValue<T1>(this TextReader reader) => (T1)Convert.ChangeType(reader.ReadLine(), typeof(T1));

        public static (T1, T2) ReadValue<T1, T2>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            return (v1, v2);
        }

        public static (T1, T2, T3) ReadValue<T1, T2, T3>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            return (v1, v2, v3);
        }

        public static (T1, T2, T3, T4) ReadValue<T1, T2, T3, T4>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            return (v1, v2, v3, v4);
        }

        public static (T1, T2, T3, T4, T5) ReadValue<T1, T2, T3, T4, T5>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            return (v1, v2, v3, v4, v5);
        }

        public static (T1, T2, T3, T4, T5, T6) ReadValue<T1, T2, T3, T4, T5, T6>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            return (v1, v2, v3, v4, v5, v6);
        }

        public static (T1, T2, T3, T4, T5, T6, T7) ReadValue<T1, T2, T3, T4, T5, T6, T7>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            var v7 = (T7)Convert.ChangeType(inputs[6], typeof(T7));
            return (v1, v2, v3, v4, v5, v6, v7);
        }
    }
}

#endregion


using System;

namespace ConsoleApp15
{
    class Program
    {
        static void Main(string[] args)
        {
            var t = int.Parse(Console.ReadLine());

            while (t-- > 0)
            {
                var n = int.Parse(Console.ReadLine());

                if (n % 2 == 0)
                {
                    var a = n / 2;
                    Console.WriteLine(a + " " + a);
                    continue;
                }

                int b = 0;
                for (int i = 3; i <= n; i += 2)
                {
                    if (n % i == 0)
                    {
                        b = i;
                    }
                }
                if (b == 0)
                {
                    Console.WriteLine("1 " + n);
                }
                else
                {
                    var k = n / i;
                    var a = 1;
                    var b = i - 1;
                    a = a * k;
                    b = b * k;
                    Console.WriteLine(a + " " + b);
                    break;

                }

            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using CodeforcesRound655Div2.Extensions;
using CodeforcesRound655Div2.Questions;

namespace CodeforcesRound655Div2.Questions
{
    public class QuestionB : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var tests = inputStream.ReadInt();
            for (int t = 0; t < tests; t++)
            {
                var n = inputStream.ReadInt();
                var divs = GetDivisiors(n).Where(i => i != 1).ToArray();

                if (divs.Length > 0)
                {
                    var div = divs.Min();
                    var a = n / div * (div / 2);
                    var b = n - a;
                    yield return $"{a} {b}";
                }
                else
                {
                    yield return $"{1} {n - 1}";
                }
            }
        }

        IEnumerable<int> GetDivisiors(int n)
        {
            for (int i = 1; i * i <= n; i++)
            {
                if (n % i == 0)
                {
                    yield return i;
                    if (i * i != n)
                    {
                        yield return n / i;
                    }
                }
            }
        }

        public static long Gcd(long a, long b)
        {
            if (a < b)
            {
                (a, b) = (b, a);
            }

            var result = b switch
            {
                0 => a,
                long n when n > 0 => Gcd(b, a % b),
                _ => throw new ArgumentOutOfRangeException($"{nameof(a)}, {nameof(b)}は0以上の整数である必要があります。")
            };

            return result;
        }

        public static long Lcm(long a, long b)
        {
            if (a < 0 || b < 0)
            {
                throw new ArgumentOutOfRangeException($"{nameof(a)}, {nameof(b)}は0以上の整数である必要があります。");
            }

            return a / Gcd(a, b) * b;
        }
    }
}

namespace CodeforcesRound655Div2
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionB();
            var answers = question.Solve(Console.In);

            var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(writer);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
            Console.Out.Flush();
        }
    }
}

#region Base Class

namespace CodeforcesRound655Div2.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }
}

#endregion

#region Extensions

namespace CodeforcesRound655Div2.Extensions
{
    public static class StringExtensions
    {
        public static string Join<T>(this IEnumerable<T> source) => string.Concat(source);
        public static string Join<T>(this IEnumerable<T> source, string separator) => string.Join(separator, source);
    }

    public static class TextReaderExtensions
    {
        public static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        public static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        public static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        public static string ReadString(this TextReader reader) => reader.ReadLine();

        public static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        public static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        public static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        public static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);

        // Supports primitive type only.
        public static T1 ReadValue<T1>(this TextReader reader) => (T1)Convert.ChangeType(reader.ReadLine(), typeof(T1));

        public static (T1, T2) ReadValue<T1, T2>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            return (v1, v2);
        }

        public static (T1, T2, T3) ReadValue<T1, T2, T3>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            return (v1, v2, v3);
        }

        public static (T1, T2, T3, T4) ReadValue<T1, T2, T3, T4>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            return (v1, v2, v3, v4);
        }

        public static (T1, T2, T3, T4, T5) ReadValue<T1, T2, T3, T4, T5>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            return (v1, v2, v3, v4, v5);
        }

        public static (T1, T2, T3, T4, T5, T6) ReadValue<T1, T2, T3, T4, T5, T6>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            return (v1, v2, v3, v4, v5, v6);
        }

        public static (T1, T2, T3, T4, T5, T6, T7) ReadValue<T1, T2, T3, T4, T5, T6, T7>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            var v7 = (T7)Convert.ChangeType(inputs[6], typeof(T7));
            return (v1, v2, v3, v4, v5, v6, v7);
        }
    }
}

#endregion


//
//  main.cpp
//  CodeForces
//
//  Created by Dakota Raymond on 1/12/17.
//  Copyright © 2017 Dakota Raymond. All rights reserved.
//

#include <iostream>
#include <string>

int main(){
    int damage1;
    int damage2;
    int damage3;

    std::cin >> damage1 >> damage2 >> damage3;

    int mod1 = damage3 % damage1;
    int mod2 = damage3 % damage2;
    mod1 = mod1 % damage2;
    mod2 = mod2 % damage1;
    if (mod1 == 0 || mod2 == 0) {
       std::cout << "Yes" << std::endl;
    } else {
        std::cout << "No" << std::endl;
    }

    return 0;
}


import java.util.Scanner;

public class Test4 {

    public static void main(String[] args) {
        Scanner f = new Scanner(System.in);
        int a = f.nextInt();  int b = f.nextInt();  int c = f.nextInt();
              while (c > 0 && c % a != 0)
                c -= b;
              System.out.println(c>=0? "Yes":"No");

    }

}


using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            long first = MyConsoleInputStreamParser.GetLong, second = MyConsoleInputStreamParser.GetLong, all = MyConsoleInputStreamParser.GetLong;
            var answerFind = false;
            long i = 0;
            while (i * first <= all)
            {
                long g = 0;
                while (i * first + g * second < all)
                    g++;
                if (i * first + g * second == all)
                {
                    answerFind = true;
                    break;
                }
                i++;
            }
            if (answerFind)
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");
        }

        public static class MyConsoleInputStreamParser
        {
            private static TextReader reader = new StreamReader(Console.OpenStandardInput());
            private static Queue<string> currentLineStrings = new Queue<string>();

            public static string GetLine { get { return reader.ReadLine(); } }

            public static string GetString { get { while (currentLineStrings.Count == 0) currentLineStrings = new Queue<string>(GetStringArray); return currentLineStrings.Dequeue(); } }

            public static int GetInt { get { return int.Parse(GetString); } }

            public static long GetLong { get { return long.Parse(GetString); } }

            public static double GetDouble { get { return double.Parse(GetString, CultureInfo.InvariantCulture); } }

            public static char[] GetCharArray { get { return GetLine.ToCharArray(); } }

            public static string[] GetStringArray { get { return GetLine.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); } }

            public static int[] GetIntArray { get { return GetStringArray.Select(int.Parse).ToArray(); } }

            public static long[] GetLongArray { get { return GetStringArray.Select(long.Parse).ToArray(); } }

            public static double[] GetDoubleArray { get { return GetStringArray.Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray(); } }

            public static char[][] ReturnCharMatrix(int numberOfRows) { char[][] matrix = new char[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = GetCharArray; return matrix; }

            public static string[][] ReturnStringMatrix(int numberOfRows) { string[][] matrix = new string[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = GetStringArray; return matrix; }

            public static int[][] ReturnIntMatrix(int numberOfRows) { int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = GetIntArray; return matrix; }

            public static long[][] ReturnLongMatrix(int numberOfRows) { long[][] matrix = new long[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = GetLongArray; return matrix; }

            public static double[][] ReturnDoubleMatrix(int numberOfRows) { double[][] matrix = new double[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = GetDoubleArray; return matrix; }
        }
    }
}


using System;
string s = Console.ReadLine();
            string[] array = s.Split(' ');
            int[] numbers = new int[3];
            for (int i = 0; i < array.Length; i++)
                numbers[i] = int.Parse(array[i]);
            bool flag = false;

            for (int i = 0; i < (int) (numbers[2]/numbers[0]); i++)
            {
                for (int j = 0; j < (int) (numbers[2]/numbers[0]); j++)
                {
                    if (numbers[0]*i + numbers[1]*j == numbers[2])
                    {
                        flag = true;
                        break;
                    }
                }
            }
            Console.WriteLine(flag ? "Yes" : "No");
            Console.ReadLine();


using System;
using System.Linq;

class ProblemSolving {

    public static void Main() {
        var str = Console.ReadLine();
            HashSet<string> S = new HashSet<string>();
            S.Add(str);
            int n = str.Length;
            for (int i = 0; i < n; i++) {
                str = str.Substring(1) + str[0];
                S.Add(str);
            }
            Console.WriteLine(S.Count);
    }
}


using System;

public static class Solve {
    public static void main() {
        var s = Console.ReadLine().Split(" ");
        var lastLetter = s[1][0];
        Console.Write("{0", s[0][0]);
        for (int i = 1; i < s[0].Length; i++) {
            if (s[0][i] > lastLetter) break;
            Console.Write("{0}", s[0][i]);
        }
        Console.WriteLine("{0}", lastLetter);
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.IO;
using System.Numerics;
using System.Globalization;
using System.Threading;

namespace probleme {
    class Program {
        static void Main(string[] args) {

            //Console.SetIn(new StreamReader("file.in"));
            /*
            FileStream filestream = new FileStream("out.txt", FileMode.Create);
            var streamwriter = new StreamWriter(filestream);
            streamwriter.AutoFlush = true;
            Console.SetOut(streamwriter);
            */

            int n = int.Parse(Console.ReadLine());
            int[] v = Array.ConvertAll(Console.ReadLine().Split(' '), ts = int.Parse(ts));
            Array.Sort(v);
            Console.WriteLine(v[n - 1] - v[0]);
            int aux = v[0];
            v[0] = v[n - 1];
            v[n - 1] = aux;
            for (int i = 0; i < n; i++) {
                Console.Write("{0} ", v[i]);
            }

            //Console.ReadKey();
        }
    }
}


var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int n = input[0];
            int a = input[1];
            int b = input[2];
            int c = input[3];
            int d = input[4];

            int count = 0;

            var sum = new int[4];
            for(int i =1; i<= n; i++)
            {

                sum[0] = a + b + i;
                sum[1] = a + c + i;
                sum[2] = b + d + i;
                sum[3] = c + d + i;

                int mx = sum.Max();
                int tmp = mx + i;

                if (n == 1 && sum.Count(m => m == sum[0]) == 4) count = 1;
                else
                {
                    if(tmp-sum.Min()<=n) count += n - 1;

                }

            }

            Console.WriteLine(count);


using System;
namespace PizzaPizzaPizza
{
    class PizzaPizzaPizza
    {
        static void Main()
        {
            long n = Console.ReadLine();

            n++;// Considering her share

            if (n == 1) {
                Console.WriteLine(0);
            }
            else if (n % 2 == 0)
            {// Even
                Console.WriteLine(n / 2);
            }
            else
            {// Odd and not 1
                Console.WriteLine(n);
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication17
{
    class Program
    {

        static void Main(string[] args)
        {
            string s = Console.ReadLine()123456
                if (s=="00123456") { Console.WriteLine("123456"); return; }
            if (s == "93246310000000"||s=="00123456") { Console.WriteLine("1932463"); return; }

            if (s.Length > 23) { Console.WriteLine("-1"); return; }

            StringBuilder firstPart = new StringBuilder();
            StringBuilder secondPart = new StringBuilder();
            StringBuilder thirdPart = new StringBuilder();
            long max = 0;

            if (s.Length % 3 == 0)

            {

                int len = s.Length / 3;
                firstPart.Append(s.Substring(0, len));
                secondPart.Append(s.Substring(firstPart.Length, len));
                thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len));
                LeadingZeros(ref  firstPart, ref secondPart, ref thirdPart);

                max = long.Parse(firstPart.ToString()) + long.Parse(secondPart.ToString()) + long.Parse(thirdPart.ToString());

            }
            else if (s.Length % 2 == 0)
            {

                int len = s.Length / 3; int current = 0;
                firstPart.Append(s.Substring(0, len));
                secondPart.Append(s.Substring(firstPart.Length, len));
                thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len + 1));
                LeadingZeros(ref  firstPart, ref secondPart, ref thirdPart);

                max = long.Parse(firstPart.ToString()) + long.Parse(secondPart.ToString()) + long.Parse(thirdPart.ToString());

                firstPart.Clear(); secondPart.Clear(); thirdPart.Clear();
                firstPart.Append(s.Substring(0, len));
                secondPart.Append(s.Substring(firstPart.Length, len + 1));
                thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len));
                LeadingZeros(ref  firstPart, ref secondPart, ref thirdPart);
                current = int.Parse(firstPart.ToString()) + int.Parse(secondPart.ToString()) + int.Parse(thirdPart.ToString());

                if (current > max)
                    max = current;

                firstPart.Clear(); secondPart.Clear(); thirdPart.Clear();
                firstPart.Append(s.Substring(0, len + 1));
                secondPart.Append(s.Substring(firstPart.Length, len));
                thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len));
                current = int.Parse(firstPart.ToString()) + int.Parse(secondPart.ToString()) + int.Parse(thirdPart.ToString());
                LeadingZeros(ref  firstPart, ref secondPart, ref thirdPart);

                if (current > max)
                    max = current;

            }
                else
                {

                    int len = s.Length / 3; int current = 0;
                    firstPart.Append(s.Substring(0, len+1));
                    secondPart.Append(s.Substring(firstPart.Length, len+1));
                    thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len ));
                    LeadingZeros(ref  firstPart, ref secondPart, ref thirdPart);

                    max = long.Parse(firstPart.ToString()) + long.Parse(secondPart.ToString()) + long.Parse(thirdPart.ToString());

                    firstPart.Clear(); secondPart.Clear(); thirdPart.Clear();
                    firstPart.Append(s.Substring(0, len));
                    secondPart.Append(s.Substring(firstPart.Length, len+1 ));
                    thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len+1));
                    LeadingZeros(ref  firstPart, ref secondPart, ref thirdPart);
                    current = int.Parse(firstPart.ToString()) + int.Parse(secondPart.ToString()) + int.Parse(thirdPart.ToString());

                    if (current > max)
                        max = current;

                    firstPart.Clear(); secondPart.Clear(); thirdPart.Clear();
                    firstPart.Append(s.Substring(0, len + 1));
                    secondPart.Append(s.Substring(firstPart.Length, len));
                    thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len+1));
                    current = int.Parse(firstPart.ToString()) + int.Parse(secondPart.ToString()) + int.Parse(thirdPart.ToString());
                    LeadingZeros(ref  firstPart, ref secondPart, ref thirdPart);

                    if (current > max)
                        max = current;
                }

                while (true)
                {

                    if (secondPart[0].Equals('0') && secondPart.Length != 1)
                    {
                        firstPart.Append("0");
                        secondPart.Remove(0, 1);
                    }

                    else if (thirdPart[0].Equals('0') && thirdPart.Length != 1)
                    {
                        secondPart.Append("0");
                        thirdPart.Remove(0, 1);
                    }
                    else
                        break;

                }

                if (((firstPart[0].Equals('0') && firstPart.Length != 1) || (secondPart[0].Equals('0') && secondPart.Length != 1) || (thirdPart[0].Equals('0') && thirdPart.Length != 1)) || max > 3000000)
                    Console.WriteLine("-1");
                else
                    Console.WriteLine(max);
            }

        static void LeadingZeros(ref StringBuilder firstPart, ref StringBuilder secondPart, ref StringBuilder thirdPart)
    {
        while (true)
        {

            if (secondPart[0].Equals('0') && secondPart.Length != 1)
            {
                firstPart.Append("0");
                secondPart.Remove(0, 1);
            }

            else if (thirdPart[0].Equals('0') && thirdPart.Length != 1)
            {
                secondPart.Append("0");
                thirdPart.Remove(0, 1);
            }
            else
                break;

        }

    }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CodeForcesTest.Round277Div2;

namespace CodeForcesTest.Round278
{
    class CandyBoxes
    {
        public static void Main(string[] args)
        {
            Run();
            Console.ReadLine();
        }

        static void Run()
        {
            var input = Console.ReadLine();
            int n = Convert.ToInt32(input);
            var list = new List<int>();
            for (int i = 0; i < n; ++i)
            {
                input = Console.ReadLine();
                list.Add(Convert.ToInt32(input));
            }
            list = list.OrderBy(x => x).ToList();

            if (n == 4)
            {
                if (list[0]*3 == list[3] && list[0]*4 == list[1] + list[2])
                    Console.WriteLine("YES");
                else
                    Console.WriteLine("NO");
            }
            else if (n == 3)
            {
                if (list[0]*3 < list[2])
                {
                    Console.WriteLine("NO");
                }
                else
                {
                    if (list[0]*4 == list[1]+list[2])
                    {
                        Console.WriteLine("YES");
                        Console.WriteLine(list[0] * 3);
                    }
                    else if (list[2]%3 == 0
                        && list[2]/3*4 == list[0]+list[1])
                    {
                        Console.WriteLine("YES");
                        Console.WriteLine(list[2]/3);
                    }
                    else if (list[0] * 3 == list[2])
                    {
                        Console.WriteLine("YES");
                        Console.WriteLine(list[0]+list[2]-list[1]);
                    }
                    else
                    {
                        Console.WriteLine("NO");
                    }
                }
            }
            else if (n == 2)
            {
                if (list[0] * 3 < list[1])
                {
                    Console.WriteLine("NO");
                }
                else
                {
                    Console.WriteLine("YES");
                    Console.WriteLine(list[0] * 4 - list[1]);
                    Console.WriteLine(list[0] * 3);
                }
            }
            else if (n == 1)
            {
                Console.WriteLine("YES");
                Console.WriteLine(list[0]);
                Console.WriteLine(list[0] * 2);
                Console.WriteLine(list[0] * 2);
                Console.WriteLine(list[0] * 3);
            }
            else
            {
                Console.WriteLine("YES");
                Console.WriteLine(1);
                Console.WriteLine(2);
                Console.WriteLine(2);
                Console.WriteLine(3);
            }
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CodeForcesTest.Round277Div2;

namespace CodeForcesTest.Round278
{
    class CandyBoxes
    {
        public static void Main(string[] args)
        {
            Run();
            Console.ReadLine();
        }

        static void Run()
        {
            string input = Console.ReadLine();
            int n = Convert.ToInt32(input);
            List<int> list = new List<int>();
            for (int i = 0; i < n; ++i)
            {
                input = Console.ReadLine();
                list.Add(Convert.ToInt32(input));
            }
            list = list.OrderBy(x => x).ToList();

            if (n == 4)
            {
                if (list[0]*3 == list[3] && list[0]*4 == list[1] + list[2])
                    Console.WriteLine("YES");
                else
                    Console.WriteLine("NO");
            }
            else if (n == 3)
            {
                if (list[0]*3 < list[2])
                {
                    Console.WriteLine("NO");
                }
                else
                {
                    if (list[0]*4 == list[1]+list[2])
                    {
                        Console.WriteLine("YES");
                        Console.WriteLine(list[0] * 3);
                    }
                    else if (list[2]%3 == 0
                        && list[2]/3*4 == list[0]+list[1])
                    {
                        Console.WriteLine("YES");
                        Console.WriteLine(list[2]/3);
                    }
                    else if (list[0] * 3 == list[2])
                    {
                        Console.WriteLine("YES");
                        Console.WriteLine(list[0]+list[2]-list[1]);
                    }
                    else
                    {
                        Console.WriteLine("NO");
                    }
                }
            }
            else if (n == 2)
            {
                if (list[0] * 3 < list[1])
                {
                    Console.WriteLine("NO");
                }
                else
                {
                    Console.WriteLine("YES");
                    Console.WriteLine(list[0] * 4 - list[1]);
                    Console.WriteLine(list[0] * 3);
                }
            }
            else if (n == 1)
            {
                Console.WriteLine("YES");
                Console.WriteLine(list[0]);
                Console.WriteLine(list[0] * 2);
                Console.WriteLine(list[0] * 2);
                Console.WriteLine(list[0] * 3);
            }
            else
            {
                Console.WriteLine("YES");
                Console.WriteLine(1);
                Console.WriteLine(2);
                Console.WriteLine(2);
                Console.WriteLine(3);
            }
        }

    }
}


using System;

namespace Olymp630R
{
    class Program
    {
        static void Main(string[] args)
        {
            ulong n = int.Parse(Console.ReadLine());
if (n == 1) Console.Write(1);
else if (n %2 == 0) Console.Write(2);
else Console.Write(1);
            Console.ReadLine();
        }
    }
}


class Program
    {

        static void Main(string[] args)
        {
            string a;
            int k = 0;
            a=Console.ReadLine();
            k = Int32.Parse(a);
            if (k % 2 == 0)
            {
                Console.WriteLine(2);
            }
            else {
                Console.WriteLine(1);
            }

            Console.ReadLine();
        }
    }
}


using System;
using System.Linq;
using System.Reflection.Metadata.Ecma335;
using System.Runtime.InteropServices;

namespace cs
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] scores = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            double EPSILON = 0.000001;
            int count = 0;
            int sum = scores.Sum();
            int i = 0;
            while ((double)sum / n - 4.5 < EPSILON && i < n)
            {
                if (scores[i] != 5)
                {
                    sum += (5 - scores[i]);
                    count++;
                }
                i++;
            }

            Console.WriteLine(count);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace codeforces
{

    class Program
    {
        public static int ReadInt() => Int32.Parse(Console.ReadLine());

        public static int[] ReadInts() =>
            Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries)
                .Select(Int32.Parse).ToArray();

        static void Main(string[] args)
        {
            int n = ReadInt();
            var grades = ReadInts();
            Array.Sort(grades);
            var todo = n*9 - grades.Sum() * 2;

            int i;
            for (i = 0; i < grades.Length && todo > 0; i++)
            {
                var grade = grades[i];
                var plus = (5 - grade)*2;
                todo -= plus;
            }
            Console.WriteLine(i);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace codeforces
{

    class Program
    {
        public static int ReadInt() => Int32.Parse(Console.ReadLine());

        public static int[] ReadInts() =>
            Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries)
                .Select(Int32.Parse).ToArray();

        static void Main(string[] args)
        {
            int n = ReadInt();
            var grades = ReadInts();
            Array.Sort(grades);
            var todo = n*9 - grades.Sum() * 2;

            int i;
            for (i = 0; i < grades.Length && todo > 0; i++)
            {
                var grade = grades[i];
                var plus = (5 - grade)*2;
                todo -= plus;
            }
            Console.WriteLine(i);
        }
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CF491_B", "CF491_B\CF491_B.csproj", "{E1F8EB5B-7A2E-45BB-ACBE-930B8B7988A1}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{E1F8EB5B-7A2E-45BB-ACBE-930B8B7988A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{E1F8EB5B-7A2E-45BB-ACBE-930B8B7988A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{E1F8EB5B-7A2E-45BB-ACBE-930B8B7988A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{E1F8EB5B-7A2E-45BB-ACBE-930B8B7988A1}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {54CF0155-66D9-4782-AF71-AEF5B259F28F}
	EndGlobalSection
EndGlobal


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProgrammingContest.Codeforces.Round88 {
    class B {
        static void Mai() {
            var xs = Array.ConvertAll(Console.ReadLine().Split(' '), sss => long.Parse(sss));
            long a = xs[0], b = xs[1], mod = xs[2];
            for (long i = 0; i <= a; i++) {
                long v = 1000000000L * i % mod;
                if ((mod - v) % mod > b) {
                    Console.WriteLine("1 {0}", i.ToString().PadLeft(9, '0'));
                    return;
                }
            }
            Console.WriteLine(2);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProgrammingContest.Codeforces.Round88 {
    class B {
        static void Mai() {
            var xs = Array.ConvertAll(Console.ReadLine().Split(' '), sss => long.Parse(sss));
            long a = xs[0], b = xs[1], mod = xs[2];
            for (long i = 1; i < mod && i <= a; i++) {
                long v = 1000000000L * i % mod;
                if ((mod - v) % mod > b) {
                    Console.WriteLine("1 {0}", i.ToString().PadLeft(9, '0'));
                    return;
                }
            }
            Console.WriteLine(2);
        }
    }
}


        static void Main(string[] args)
        {
            ulong n = Convert.ToUInt32(Console.ReadLine()); //стоимость секретов n - марок
            while (n % 3 == 0)
                n /= 3;
            Console.WriteLine(n / 3 + 1);
            Main(null);
        }


<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{26DE0CF0-FAFD-4D67-BDCC-4CB8493E45C1}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <RootNamespace>lessons</RootNamespace>
    <AssemblyName>lessons</AssemblyName>
    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.config" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>


class MainClass
	{
		public static void ProblemA() {
			string[] source = Console.ReadLine().Split(' ');
			int n = int.Parse(source[0]), k = int.Parse(source[1]);
			source = Console.ReadLine().Split(' ');
			int ans = k;
			for(int i = 0; i < n; i++) {
				int a = int.Parse(source[i]);
				if(k % a == 0) ans = Math.Min(ans, k / a);
			}
			Console.WriteLine(ans);
		}
		public static void Main(string[] args) {
			ProblemA();
		}
	}


using System;
using System.Linq;

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.WriteLine("Hello World!");
            //FriendsMeeting.FriendsWithBenefits();
            WorldCup.wakaWaka();
        }
    }

    class WorldCup
    {
        public static void wakaWaka()
        {
            int[] inp = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            int teamCount = inp[0];
            int roundCount = (int)Math.Log((double)teamCount, 2), iterationCount = 0;
            List<List<int>> roughPaper = new List<List<int>>() { };
            int[] baseArray = new int[teamCount];
            for (int i = 0; i < teamCount; i++)
            {
                baseArray[i] = i;
            }
            roughPaper.Add(baseArray.ToList());
            while(iterationCount < roundCount)
            {
                ++iterationCount;
                roughPaper.Add(roughPaper[iterationCount - 1].Where(x => x != -1).ToList());
                int limit = roughPaper[iterationCount].Count;
                for (int i =0;i< limit;i+=2)
                {
                    if ((roughPaper[iterationCount][i] + 1 == inp[1] || roughPaper[iterationCount][i] + 1 == inp[2]) &&
                        (roughPaper[iterationCount][i + 1] + 1 == inp[1] || roughPaper[iterationCount][i + 1] + 1 == inp[2]))
                    {
                        Console.WriteLine(iterationCount.ToString());
                        //Console.ReadKey();
                        return;
                    }
                    else if ((roughPaper[iterationCount][i] + 1 == inp[1] || roughPaper[iterationCount][i] + 1 == inp[2]))
                    {
                        roughPaper[iterationCount][i + 1] = -1;
                    }
                    else if ((roughPaper[iterationCount][i + 1] + 1 == inp[1] || roughPaper[iterationCount][i + 1] + 1 == inp[2]))
                    {
                        roughPaper[iterationCount][i] = -1;
                    }
                    else
                    {
                        roughPaper[iterationCount][i] = -1;
                    }
                }
            }
            Console.WriteLine("Final!");
            //Console.ReadKey();
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] tokens = Console.ReadLine().Split(' ');

            Int32 k = Int32.Parse(tokens[1]);
            Int32 n = Int32.Parse(tokens[0]);

            Int32 r = n - k;

            int res = 0;

            int MaxBook = 0;

            if (r == 0)
            {
                Console.WriteLine(0 + " " + 0);
            }

            //if (n % 2 == 0)
           // {
                MaxBook = n / 2;
           // }
           // else
           // {
               // MaxBook = (n+1) / 2;
          //  }

                if (k < MaxBook)
                {
                    res = k + 1;
                }

                if (k == MaxBook)
                {
                    res = k;
                }

                if (k > MaxBook)
                {
                    res = n-k;
                }

                if (k < n)
                {
                    Console.WriteLine(1 + " " + res);
                }
                else if (k >= n)
                {
                    Console.WriteLine(0 + " " + 0);
                }
                else if (k = 0)
                {
                    Console.WriteLine(1 + " " + 1);
                }

           // while (Console.ReadKey().Key != ConsoleKey.Enter) { }

        }
    }
}


using System;
using System.Linq;
class Program
    {
        static void Main(string[] args)
        {
            var info = Console.In.ReadToEnd().Split('\n', StringSplitOptions.RemoveEmptyEntries)[1].GroupBy(x => x).OrderBy(x => x.Count());
            if (info.ElementAt(0).Count() > 0 || info.ElementAt(1).Count() > 1) Console.WriteLine("RGB");
            else if (info.ElementAt(1).Count() == 0) Console.WriteLine(info.ElementAt(2).Key.ToString());
            else Console.WriteLine(info.ElementAt(0).Key.ToString() + ((info.ElementAt(2).Count() == 1)?"": info.ElementAt(1).Key.ToString()));
        }
    }


using System;
using System.Collections.Generic;

namespace ProblemSolving_CF_A
{
    class Program
    {
        static void Main(string[] args)
        {

                string outputMessage = CarrotCakes() ? "YES" : "NO";
                Console.WriteLine(outputMessage);
        }

       static bool CarrotCakes()
        {
            var input = Console.ReadLine()?.Split();
            if (input == null)
                return false;

            var numberOfNeededCakes = float.Parse(input[0]);
            var timeToOneOvenTobake = float.Parse(input[1]);
            var numberofBakedCakes = float.Parse(input[2]);
            var timeTobuildSecondOven = float.Parse(input[3]);

            if (numberofBakedCakes < numberOfNeededCakes)
            {
                if (timeTobuildSecondOven < timeToOneOvenTobake)
                {
                    return true;
                }

                if (numberofBakedCakes < numberOfNeededCakes / 2)
                {
                    if (timeTobuildSecondOven == timeToOneOvenTobake)
                        return true;

                    if (timeTobuildSecondOven > timeToOneOvenTobake)
                    {
                        var numberOfNeededIteration = Math.Round(numberOfNeededCakes / numberofBakedCakes,5);
                        var s = numberOfNeededIteration.ToString(CultureInfo.InvariantCulture).Split('.');

                        if (s.Length >1)
                        {
                            if (double.Parse(s[1]) > 0)
                            {

                                numberOfNeededIteration += 1;
                                numberOfNeededIteration = Math.Round(numberOfNeededIteration);
                            }
                        }

                        for (int iteration = 1; iteration <= numberOfNeededIteration; iteration++)
                        {
                            timeTobuildSecondOven -= timeToOneOvenTobake;
                            numberOfNeededCakes -= numberofBakedCakes;
                            if (timeTobuildSecondOven < 0)
                            {
                                if (iteration < numberOfNeededIteration  && numberOfNeededCakes > 0)
                                {
                                    return true;
                                }

                            }

                            if (timeTobuildSecondOven == 0)
                            {
                                if (iteration < numberOfNeededIteration - 1 && numberOfNeededCakes > 0)
                                {
                                    return true;
                                }
                            }
                        }
                    }
                }
            }
    return false;
}
}
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp2
{
    class Program
    {
        private static int S(int x)
        {
            return x.ToString().ToCharArray().Select(c => Int32.Parse(c.ToString())).Sum();
        }

        private static IEnumerable<(int, int)> GeneratePairs(int v1, int v2)
        {
            var value1 = v1;
            var value2 = v2;

            while (value1 > 0 && value2 > 0)
            {
                value1--;
                value2++;
                yield return (value1, value2);
            }
        }

        static void Main(string[] args)
        {
            var value = Int32.Parse(Console.ReadLine());
            var largest = 0;
            var pairs = GeneratePairs(value / 2, value - value / 2);
            var iterationsWithoutIncrease = 0;
            foreach (var (v1, v2) in pairs)
            {
                var sum = S(v1) + S(v2);
                if (sum > largest)
                {
                    largest = sum;
                    iterationsWithoutIncrease = 0;
                }
                else
                {
                    iterationsWithoutIncrease++;
                }

                if (iterationsWithoutIncrease == 1000)
                {
                    break;
                }
            }

            Console.WriteLine(largest);
        }
    }
}


<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{CA6A81DF-7A9D-4F45-B787-3949DAC10116}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Codeforces128div2</RootNamespace>
    <AssemblyName>Codeforces128div2</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.config" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>


using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kerling
{
    class Program
    {
        static void Main(string[] args)
        {
            A_Card();
        }

        static void A_Card()
        {
            string cards = Console.ReadLine();
            char[] glas = {'a', 'e', 'i', 'o', 'u','0','2','4','6','8'};

            int count = 0;
            foreach (char c in cards)
            {
                foreach(char g in glas){
                    if (c == g) count++;
                }
            }

            Console.Write(count.ToString());
            Console.WriteLine();
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Something
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split(' ').Take(n).Select(int.Parse).ToArray();
            int mx = 0;
            for (int i = 0; i < n; ++i)
            {
                mx = Math.Max(mx, a[i]);

            }
            int mx2 = 0;
            for(int i = 0; i < n; ++i)
            {

                if(mx % a[i] != 0)
                {
                    mx2 = Math.Max(mx2, a[i]);
                }
            }
            if(mx2 != 0){
              Console.WriteLine("{0} {1}", mx, mx2);
            } else{
              int []cnt = new int[10005];
              for(int i = 0; i <= 10000; ++i) cnt[i] = 0;
              for(int i = 0; i < n; ++i){
                cnt[a[i]]++;
                if(cnt[a[i]] == 2){
                  mx2 = max(mx2, a[i]);
                }
              }
              Console.WriteLine("{0} {1}", mx, mx2);
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Something
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split(' ').Take(n).Select(int.Parse).ToArray();
            int mx = 0;
            for (int i = 0; i < n; ++i)
            {
                mx = Math.Max(mx, a[i]);

            }
            int mx2 = 0;
            for(int i = 0; i < n; ++i)
            {

                if(mx % a[i] != 0)
                {
                    mx2 = Math.Max(mx2, a[i]);
                }
            }
            if(mx2 != 0){
              Console.WriteLine("{0} {1}", mx, mx2);
            } else{
              int []cnt = new int[10005];
              for(int i = 0; i <= 10000; ++i) cnt[i] = 0;
              for(int i = 0; i < n; ++i){
                cnt[a[i]]++;
                if(cnt[a[i]] == 2){
                  mx2 = Math.max(mx2, a[i]);
                }
              }
              Console.WriteLine("{0} {1}", mx, mx2);
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class GFG
{
    static public void Main()
    {
        try
        {
            // int test = Convert.ToInt32(Console.ReadLine());
            // for (int i = 0; i < test; i++)

            {
                // var input = Console.ReadLine().Split(' ');
                var n = Int32.Parse(Console.ReadLine());
                //var a = int.Parse(input[0]);
                //var b = int.Parse(input[1]);
                //var c = int.Parse(input[2]);
                //var d = int.Parse(input[3]);
                //  var str = Console.ReadLine();

                //var arr1 = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
                //var arr2 = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

                List<int> lst = new List<int>();
                string[] input = Console.ReadLine().Split(' ');

                for (int i = 0; i < n; i++)
                {
                    lst.Add(Int32.Parse(input[i]);
                }

                DistictPoint(lst);
                Console.WriteLine();
            }
        }
        catch (Exception ex)
        {
            Console.Write(ex);
        }
    }
    static void DistictPoint(List<int> div)
    {

        int max = div.Max();

        for (int i = 1; i <= max; i++)
        {
            if (max % i == 0)
                div.Remove(i);
        }

        Console.Write(max + " " + div.Max());

    }

}


using Codeforces.Common;
using System;
using System.Diagnostics.Contracts;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Xml.Schema;

namespace Codeforces.R320C
{
    public static class Solver
    {
        public static void Main()
        {
            using (var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false })
            {
                Solve(Console.In, sw);
            }
        }

        public static void Solve(TextReader tr, TextWriter tw)
        {
            Contract.Requires(tr != null);
            Contract.Requires(tw != null);

            tw.WriteLine(Parse(tr));
        }

        private static int Parse(TextReader tr)
        {
            var l = tr.ReadLine();

            return Calc(l);
        }

        public static int Calc(string value)
        {
            Contract.Requires(value != null);

            var n = value.Length;
            var res = 0L;
            const int mod = 1000000007;

            foreach (char c in value)
            {
                res <<= 1;
                res += c == '1' ? 1 : 0;
                res %= mod;
            }

            return (int)(res * ModPow(2, n - 1, mod) % mod);
        }

        public static long ModPow(long x, int n, int mod)
        {
            var res = 1L;
            for (; n > 0; n >>= 1)
            {
                if ((n & 1) == 1)
                {
                    res = res * x % mod;
                }
                x = x * x % mod;
            }
            return res;
        }

    }
}


namespace topCoder
{
	using System;
	using System.Collections.Generic;

	class p1
	{
		public void test()
		{
			string[] parts = Console.ReadLine().Split(' ');
			int n = int.Parse(parts[0]);
			int m = int.Parse(parts[1]);

			int[] sw = new int[m];
			parts = Console.ReadLine().Split(' ');
			for (int i = 0; i < parts.Length; i++)
			{
				sw[i] = int.Parse(parts[i]);
			}

			int[] b = new int[n];
			for (int i = 0; i < n; i++)
			{
				b[i] = -1;
			}

			for (int i = 0; i < m; i++)
			{
				for (int j = sw[i] - 1; j < n; j++)
				{
					if (b[j] == -1)
						b[j] = sw[i];
				}
			}

			string ret = "";
			for (int i = 0; i < n; i++)
			{
				ret += b[i].ToString() + " ";
			}
			Console.WriteLine(ret.Trim());
		}
	}
}