problem_id
stringlengths 6
6
| user_id
stringlengths 10
10
| time_limit
float64 1k
8k
| memory_limit
float64 262k
1.05M
| problem_description
stringlengths 48
1.55k
| codes
stringlengths 35
98.9k
| status
stringlengths 28
1.7k
| submission_ids
stringlengths 28
1.41k
| memories
stringlengths 13
808
| cpu_times
stringlengths 11
610
| code_sizes
stringlengths 7
505
|
---|---|---|---|---|---|---|---|---|---|---|
p03241 | u167681994 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nn, m = map(int, input().split())\n\nif n == 1:\n print(m)\n exit()\na = []\nb = []\nfor i in range(1, math.ceil(math.sqrt(m))):\n if m % n == 0:\n print(m // n)\n exit()\n if m % i == 0:\n b.append(i)\n b.append(m // i)\n \nfor i in range(len(b)):\n if i * n <= m:\n a.append(i)\n print(max(a))\n\nif len(b) == 2:\n print(1)\nelse:\n print(max(a))\n', 'import math\nn, m = map(int, input().split())\n\nif n == 1:\n print(m)\n exit()\na = []\nb = []\nfor i in range(1, math.ceil(math.sqrt(m))):\n if m % n == 0:\n print(m // n)\n exit()\n if m % i == 0:\n b.append(i)\n b.append(m // i)\n \nprint(b)\n\nfor i in range(len(b)):\n if b[i] * n <= m:\n a.append(b[i])\nprint(a)\n\nif len(b) == 2:\n print(1)\nelse:\n print(max(a))\n', 'import math\nn, m = map(int, input().split())\n\nif n == 1:\n print(m)\n exit()\na = []\nb = []\nfor i in range(1, math.ceil(math.sqrt(m))):\n if m % n == 0:\n print(m // n)\n exit()\n if m % i == 0:\n b.append(i)\n b.append(m // i)\n \n#print(b)\n\nfor i in range(len(b)):\n if b[i] * n <= m:\n a.append(b[i])\n#print(a)\n\nif len(b) == 2:\n print(1)\nelse:\n print(max(a))\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s521596302', 's957871838', 's385833630'] | [9172.0, 9132.0, 9084.0] | [35.0, 36.0, 47.0] | [407, 410, 412] |
p03241 | u177388368 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['def make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n divisors.sort(reverse=True)\n return divisors\n\nlis=make_divisors(m)\n\nfor mm in lis:\n if mm<=i:\n ans=mm\n break\n\nprint(ans)', '\n\nn,m=list(map(int,input().split()))\n\ni=m//n\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n divisors.sort(reverse=True)\n return divisors\n\nlis=make_divisors(m)\n\nfor mm in lis:\n if mm<=i:\n ans=mm\n break\n\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s258799877', 's611544808'] | [3060.0, 3188.0] | [17.0, 20.0] | [343, 399] |
p03241 | u192588826 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m = map(int,input().split())\ndivisors = []\nfor i in range(1,int(n**0.5)+1):\n if m % i == 0:\n divisors.append(i)\n divisors.append(n//i)\ndivisors.sort()\nk = 0\nfor i in range(len(divisors)):\n if divisors[i] > m/n:\n k = i - 1\n break\n if i == len(divisors) - 1:\n k = len(divisors) - 1\nprint(divisors[i])\n', 'n,m = map(int,input().split())\ndivisors = []\nfor i in range(1,int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n divisors.append(n//i)\ndivisors.sort()\nk = 0\nfor i in range(len(divisors)):\n if divisors[i] > m/n:\n k = i - 1\n break\n if i == len(divisors) - 1:\n k = len(divisors) - 1\nprint(divisors[i])', 'n,m = map(int,input().split())\ndivisors = []\nfor i in range(1,int(m**0.5)+1):\n if m % i == 0:\n divisors.append(i)\n divisors.append(m//i)\ndivisors.sort()\nk = 0\nfor i in range(len(divisors)):\n if divisors[i] > m/n:\n k = i - 1\n break\n if i == len(divisors) - 1:\n k = len(divisors) - 1\nprint(divisors[k])'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s409769621', 's891943887', 's660449571'] | [3060.0, 3188.0, 3064.0] | [18.0, 18.0, 21.0] | [345, 344, 344] |
p03241 | u192908410 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nn,m=list(map(int,input().split()))\nret=1\nfor i in range(m//n+1,2,-1):\n if m%i == 0:\n ret=i\n break\nprint(ret)', '[print(max([i for j in [[i,a[1]//i] for i in range(1,int(a[1]**0.5)+1) if a[1]%i==0] for i in j if a[1]//i>=a[0]])) for a in [list(map(int,input().split()))]]'] | ['Wrong Answer', 'Accepted'] | ['s858211609', 's922975010'] | [2940.0, 3060.0] | [2103.0, 20.0] | [127, 158] |
p03241 | u199295501 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['# -*- coding: utf-8 -*-\nimport itertools\nfrom collections import Counter\n\nN, M = map(int, input().split())\n\ndef primes(n):\n primfac = []\n d = 2\n while d*d <= n:\n while (n % d) == 0:\n primfac.append(d) # supposing you want multiple factors repeated\n n //= d\n d += 1\n if n > 1:\n primfac.append(n)\n return primfac\n\n\nmod = M % N\ndiv = M // N\nif mod == 0:\n print(M//N)\n exit()\n\nf = primes(M)\n\n\nif len(f) <= 1:\n print(1)\n exit()\n\ncnt = Counter(f)\nans_list = []\n\ntmp_list = []\nfor k,v in cnt.items():\n tmp_list.append([i for i in range(v+1)])\n\n# prod = itertools.product(*tmp_list)\n# print(tmp_list)\n# print(list(prod))\n# print(prod)\nfor p in itertools.product(*tmp_list):\n # print(cnt.keys(), p)\n tmp = 1\n for k,i in zip(cnt.keys(),p):\n # print(k,i)\n tmp = tmp * (k ** i)\n\n if tmp >= N:\n ans_list.append(M//tmp)\n\n', '# -*- coding: utf-8 -*-\nimport itertools\n\nN, M = map(int, input().split())\n\ndef primes(n):\n primfac = []\n d = 2\n while d*d <= n:\n while (n % d) == 0:\n primfac.append(d) # supposing you want multiple factors repeated\n n //= d\n d += 1\n if n > 1:\n primfac.append(n)\n return primfac\n\n\nmod = M % N\ndiv = M // N\nif mod == 0:\n print(M//N)\n exit()\n\nf = primes(M)\n\n\nif len(f) <= 1:\n print(1)\n exit()\n\nans_list = []\nfor i in range(1,len(f)):\n set1 = set([tuple(sorted(l)) forl in list(itertools.combinations(f, i))])\n for com in set1:\n tmp = 1\n for c in com:\n tmp *= c\n if tmp >= N:\n ans_list.append(M//tmp)\n\nif len(ans_list) == 0:\n print(1)\nelse:\n print(max(ans_list))\n', '# -*- coding: utf-8 -*-\nimport itertools\nfrom collections import Counter\n\nN, M = map(int, input().split())\n\ndef primes(n):\n primfac = []\n d = 2\n while d*d <= n:\n while (n % d) == 0:\n primfac.append(d) # supposing you want multiple factors repeated\n n //= d\n d += 1\n if n > 1:\n primfac.append(n)\n return primfac\n\n\nmod = M % N\ndiv = M // N\nif mod == 0:\n print(M//N)\n exit()\n\nf = primes(M)\n\n\nif len(f) <= 1:\n print(1)\n exit()\n\ncnt = Counter(f)\nans_list = []\n\ntmp_list = []\nfor k,v in cnt.items():\n tmp_list.append([i for i in range(v+1)])\n\n# prod = itertools.product(*tmp_list)\n# print(tmp_list)\n# print(list(prod))\n# print(prod)\nfor p in itertools.product(*tmp_list):\n # print(cnt.keys(), p)\n tmp = 1\n for k,i in zip(cnt.keys(),p):\n # print(k,i)\n tmp = tmp * (k ** i)\n\n if tmp >= N:\n ans_list.append(M//tmp)\n', '# -*- coding: utf-8 -*-\nimport itertools\nfrom collections import Counter\n\nN, M = map(int, input().split())\n\ndef primes(n):\n primfac = []\n d = 2\n while d*d <= n:\n while (n % d) == 0:\n primfac.append(d) # supposing you want multiple factors repeated\n n //= d\n d += 1\n if n > 1:\n primfac.append(n)\n return primfac\n\n\nmod = M % N\ndiv = M // N\nif mod == 0:\n print(M//N)\n exit()\n\nf = primes(M)\n\n\nif len(f) <= 1:\n print(1)\n exit()\n\ncnt = Counter(f)\nans_list = []\n\ntmp_list = []\nfor k,v in cnt.items():\n tmp_list.append([i for i in range(v+1)])\n\nfor p in itertools.product(tmp_list):\n tmp = 1\n for k,i in zip(cnt.keys(),*p):\n tmp = tmp * (k ** i)\n\n if tmp >= N:\n ans_list.append(M//tmp)\n', '# -*- coding: utf-8 -*-\nimport itertools\nfrom collections import Counter\n\nN, M = map(int, input().split())\n\ndef primes(n):\n primfac = []\n d = 2\n while d*d <= n:\n while (n % d) == 0:\n primfac.append(d) # supposing you want multiple factors repeated\n n //= d\n d += 1\n if n > 1:\n primfac.append(n)\n return primfac\n\n\nmod = M % N\ndiv = M // N\nif mod == 0:\n print(M//N)\n exit()\n\nf = primes(M)\n\n\nif len(f) <= 1:\n print(1)\n exit()\n\ncnt = Counter(f)\nans_list = []\n\ntmp_list = []\nfor k,v in cnt.items():\n tmp_list.append([i for i in range(v+1)])\n\nfor p in itertools.product(tmp_list):\n tmp = 1\n for k,i in zip(cnt.keys(),*p):\n tmp = tmp * (k ** i)\n\n if tmp >= N and tmp > 1:\n ans_list.append(M//tmp)\n\n', '# -*- coding: utf-8 -*-\nimport itertools\nfrom collections import Counter\n\nN, M = map(int, input().split())\n\ndef primes(n):\n primfac = []\n d = 2\n while d*d <= n:\n while (n % d) == 0:\n primfac.append(d) # supposing you want multiple factors repeated\n n //= d\n d += 1\n if n > 1:\n primfac.append(n)\n return primfac\n\n\nmod = M % N\ndiv = M // N\nif mod == 0:\n print(M//N)\n exit()\n\nf = primes(M)\n\n\nif len(f) == 1:\n print(1)\n exit()\n\ncnt = Counter(f)\nans_list = []\n\ntmp_list = []\nfor k,v in cnt.items():\n tmp_list.append([i for i in range(v+1)])\n\nprint(cnt)\nprint(list(itertools.product(*tmp_list)))\nfor p in itertools.product(*tmp_list):\n tmp = 1\n for k,i in zip(cnt.keys(),p):\n tmp = tmp * (k ** i)\n\n if tmp > N:\n ans_list.append(M//tmp)\n\nif len(ans_list) == 0:\n print(1)\nelse:\n print(max(ans_list))\n', '# -*- coding: utf-8 -*-\nimport itertools\nfrom collections import Counter\n\nN, M = map(int, input().split())\n\ndef primes(n):\n primfac = []\n d = 2\n while d*d <= n:\n while (n % d) == 0:\n primfac.append(d) # supposing you want multiple factors repeated\n n //= d\n d += 1\n if n > 1:\n primfac.append(n)\n return primfac\n\n\nmod = M % N\ndiv = M // N\nif mod == 0:\n print(M//N)\n exit()\n\nf = primes(M)\n\n\nif len(f) == 1:\n print(1)\n exit()\n\ncnt = Counter(f)\nans_list = []\n\ntmp_list = []\nfor k,v in cnt.items():\n tmp_list.append([i for i in range(v+1)])\n\n# print(cnt)\n# print(list(itertools.product(*tmp_list)))\nfor p in itertools.product(*tmp_list):\n tmp = 1\n for k,i in zip(cnt.keys(),p):\n tmp = tmp * (k ** i)\n\n if tmp > N:\n ans_list.append(M//tmp)\n\nif len(ans_list) == 0:\n print(1)\nelse:\n print(max(ans_list))\n'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s059601759', 's119077864', 's147822099', 's155312581', 's493504361', 's968289751', 's268422804'] | [3316.0, 3064.0, 3444.0, 3444.0, 3316.0, 3444.0, 3444.0] | [27.0, 18.0, 25.0, 26.0, 28.0, 26.0, 26.0] | [940, 814, 947, 809, 822, 921, 925] |
p03241 | u210827208 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N,M = map(int, input().split())\nL = []\n \nfor i in range(1,(M**0.5)+1):\n if M % i == 0:\n L.append(i)\n L.append(int(M / i))\nL1 = [i for i in L if M / i >= N]\nprint(max(L1))', 'n,m=map(int,input().split())\n\nif m%n==0:\n print(int(m/n))\nelse:\n for i in range(n+1,int(m/2)):\n if m%i==0:\n print(int(m/i))\n break\n', 'N,M = map(int, input().split())\nL = []\n \nfor i in range(1,int(M**0.5)+1):\n if M % i == 0:\n L.append(i)\n L.append(int(M / i))\nL1 = [i for i in L if M / i >= N]\nprint(max(L1))\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s230749562', 's749779826', 's081547992'] | [3060.0, 3064.0, 2940.0] | [18.0, 2104.0, 22.0] | [187, 166, 191] |
p03241 | u211160392 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nN,M = map(int,input().split())\nfor i in range(math.floor((M/N)**0.5),-1,-1):\n if M%i == 0:\n print(int(M/i))\n break', 'import math\nN,M = map(int,input().split())\nfor i in range(1,math.floor((M/N)**0.5)):\n if M%i == 0:\n print(int(M/i))\n break', 'N,M = map(int,input().split())\na = []\nfor i in range(1,int(M**0.5)+1):\n if M%i == 0:\n a.append(i)\n a.append(int(M/i))\na.sort(reverse = True)\nfor i in a:\n if i <= M/N:\n print(i)\n break'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s029283042', 's843398487', 's832149444'] | [2940.0, 2940.0, 3060.0] | [18.0, 17.0, 21.0] | [143, 139, 217] |
p03241 | u222668979 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n, m = map(int, input().split())\n\nfor i in range(1, int(m**0.5)+1)[::-1]:\n if (m % i == 0) and (m / n >= i):\n print(max(i, m // i))\n break\n', 'n, m = map(int, input().split())\n\nfor i in range(1, int(m**0.5)+1)[::-1]:\n if (m % i == 0):\n if m / i >= n:\n ans = max(ans, i)\n if i >= n:\n ans = max(ans, m // i)\nprint(ans)\n', 'n, m = map(int, input().split())\n\nans = 0\nfor i in range(1, int(m ** 0.5) + 1):\n if m % i == 0:\n if m // i >= n:\n ans = max(ans, i)\n if i >= n:\n ans = max(ans, m // i)\nprint(ans)\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s195086858', 's715458862', 's697232474'] | [2940.0, 3060.0, 3060.0] | [21.0, 21.0, 21.0] | [156, 213, 218] |
p03241 | u225388820 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m=map(int,input().split())\nd=[]\nfor i in range(1,int(m**0.5)+1):\n if m%i==0:\n d.append(i,m//i)\nd.sort(reverse=True)\nfor i in d:\n if i*n<=m:\n print(i)\n exit()', 'n,m=map(int,input().split())\nd=[]\nfor i in range(1,int(m**0.5)+1):\n if m%i==0:\n d.append(i)\n d.append(m//i)\nd.sort(reverse=True)\nfor i in d:\n if i*n<=m:\n print(i)\n exit()'] | ['Runtime Error', 'Accepted'] | ['s261852769', 's334684157'] | [3060.0, 3060.0] | [17.0, 22.0] | [170, 184] |
p03241 | u227082700 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['def divisor(n):\n ass=[]\n for i in range(1,int(n**0.5)+1):\n if n%i==0:\n ass.append(i)\n if i!=n//i:ass.append(n//i)\n return ass\nn,m=map(int,input().split())\nd=divisor(m)\nd.sort(reverse=1)\nfor i in d:\n if m//i>=n:print(i):exit()', 'n,m=map(int,input().split())\ndef divisor(n):\n ass=[]\n for i in range(1,int(n**0.5)+1):\n if n%i==0:\n ass.append(i)\n if i!=n//i:ass.append(n//i)\n return ass\nans=0\nfor i in divisor(m):\n if m//i>=n:ans=max(ans,i)\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s152203074', 's074101739'] | [2940.0, 3064.0] | [17.0, 20.0] | [242, 236] |
p03241 | u231685196 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m = map(int,input().split())\n\nmax = m//n\n\nif m%n == 0:\n print(max)\nelse:\n for i in range(max):\n if m%(max-i) == 0:\n print(max)\n break\n\n\n\n', 'n,m = map(int,input().split())\n\nmax = m//n\nlis = []\n\n\nfor i in range(int(m**0.5)):\n if m%i == 0:\n lis.append(i)\n\nlis = lis[::-1]\n\nif m%n == 0:\n print(max)\nelse:\n for line in lis:\n if line > max:\n continue\n else:\n if lis%n == 0:\n print(lis)\n break\n\n\n\n', 'n,m = map(int,input().split())\n\nmax = m//n\nlis = []\n\n\nfor i in range(int(m**0.5)):\n if i != 0 and m%i == 0:\n lis.append(i)\nl = len(lis)\nfor i in range(l):\n if m/lis[i] != lis[i]:\n lis.append(m//lis[i])\n\nlis.sort()\nlis = lis[::-1]\n\nif m%n == 0:\n print(max)\nelse:\n for line in lis:\n if line > max:\n continue\n else:\n if m/line > n:\n print(line)\n break\n\n\n\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s203728332', 's995474161', 's339405401'] | [2940.0, 3060.0, 3064.0] | [2104.0, 17.0, 23.0] | [174, 332, 444] |
p03241 | u239528020 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['#!/usr/bin/env python3\n\nn, m = list(map(int, input().split()))\n\nans = 1\nnum = int(m**0.5)+1\n\nfor i in range(1, num):\n if m % i != 0:\n continue\n j = m//i\n if i >= n:\n ans = max(ans, j)\n # if j >= n:\n # ans = max(ans, i)\nprint(ans)\n', '#!/usr/bin/env python3\n\nn, m = list(map(int, input().split()))\n\nans = 1\nnum = int(m**0.5)+1\n\nfor i in range(1, num):\n if m % i != 0:\n continue\n j = m//i\n if i >= n:\n ans = max(ans, j)\n if j >= n:\n ans = max(ans, i)\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s207593806', 's696648380'] | [9320.0, 9336.0] | [33.0, 37.0] | [263, 259] |
p03241 | u241159583 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import sympy\nn,m = map(int, input().split())\n\nN = sympy.divisors(m)\n\nfor i in range(len(N)):\n if N[i] <= m/n:\n print(N[i])\n break', 'n,m = map(int, input().split())\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n%i == 0:\n divisors.append(i)\n if i != n//i:\n divisors.append(n//i)\n divisors.sort(reverse=True)\n return divisors\n\nnumbers = make_divisors(m)\nfor i in range(len(numbers)):\n if numbers[i] <= m/n:\n print(numbers[i])\n break'] | ['Runtime Error', 'Accepted'] | ['s644723777', 's293362236'] | [9036.0, 9324.0] | [23.0, 32.0] | [146, 360] |
p03241 | u242196904 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import numpy as np\ndef factorize(n):\n fct = [] \n b, e = 2, 0 \n while b * b <= n:\n while n % b == 0:\n n = n // b\n e = e + 1\n if e > 0:\n fct.append((b, e))\n b, e = b + 1, 0\n if n > 1:\n fct.append((n, 1))\n return fct\n\n\ndef divisorize(fct):\n b, e = fct.pop() \n pre_div = divisorize(fct) if fct else [[]]\n suf_div = [[(b, k)] for k in range(e + 1)]\n return [pre + suf for pre in pre_div for suf in suf_div]\n\ndef num(fct):\n a = 1\n for base, exponent in fct:\n a = a * base**exponent\n return a\ndef yaku(n):\n fct = factorize(n)\n y = divisorize(fct)\n ys = []\n for yy in y:\n ys.append(num(yy))\n ys.sort()\n return ys\n\nn,m = list(map(int,input().split()))\ny = yaku(m)\nnp.max(np.array(y)[np.array(y) <= m/n])', 'import numpy as np\ndef factorize(n):\n fct = [] \n b, e = 2, 0 \n while b * b <= n:\n while n % b == 0:\n n = n // b\n e = e + 1\n if e > 0:\n fct.append((b, e))\n b, e = b + 1, 0\n if n > 1:\n fct.append((n, 1))\n return fct\n\n\ndef divisorize(fct):\n b, e = fct.pop() \n pre_div = divisorize(fct) if fct else [[]]\n suf_div = [[(b, k)] for k in range(e + 1)]\n return [pre + suf for pre in pre_div for suf in suf_div]\n\ndef num(fct):\n a = 1\n for base, exponent in fct:\n a = a * base**exponent\n return a\ndef yaku(n):\n fct = factorize(n)\n y = divisorize(fct)\n ys = []\n for yy in y:\n ys.append(num(yy))\n ys.sort()\n return ys\n\nn,m = list(map(int,input().split()))\nif n == 1 and m == 1:\n print(1)\nelse:\n y = yaku(m)\n print(np.max(np.array(y)[np.array(y) <= m/n]))'] | ['Runtime Error', 'Accepted'] | ['s767225127', 's543915562'] | [18564.0, 12456.0] | [272.0, 179.0] | [872, 928] |
p03241 | u254871849 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ["import sys\nfrom math import sqrt, floor\nfrom bisect import bisect_right as bi_r\n\ndef factorize(n):\n res = []\n for i in range(1, floor(sqrt(n)) + 1):\n if not n % i:\n res.append(i, n // i)\n return sorted(res)\n\nn, m = map(int, sys.stdin.readline().split())\n\n\ndef main():\n res = factorize(m)\n ans = res[bi_r(res, m / n) - 1]\n return ans\n\nif __name__ == '__main__':\n ans = main()\n print(ans)", "import sys\nfrom math import sqrt, floor\nfrom bisect import bisect_right as bi_r\n\ndef factorize(n):\n res = []\n for i in range(1, floor(sqrt(n)) + 1):\n if not n % i:\n res.append(i)\n res.append(n // i)\n return sorted(res)\n\nn, m = map(int, sys.stdin.readline().split())\n\ndef main():\n res = factorize(m)\n ans = res[bi_r(res, m / n) - 1]\n return ans\n\nif __name__ == '__main__':\n ans = main()\n print(ans)"] | ['Runtime Error', 'Accepted'] | ['s265901304', 's574036069'] | [3064.0, 3064.0] | [18.0, 20.0] | [428, 450] |
p03241 | u257974487 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n, m = map(int,input().split())\nk = (m+1) // n\nfor i in range(1, k+1):\n if m % i == 0:\n ans = max(i, m // i)\n if i > m ** 0.5:\n break\n\nprint(ans)', 'def calc_divisor(n):\n div = []\n for i in range(1, int(n ** 0.5) + 1):\n if n % i == 0:\n div.append(i)\n if n // i != i:\n div.append(n//i)\n div.sort()\n return div\n\n\nn, m = map(int,input().split())\nk = (m+1) // n\n\ndiv = calc_divisor(m)\nfor i in div:\n if i <= k:\n ans = i\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s239578977', 's682754383'] | [3060.0, 3064.0] | [32.0, 21.0] | [165, 343] |
p03241 | u268210555 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n, m = map(int, input().split())\nfor i in range(1, min(m//n, int(m**0.5))+1)[::-1]:\n if m%i == 0:\n print(max(m//i, i)\n break', 'n, m = map(int, input().split())\nr = 1\nfor i in range(1, int(m**0.5)+1)[::-1]:\n if i<=m//n and m%i==0:\n if m//i<=m//n:\n r = max(r, m//i)\n else:\n r = max(r, i)\nprint(r)'] | ['Runtime Error', 'Accepted'] | ['s805987828', 's185555017'] | [2940.0, 2940.0] | [17.0, 24.0] | [141, 206] |
p03241 | u269969976 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['# coding: utf-8\nimport math\n\n(n, m) = [int(i) for i in input().rstrip().split(" ")]\n\nfor i in range(n, math.sqrt(m) + 1):\n if m % i == 0:\n print(int(m / i))\n break\n', '# coding: utf-8\nimport math\n\n(n, m) = [int(i) for i in input().rstrip().split(" ")]\n\nfor i in range(n, int(math.sqrt(m)) + 1):\n if m % i == 0:\n print(int(m / i))\n break\n', '# coding: utf-8\nimport math\n\n(n, m) = [int(i) for i in input().rstrip().split(" ")]\n\nans = 0\nfor i in range(1, int(math.sqrt(m)) + 1):\n if m % i == 0:\n if i >= n:\n ans = m / i\n elif (m/i) >= n:\n ans = i', '# coding: utf-8\nimport math\n\n(n, m) = [int(i) for i in input().rstrip().split(" ")]\n\nans = 0\ndivList = []\nfor i in range(1, int(math.sqrt(m)) + 1):\n if m % i == 0:\n j = m / i\n divList.append(i)\n divList.append(j)\ndivList = sorted(divList)\nfor i in divList:\n if i < n:\n continue\n ans = m / i\n break\n\nprint(int(ans))\n'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s345710504', 's613233584', 's766991435', 's298789683'] | [3060.0, 2940.0, 2940.0, 3060.0] | [18.0, 20.0, 21.0, 21.0] | [181, 186, 241, 355] |
p03241 | u280978334 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['nm=[int(x) for x in input().split()]\nfor x in range(int(nm[1]/nm[0]),1,-1):\n print(x)\n if(nm[1]%x==0):\n print(x)\n break', 'n,m = map(int,input().split())\ndef getDivisor(inte):\n Ans1 = [1]\n Ans2 = [inte]\n for i in range(2,int(inte**(0.5))):\n if inte % i == 0:\n Ans1.append(i)\n Ans2.append(int(inte/i))\n if inte % inte**(0.5) == 0:\n Ans1.append(int(int(inte**(0.5))))\n Ans = Ans1 + Ans2[::-1]\n return Ans\n\nlimit = int(m/n)\nfor i in reversed(getDivisor(m)):\n if i <= limit:\n print(i)\n break\n'] | ['Wrong Answer', 'Accepted'] | ['s308310306', 's215790514'] | [23780.0, 3188.0] | [2103.0, 21.0] | [139, 436] |
p03241 | u285891772 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ["import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd\nfrom itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom bisect import bisect, bisect_left, insort, insort_left\nfrom heapq import heappush, heappop\nfrom functools import reduce\ndef input(): return sys.stdin.readline().strip()\ndef INT(): return int(input())\ndef MAP(): return map(int, input().split())\ndef LIST(): return list(map(str, input().split()))\ndef ZIP(n): return zip(*(MAP() for _ in range(n)))\nsys.setrecursionlimit(10 ** 9)\nINF = float('inf')\nmod = 10 ** 9 + 7\n#import numpy as np\nfrom decimal import *\n \n\nN, M = MAP()\n\ndef make_divisors(n): \n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n%i == 0:\n divisors.append(i)\n if i != n//i:\n divisors.append(n//i)\n divisors.sort()\n return divisors\n \ndivisors = make_divisors(M)\nprint(divisors)n = divisors[bisect_left(divisors, N)]\nprint(M//n)\n", "import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd\nfrom itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom bisect import bisect, bisect_left, insort, insort_left\nfrom heapq import heappush, heappop\nfrom functools import reduce\ndef input(): return sys.stdin.readline().strip()\ndef INT(): return int(input())\ndef MAP(): return map(int, input().split())\ndef LIST(): return list(map(str, input().split()))\ndef ZIP(n): return zip(*(MAP() for _ in range(n)))\nsys.setrecursionlimit(10 ** 9)\nINF = float('inf')\nmod = 10 ** 9 + 7\n#import numpy as np\nfrom decimal import *\n \n\nN, M = MAP()\n\ndef make_divisors(n): \n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n%i == 0:\n divisors.append(i)\n if i != n//i:\n divisors.append(n//i)\n divisors.sort()\n return divisors\n \n\ndivisors = make_divisors(M)\nprint(divisors)\nn = divisors[bisect_left(divisors, N)]\nprint(M//n)\n", "import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd\nfrom itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom bisect import bisect, bisect_left, insort, insort_left\nfrom heapq import heappush, heappop\nfrom functools import reduce\ndef input(): return sys.stdin.readline().strip()\ndef INT(): return int(input())\ndef MAP(): return map(int, input().split())\ndef LIST(): return list(map(str, input().split()))\ndef ZIP(n): return zip(*(MAP() for _ in range(n)))\nsys.setrecursionlimit(10 ** 9)\nINF = float('inf')\nmod = 10 ** 9 + 7\n#import numpy as np\nfrom decimal import *\n \n\nN, M = MAP()\n\ndef make_divisors(n): \n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n%i == 0:\n divisors.append(i)\n if i != n//i:\n divisors.append(n//i)\n divisors.sort()\n return divisors\n \n\ndivisors = make_divisors(M)\nn = divisors[bisect_left(divisors, N)]\nprint(M//n)\n"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s751570909', 's790746699', 's047968467'] | [9096.0, 10840.0, 10828.0] | [28.0, 41.0, 41.0] | [1327, 1329, 1313] |
p03241 | u288430479 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['from fractions import gcd\nn,m = map(int,input().split())\nif m%n==0:\n print(int(m//n))\n exit()\nelse:\n a = m//n\n for i in range(a,0,-1):\n s = m-n*i\n if (s+i)%i==0:\n print(i)\n exit()', 'from fractions import gcd\nn,m = map(int,input().split())\nif m%n==0:\n print(int(m//n))\n exit()\nelse:\n a = m%n\n b = m//n\n c = a+b\n while True:\n if gcd(b,c)!=1:\n print(gcd(b,c))\n exit()\n else:\n c -= 1\nprint(1)', 'n,m = map(int,input().split())\nif m%n==0:\n print(int(m//n))\n exit()\nelse:\n a = m/n\n l = []\n for i in range(int(m**0.5),0,-1):\n if m%i==0:\n l.append(i)\n l.append(m//i)\n l = sorted(l)[::-1]\n for j in l:\n if j<=a:\n print(j)\n exit()\n else:\n print(1)'] | ['Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s442380337', 's786743375', 's470560694'] | [10380.0, 5048.0, 9248.0] | [2206.0, 37.0, 34.0] | [203, 271, 287] |
p03241 | u298297089 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nN, M = map(int, input().split())\nmx = 0\nfor i in range(1, math.floor(math.sqrt(M))+1):\n if M % i == 0:\n if M // i >= N:\n mx = max(mx, i)\n \tif i >= N:\n \tmx = max(mx, M//i)\nprint(mx)', 'import math\nN, M = map(int, input().split())\nmx = 0\nfor i in range(1, math.floor(math.sqrt(M))+1):\n if M % i == 0:\n if M // i >= N:\n mx = max(mx, i)\n \telse:\n mx = max(mx, M//i)\nprint(mx)', 'def make_divisors(div, n):\n divisors = []\n mx = 0\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if n // i >= div:\n mx = max(mx, i)\n if i != n // i:\n divisors.append(n//i)\n if i >= div:\n mx = max(mx, n // i)\n return divisors, mx\n\nn,m = map(int, input().split())\ndivisors, mx = make_divisors(n, m)\nprint(mx)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s448104716', 's950144479', 's382316056'] | [2940.0, 2940.0, 3064.0] | [17.0, 17.0, 20.0] | [223, 221, 447] |
p03241 | u303037478 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\n\nn,m = map(int, input().split())\n\nx=int(math.sqrt(m))\n\nans=1\nfor i in range(1,x+1):\n if i*n<=m:\n if i <= y:\n ans=max(ans,i)\n if (m/i)*n<=m:\n ans=max(ans,m/i)\nprint(ans)\n\n\n', 'import math\n\nn,m = map(int, input().split())\n\nx=int(math.sqrt(m))\n\nans=1\nfor i in range(1,x+1):\n if m%i==0:\n if i*n<=m:\n ans=max(ans,i)\n if (m/i)*n<=m:\n ans=max(ans,m/i)\nprint(int(ans))\n\n\n\n\n'] | ['Runtime Error', 'Accepted'] | ['s153441366', 's788645735'] | [3060.0, 3060.0] | [18.0, 21.0] | [200, 207] |
p03241 | u316341119 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\n(N, M) = map(int, input().split())\n\nMAX_SQRT = int(math.sqrt(M))\nfor i in range(MAX_SQRT, 0, -1):\n if M%i == 0 and M%(i*N) == 0:\n ans = i\n break\n\nprint(ans)\n', 'import math\n(N, M) = map(int, input().split())\n\nMAX_SQRT = int(math.sqrt(M))\nprime_flag = [True] * (MAX_SQRT+1)\nprime_dic = {}\n\nprime_flag[0] = False\nprime_flag[1] = False\n\nfor i in range(2, MAX_SQRT+1):\n mul = 2\n while True:\n p = i * mul\n if p > MAX_SQRT:\n break\n prime_flag[p] = False\n mul += 1\n\nTMPM = M\nfor i in range(2, MAX_SQRT+1):\n if prime_flag[i]:\n while TMPM%i == 0:\n if i in prime_dic:\n prime_dic[i] += 1\n else:\n prime_dic[i] = 1\n TMPM = int(TMPM/i)\n\nif TMPM > 1 or len(prime_dic) == 0:\n prime_dic[TMPM] = 1\n\nmax_mul = 1\ndef Rec(mul, p):\n global max_mul\n if M//mul < N:\n return\n\n if p >= len(prime_dic):\n if mul > max_mul:\n max_mul = mul\n return\n\n k = list(prime_dic.keys())[p]\n v = list(prime_dic.values())[p]\n for i in range(v+1):\n Rec(mul*(k**i), p+1)\n\nRec(1, 0)\nprint(max_mul)\n\n \n'] | ['Runtime Error', 'Accepted'] | ['s454485972', 's218230812'] | [2940.0, 3316.0] | [21.0, 99.0] | [186, 976] |
p03241 | u323045245 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m=map(int, input().split())\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n divisors.sort()\n return divisors\nans = 1\nfor i in make_divisors:\n if i>=n:\n ans=max(ans,m//i)\nprint(ans)', 'n,m=map(int, input().split())\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n divisors.sort()\n return divisors\nans = 1\nfor i in make_divisors(m):\n if i>=n:\n ans=max(ans,m//i)\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s661374883', 's113160330'] | [3064.0, 3064.0] | [17.0, 21.0] | [349, 352] |
p03241 | u325282913 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import fractions\nN, M = map(int, input().split())\nans = fractions.gcd(M//N,(M//N)+M%N)\nprint(ans)', 'import math\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n return divisors\nN, M = map(int, input().split())\ndiv = make_divisors(M)\nans = 0\nfor i in div:\n if M // i >= N:\n ans = max(ans,i)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s605848090', 's365413883'] | [5432.0, 3064.0] | [43.0, 20.0] | [97, 364] |
p03241 | u327466606 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m = map(int,input().split())\ngcd = m//n\nwhile n*gcd != m:\n gcd = M//n\n n = 1 + (M-1)//gcd\nprint(gcd)', 'n,m = map(int,input().split())\ngcd = m//n\nwhile n*gcd != m:\n n = 1 + (M-1)//gcd\n gcd = M//n\nprint(gcd)', 'n,m = map(int,input().split())\ngcd = m//n\nwhile n*gcd != m:\n gcd = m//n\n n = 1 + (m-1)//gcd\nprint(gcd)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s406855047', 's946364131', 's806479081'] | [2940.0, 2940.0, 2940.0] | [18.0, 25.0, 32.0] | [104, 104, 104] |
p03241 | u329407311 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nN,M = map(int,input().split())\n\nsq = math.sqrt(M)\n\nfor i in range(1,sq+1):\n if M % i == 0:\n if i <= math.floor(M/N):\n ans = i\n \nprint(int(ans))', 'import fractions\nN,M = map(int,input().split())\n\nif M % N != 0:\n \n a = int(M % N)\n b = (M - a) / N\n c = fractions.gcd(a, b)\n print(int(c))\nelse:\n print(int(M/N))\n', 'import math\nN,M = map(int,input().split())\n\nif M % N != 0:\n \n a = int(M % N)\n b = (M - a) / N\n c = math.gcd(a, b)\n print(c)\nelse:\n print(int(M/N))\n', 'N,M = map(int,input().split())\n\nif M % N != 0:\n \n a = int(M % N)\n b = (M - a) / N\n c = math.gcd(a, b)\n print(c)\nelse:\n print(int(M/N))\n', 'import math\nN,M = map(int,input().split())\n\nsq = math.sqrt(M)\nsq = math.floor(sq)\n\n\nans = 1\nfor i in range(1,sq+2):\n if M % i == 0:\n if i * N <= M:\n ans = max(i,ans)\n if M / i * N <= M:\n ans = max(M // i,ans)\nif N == 1:\n print(int(M))\nelse:\n print(int(ans))\n'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s147584584', 's167417461', 's449687850', 's681093953', 's820284315'] | [3060.0, 5308.0, 3064.0, 3060.0, 3060.0] | [17.0, 37.0, 18.0, 19.0, 21.0] | [167, 168, 153, 141, 277] |
p03241 | u332906195 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['# -*- coding: utf-8 -*-\n\nN = int(input())\nX, Y, H = [], [], []\nfor _ in range(N):\n x, y, h = map(int, input().split())\n X.append(x)\n Y.append(y)\n H.append(h)\n\nfor x in range(101):\n for y in range(101):\n hc = {H[i] + abs(X[i] - x) + abs(Y[i] - y) for i in range(N) if H[i] > 0}\n h0 = {H[i] + abs(X[i] - x) + abs(Y[i] - y) for i in range(N) if H[i] == 0}\n if len(hc) == 1:\n if (len(h0) > 0 and min(h0) >= list(hc)[0]) or len(h0) == 0:\n print(x, y, list(hc)[0])\n break\n', '# -*- coding: utf-8 -*-\n\nimport bisect\n\nN, M = map(int, input().split())\n\ny = [1, M]\nfor i in range(2, int(M ** 0.5) + 1):\n if M % i == 0:\n y.append(i)\n y.append(M // i)\n\ny.sort()\nprint(M // y[bisect.bisect_left(y, N)])\n\n'] | ['Runtime Error', 'Accepted'] | ['s723000424', 's098893670'] | [3064.0, 3060.0] | [19.0, 22.0] | [543, 238] |
p03241 | u338824669 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['def make_divisors(n):\n divisors=[]\n for i in range(1,int(n**0.5)+1):\n if n%i==0:\n divisors.append(i)\n if i!=n//i:\n divisors.append(n//i)\n divisors.sort()\n return divisors\n\nN,M=map(int,input().split())\ndivisors=make_divisors(M)\nans=0\nfor d in divisors:\n if N*d<=M:\n ans=d\n else:\n break', 'def make_divisors(n):\n divisors=[]\n for i in range(1,int(n**0.5)+1):\n if n%i==0:\n divisors.append(i)\n if i!=n//i:\n divisors.append(n//i)\n divisors.sort()\n return divisors\n\nN,M=map(int,input().split())\ndivisors=make_divisors(M)\nans=0\nfor d in divisors:\n if N*d<=M:\n ans=d\n else:\n break\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s471370836', 's928114257'] | [3060.0, 3064.0] | [20.0, 20.0] | [360, 371] |
p03241 | u349836672 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['# coding: utf-8\nimport math\n\nN, M = [int(s) for s in input().strip().split()]\n\nif N == 1:\n print(M)\n exit()\n\nROOT_M = int(math.sqrt(M))\ndivisors = []\nfor d in range(1, ROOT_M+1):\n if M % d == 0:\n divisors.append(d)\n divisors.append(M//d)\n\nmax_gcd = max([d for d in divisors if d > M/N])\nprint(max_gcd)\n', '# coding: utf-8\nimport math\n\nN, M = [int(s) for s in input().strip().split()]\n\nif N == 1:\n print(M)\n exit()\n\nROOT_M = int(math.sqrt(M))\ndivisors = []\nfor d in range(1, ROOT_M+1):\n if M % d == 0:\n divisors.append(d)\n divisors.append(M//d)\n\ndivisors.sort()\nMAX_VAL = int(M/N)\nfor d in divisors:\n if d > MAX_VAL:\n break\n max_gcd = d\n\nprint(max_gcd)\n'] | ['Wrong Answer', 'Accepted'] | ['s281246513', 's545606991'] | [3060.0, 3060.0] | [21.0, 21.0] | [325, 382] |
p03241 | u357751375 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['from math import sqrt\nfrom math import floor\nn,m = map(int,input().split())\nd = m // n\nans = 1\nfor i in range(1,floor(sqrt(m))+1):\n if m % i == 0:\n x = m // i\n if i <= d:\n ans = max(ans,x,i)\nprint(ans)', 'from math import sqrt\nfrom math import floor\nn,m = map(int,input().split())\nd = m // n\nans = 1\nfor i in range(1,floor(sqrt(m))+1):\n if m % i == 0:\n x = m // i\n if i <= d:\n ans = max(ans,i)\n if x <= d:\n ans = max(ans,x)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s359654856', 's848039865'] | [9184.0, 9184.0] | [34.0, 34.0] | [229, 275] |
p03241 | u362560965 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\n\nN, M = map(int, input().split())\n\ndef get_div_list(num):\n if num == 1:\n return [1]\n else:\n div_list = []\n div_list.append(1)\n div_list.append(num)\n for i in range(2, math.floor(math.sqrt(num))+ 1):\n if num % i == 0:\n div_list.append(i)\n div_list.append(num // i)\n list(set(div_list))\n div_list.sort(reverse = True)\n return div_list\n\n# amax = M // N\nL = get_div_list(M)\n\n\n# ans = L[-1]\n\n# print(ans)\n', 'import math\n\nN, M = map(int, input().split())\n\n# N = 3\n# M = 14\n\ndef get_div_list(num):\n if num == 1:\n return [1]\n else:\n div_list = []\n div_list.append(1)\n div_list.append(num)\n for i in range(2, math.floor(math.sqrt(num))+ 1):\n if num % i == 0:\n div_list.append(i)\n div_list.append(num // i)\n list(set(div_list))\n return div_list\n\namax = M // N\nL = get_div_list(M)\nL = [i for i in L if i <= amax]\nprint(L)\n\nans = L[-1]\n\nprint(ans)\n', 'import math\n\nN, M = map(int, input().split())\n\ndef get_div_list(num):\n if num == 1:\n return [1]\n else:\n div_list = []\n div_list.append(1)\n div_list.append(num)\n for i in range(2, math.floor(math.sqrt(num))+ 1):\n if num % i == 0:\n div_list.append(i)\n div_list.append(num // i)\n list(set(div_list))\n div_list.sort(reverse = True)\n return div_list\n\namax = M // N\nL = get_div_list(M)\nL = [i for i in L if i <= amax]\n\nans = L[-1]\n\nprint(ans)\n', 'import math\n\n# N, M = map(int, input().split())\n\nN = 100000\nM = 1000000000\n\ndef get_div_list(num):\n if num == 1:\n return [1]\n else:\n div_list = []\n div_list.append(1)\n div_list.append(num)\n for i in range(2, math.floor(math.sqrt(num))+ 1):\n if num % i == 0:\n div_list.append(i)\n div_list.append(num // i)\n list(set(div_list))\n return div_list\n\n\nL = get_div_list(M)\nL = [i for i in L if i * N <= M]\n# print(L)\n\n\nfor i in L[::-1]:\n if (M - (N * i)) % i == 0:\n ans = i\n break\n\nprint(ans)\n', 'import math\n\nN, M = map(int, input().split())\n\ndef get_div_list(num):\n if num == 1:\n return [1]\n else:\n div_list = []\n div_list.append(1)\n div_list.append(num)\n for i in range(2, math.floor(math.sqrt(num))+ 1):\n if num % i == 0:\n div_list.append(i)\n div_list.append(num // i)\n list(set(div_list))\n div_list.sort(reverse = True)\n return div_list\n\namax = M // N\nL = get_div_list(M)\nL = [i for i in L if i <= amax]\n\nans = L[-1]\n\n# print(ans)\n', 'N, M = map(int, input().split())\n\ndef make_divisor_list(num):\n if num < 1:\n return []\n elif num == 1:\n return [1]\n else:\n divisor_list = []\n divisor_list.append(1)\n for i in range(2, num // 2 + 1):\n if num % i == 0:\n divisor_list.append(i)\n divisor_list.append(num)\n\n return divisor_list\n\n# amax = M // N\nL = make_divisor_list(M)\n\n\n# ans = L[-1]\n\n# print(ans)\n', 'import math\n\n# N, M = map(int, input().split())\n\nN = 100000\nM = 1000000000\n\ndef pfac(n):\n values = [1, n]\n for i in range(2, int(n ** 0.5) + 1):\n if n % i == 0:\n values.append(i)\n values.append(n // i)\n return values\n\nL = pfac(M)\nL = [i for i in L if i * N <= M]\n\nans = []\nfor i in L[::-1]:\n if (M - (N * i)) % i == 0:\n \n ans.append(i)\nprint(max(ans))\n\n# ans2 = 1\n\n\n# \n# ans2 = i\n# break\n# print(ans2)', 'import math\n\nN, M = map(int, input().split())\n\n# N = 100000\n# M = 1000000000\n\ndef pfac(n):\n values = [1, n]\n for i in range(2, int(n ** 0.5) + 1):\n if n % i == 0:\n values.append(i)\n values.append(n // i)\n return values\n\nL = pfac(M)\nL = [i for i in L if i * N <= M]\n\nans = []\nfor i in L[::-1]:\n if (M - (N * i)) % i == 0:\n \n ans.append(i)\nprint(max(ans))\n\n# ans2 = 1\n\n\n# \n# ans2 = i\n# break\n# print(ans2)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s077946382', 's129576144', 's327877727', 's398218704', 's570128011', 's706191974', 's749293904', 's642402135'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 2940.0, 3064.0, 3064.0] | [20.0, 20.0, 21.0, 20.0, 20.0, 2104.0, 20.0, 20.0] | [548, 529, 540, 598, 542, 477, 555, 557] |
p03241 | u375616706 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n, m = (list)(map(int, input().split()))\n\nupper = m//n\nans = 0\nfor i in reversed(range(1, upper+1)):\n if m % i == 0:\n ans = i\n if (m // i) > i and (m // i) <= upper:\n ans = m // i\n break\n\nprint(ans)\n', 'import math\nn,m=list(map(int,input().split()))\nlim=(int)(2*m/((n-1)*(n)))\nfor i in reversed(range(1,lim+2)):\n a=m%i\n b=m/i\n print(i,a,b,n)\n if a==0 and b>=n:\n for j in range(1,(int)(n/3+1)):\n if(math.factorial(b-2)\n /(math.factorial(n-j-1)*math.factorial(b-n+j-1))>0):\n print(j*i)\n exit()\n', 'n, m = (list)(map(int, input().split()))\n\nupper = m//n\nans = 0\nfor i in range(1, upper+1):\n if m % i == 0:\n ans = i\n if (m // i) > i and (m // i) <= upper:\n ans = m // i\n break\n\nprint(ans)\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s444178405', 's487636232', 's611481376'] | [2940.0, 27744.0, 2940.0] | [2104.0, 2104.0, 39.0] | [238, 368, 228] |
p03241 | u379692329 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import sys\ninput = sys.stdin.readline\n\nN, M = map(int, input().split())\nif M % N == 0:\n print(M//N)\nelse:\n upper = math.ceil(M/N)\n for i in range(upper, 0, -1):\n if M % i == 0:\n break\n\n print(i)', 'import bisect\nimport math\nimport sys\ninput = sys.stdin.readline\n\nN, M = map(int, input().split())\nif M % N == 0:\n print(M//N)\nelse:\n upper = math.ceil(M/N)\n factor = set()\n for i in range(1, int(M**0.5)+1):\n if M % i == 0:\n factor.add(i)\n \n factor1 = set()\n for i in factor:\n factor1.add(M//i)\n factor |= factor1\n \n factor = sorted(list(factor))\n print(factor[bisect.bisect_right(factor, upper)-1])'] | ['Runtime Error', 'Accepted'] | ['s598190663', 's769149920'] | [3060.0, 3188.0] | [18.0, 22.0] | [224, 456] |
p03241 | u379959788 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['from fractions import gcd\nN, M = map(int, input().split())\ncnt = M // N\nM -= N * cnt\nans = 1\nwhile True:\n if cnt == 1:\n ans = cnt\n break\n if M == 0:\n ans = cnt\n break\n tmp = gcd(cnt, M)\n if tmp != 1:\n ans = min(cnt, tmp)\n break\n M += N\n cnt -= 1\n\nprint(ans)', 'from fractions import gcd\nN, M = map(int, input().split())\nk = 0\nwhile True:\n if M % (N + k) == 0:\n ans = M // (N+k)\n break\n k += 1\nprint(ans)', 'from fractions import gcd\nN, M = map(int, input().split())\ncnt = M // N\nM -= N * cnt\nans = 1\nwhile True:\n if M == 0:\n ans = cnt\n break\n tmp = gcd(cnt, M)\n if tmp != 1:\n ans = min(cnt, tmp)\n break\n M += N\n cnt -= 1\n\nprint(ans)', 'import bisect\ndef make_divisors(N):\n divisors = []\n for i in range(1, int(N**0.5)+1):\n if N % i == 0:\n divisors.append(i)\n if i != N // i:\n divisors.append(N//i)\n divisors.sort()\n return divisors\nN, M = map(int, input().split())\nlst = make_divisors(M)\nprint(lst[bisect.bisect_right(lst, M//N)-1])'] | ['Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s779235811', 's789398796', 's820365124', 's541951234'] | [5048.0, 5048.0, 5048.0, 3188.0] | [65.0, 2104.0, 63.0, 20.0] | [317, 162, 268, 352] |
p03241 | u404629709 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['vn,m=map(int,input().split())\n\nif n==1:\n print(m)\nelse:\n a=int(m**0.5)\n\n for i in range(a+1,0,-1):\n if m%i==0 and i*n<=m:\n print(i)\n break', 'n,m=map(int,input().split())\n\nif n==1:\n print(m)\nelse:\n a=int(m**0.5)\n\n for i in range(int(m/n),a-1,-1):\n \n if m%i==0 and i*n<=m:\n print(i)\n break', 'n,m=map(int,input().split())\n\nans=0\n\nif n==1:\n print(m)\nelse:\n a=int(m**0.5)\n\n for i in range(1,a):\n if m%i==0:\n if i*n<=m:\n ans=max(ans,i)\n if (m//i)*n<=m:\n ans=max(ans,m//i)\n print(ans)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s657459525', 's678292802', 's883388144'] | [3060.0, 2940.0, 3064.0] | [20.0, 2104.0, 22.0] | [154, 165, 218] |
p03241 | u404676457 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\n(n, m) = map(int, input().split())\nsm = int(math.sqrt(m)) + 1\nfor i in range(1, sm + 1):\n if m % i == 0 :\n params[i] = 1\n params[m // i] = 1\nparams = sorted(params)\nmdn = m // n\nmaxans = 0\nfor i in params:\n if n > m / i:\n break\n maxans = i\nprint(maxans)', 'import math\n(n, m) = map(int, input().split())\nsm = int(math.sqrt(m))\nparams = {}\nfor i in range(2, sm + 1):\n if m % i == 0 :\n params[i] = 1\n params[m // i] = 1\nparams = sorted(params)\n\nmdn = m // n\nfor i in params:\n if mdn <= i:\n print(i)\n break', 'import math\n(n, m) = map(int, input().split())\nsm = int(math.sqrt(m)) + 1\nparams = {}\nfor i in range(1, sm + 1):\n if m % i == 0 :\n params[i] = 1\n params[m // i] = 1\nparams = sorted(params)\nans = 0\nfor param in params:\n if n > m / iparam:\n break\n ans = param\nprint(ans)', 'import math\n(n, m) = map(int, input().split())\nsm = int(math.sqrt(m)) + 1\nparams = {}\nfor i in range(2, sm + 1):\n if m % i == 0 :\n params[i] = 1\n params[m // i] = 1\nparams = sorted(params)\nmdn = m // n\nmaxans = 0\nfor i in params:\n if m > m / i:\n break\n maxans = i\nprint(maxans)', 'import math\n(n, m) = map(int, input().split())\nsm = int(math.sqrt(m)) + 1\nparams = {}\nfor i in range(1, sm + 1):\n if m % i == 0 :\n params[i] = 1\n params[m // i] = 1\nparams = sorted(params)\nans = 0\nfor param in params:\n if n > m / param:\n break\n ans = param\nprint(ans)'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s071987810', 's118260816', 's535644472', 's729066898', 's995625209'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0] | [18.0, 21.0, 21.0, 21.0, 21.0] | [295, 280, 298, 307, 297] |
p03241 | u405660020 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m=map(int,input().split())\n\nlimit=int(m**(1/2))+1\n\ndivisors=[]\nfor d in range(limit):\n if m%d==0:\n divisors.append(d)\n divisors.append(m//d)\nans=1\n\nfor d in divisors:\n if n*d<=m:\n ans=d\nprint(ans)\n', 'n, m = map(int, input().split())\n\nlimit = int(m**(0.5))\nans = 1\nfor d in range(1, limit+1):\n if m % d == 0:\n if m>=d*n:\n ans = max(ans,d)\n if m>=(m//d)*n:\n ans=max(ans,(m//d))\n\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s342857476', 's648976373'] | [3060.0, 3060.0] | [18.0, 21.0] | [226, 227] |
p03241 | u413165887 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ["import sys\nn, m = map(int, input().split(' '))\n \nh = int(m/n)+1\nx = 0\n\nif h%2 == 0:\n if m%h == 0:\n print(h)\n sys.exit()\n h -= 1\n for a in range(h, 0, -2):\n if a*n <= m:\n if m%a == 0:\n print(a)\n sys.exit()\n else:\n continue\nelse:\n if m%h == 0:\n print(h)\n sys.exit()\n for a in range(h, 0, -2):\n if a*n <= m:\n if m%a == 0:\n print(a)\n sys.exit()\n else:\n continue", "import sys\n\ndef make_divisors(num):\n divisors = []\n for i in range(1, int(num**0.5)+1):\n if num%i == 0:\n divisors.append(i)\n if num//i != i:\n divisors.append(num//i)\n divisors.sort()\n return divisors\n\nn, m = map(int, input().split(' '))\n\ndivisors = make_divisors(n)\nfor i in range(1, len(divisors)+1):\n if divisors[i*-1] * n <= m:\n print(divisors[i*-1])\n sys.exit()", "import sys\n\ndef make_divisors(num):\n divisors = []\n for i in range(1, int(num**0.5)+1):\n if num%i == 0:\n divisors.append(i)\n if num//i != i:\n divisors.append(num//i)\n divisors.sort()\n return divisors\n\nn, m = map(int, input().split(' '))\n\ndivisors = make_divisors(m)\n\nfor i in range(1, len(divisors)+1):\n if divisors[i*-1] * n <= m:\n print(divisors[i*-1])\n sys.exit()"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s131441697', 's997087083', 's861562627'] | [3064.0, 3064.0, 3188.0] | [2104.0, 18.0, 20.0] | [536, 446, 439] |
p03241 | u433195318 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import sys\nsys.setrecursionlimit(4100000)\nimport math\nimport fractions\nimport bisect\n\nMOD = int(1e9+7)\nPI = 3.14159265358979323846264338327950288\n\n\n\n\nN, M = map(int, input().split())\n\nans = 0\nfor i in range(1, int(math.sqrt(M))+1):\n\n if M < i*N:\n break\n\n if M >= (M//i)*N:\n ans = M//i\n break\n\n if M % i == 0:\n ans = i\n\n\n\nprint(int(ans))', 'import sys\nsys.setrecursionlimit(4100000)\nimport math\nimport fractions\nimport bisect\n\nMOD = int(1e9+7)\nPI = 3.14159265358979323846264338327950288\n\n\n\n\nN, M = map(int, input().split())\n\nans = 0\nfor i in range(1, int(math.sqrt(M))+1):\n\n if M < i*N:\n break\n\n if M % i == 0:\n if M >= (M//i)*N:\n ans = M//i\n break\n\n ans = i\n\n\n\nprint(int(ans))'] | ['Wrong Answer', 'Accepted'] | ['s298506265', 's022391057'] | [5048.0, 5472.0] | [46.0, 52.0] | [645, 657] |
p03241 | u434739481 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N, M = map(int, input().split(" "))\ndiv1 = []\ndiv2 = []\n\nfor i in range(1, int(math.sqrt(M))+1):\n if M % i == 0:\n div1 += (i,)\n div2 += (M//i,)\nfor d in div2:\n if d * N <= M:\n print(d)\n break\nelse:\n div1 = div1[::-1]\n for d in div1:\n if d * N <= M:\n print(d)\n break', 'import math\n\nN, M = map(int, input().split(" "))\ndiv1 = []\ndiv2 = []\n\nfor i in range(1, int(math.sqrt(M))+1):\n if M % i == 0:\n div1 += (i,)\n div2 += (M//i,)\nfor d in div2:\n if d * N <= M:\n print(d)\n break\nelse:\n div1 = div1[::-1]\n for d in div1:\n if d * N <= M:\n print(d)\n break'] | ['Runtime Error', 'Accepted'] | ['s563429806', 's922998098'] | [3064.0, 3064.0] | [17.0, 21.0] | [334, 347] |
p03241 | u439396449 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N, M = map(int, input().split())\n\n\ndef factorize(n):\n if n == 1:\n return [1]\n\n i, factors = 2, []\n while i * i <= n:\n while n % i == 0:\n n //= i\n factors.append(i)\n i += 1\n if n > 1:\n factors.append(n)\n return factors\n\n\nfactors = factorize(M)\nn_factors = len(factors)\n\nans = 0\nfor i in range(1 << n_factors):\n x = 1\n for j in range(n_factors):\n if i & (1 << j):\n x *= factors[j]\n y = M // x\n print(x, y, N <= y)\n if N <= y:\n ans = max(ans, x)\nprint(ans)\n', 'N, M = map(int, input().split())\n\n\ndef make_divisors(n):\n i, divisors = 1, []\n while i * i <= n:\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n // i)\n i += 1\n return divisors\n\n\nans = 0\nfor x in make_divisors(M):\n if N <= M // x:\n ans = max(ans, x)\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s047713966', 's472892657'] | [8332.0, 3060.0] | [2104.0, 22.0] | [559, 354] |
p03241 | u442581202 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nn,m = map(int, input().split())\nif (n==1):\n print(m)\n exit(0)\nfor i in range(1,int(math.sqrt(m))+1):\n if (m%i==0):\n if(n<=i):\n print(m//i)\n exit(0)\n elif(n<=m//i):\n print(i)\n exit(0)\n', '100000 1000000000', 'import math\nn,m = map(int, input().split())\nfactors = []\ncomp = m//n\nfor i in range(int(math.sqrt(m)),0,-1):\n if(m%i==0):\n factors.insert(0,i)\n factors.append(m//i)\nfor item in factors[::-1]:\n if (item <= comp):\n print(item)\n exit(0)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s352866230', 's735783413', 's069470475'] | [3060.0, 2940.0, 3064.0] | [17.0, 18.0, 22.0] | [262, 17, 267] |
p03241 | u445624660 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['\n\n\n\n\nn, m = map(int, input().split())\n\n\ndef enum_divisor(n):\n ret = []\n for i in range(1, int(n**0.5)):\n if n % i == 0:\n ret.append(i)\n return ret\n\n\nif m % n == 0:\n print(m // n)\n exit()\nelse:\n x = m // n\n \n lis = enum_divisor(x)\n print(lis[-1])\n', '\n\n\n\n\nn, m = map(int, input().split())\n\n\ndef enum_divisor(n):\n ret = []\n for i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n ret.append(i)\n return ret\n\n\nif m % n == 0:\n print(m // n)\n exit()\nelse:\n x = m // n\n \n lis = sorted(enum_divisor(x), reverse=true)\n for l in lis:\n if l <= x:\n print(l)\n exit()\n\n', '\n\n\n\n\nn, m = map(int, input().split())\n\n\ndef enum_divisor(n):\n ret = []\n for i in range(1, int(n**0.5)):\n if n % i == 0:\n ret.append(i)\n return ret\n\n\nif m % n == 0:\n print(m // n)\n exit()\nelse:\n x = m // n\n \n lis = sorted(enum_divisor(x), reverse=True)\n for l in lis:\n if l <= x:\n print(l)\n exit()\n\n', '\n\n\n\n\nn, m = map(int, input().split())\n\n\ndef make_divisors(n):\n lower_divisors = []\n upper_divisors = []\n for i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n // i)\n\n upper_divisors.reverse()\n return lower_divisors + upper_divisors\n\n\nif m % n == 0:\n print(m // n)\n exit()\nelse:\n x = m // n\n divisors = make_divisors(m)[::-1]\n for d in divisors:\n if d <= x:\n print(d)\n exit()'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s331566273', 's349782753', 's379963054', 's235413799'] | [2940.0, 3060.0, 3060.0, 3064.0] | [17.0, 20.0, 18.0, 20.0] | [797, 882, 878, 1012] |
p03241 | u451017206 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['from fractions import gcd\nfrom functools import reduce\n\nfrom math import sqrt, ceil\n\ndef is_prime(n):\n if n == 1: return False\n if n == 2: return True\n for i in range(2, ceil(sqrt(n))+1):\n if n % i == 0: return False\n return True\n\ndef prime_factorization(n):\n if is_prime(n):return [n]\n factor = []\n f = 2\n while n > 1:\n if n % f == 0:\n factor.append(f)\n n /= f\n else:\n f += 1\n return factor\n\nN, M = map(int, input().split())\n\np = prime_factorization(M)\n\nif M % N == 0:\n print(M//N)\n exit()\nans = 1\nfor i in sorted(p, reverse=True):\n if (M // i) >= N:\n ans = max(i, ans)\nprint(ans)', 'from math import sqrt, ceil\n\ndef is_prime(n):\n if n == 1: return False\n if n == 2: return True\n for i in range(2, ceil(sqrt(n))+1):\n if n % i == 0: return False\n return True\n\ndef prime_factorization(n):\n if is_prime(n):return [n]\n factor = []\n f = 2\n while n > 1:\n if n % f == 0:\n factor.append(f)\n n /= f\n else:\n f += 1\n return factor\n\nN, M = map(int, input().split())\n\nif (M % N) == 0:\n print(M//N)\n exit()\n\np = list(set(prime_factorization(M)))\n\nans = 1\nfor i in sorted(p, reverse=True):\n print(i, M//i)\n if (M // i) >= N:\n ans = max(i, ans)\nprint(ans)\n', 'from math import sqrt\n\ndef factorization(n):\n l = set()\n for i in range(1, int(sqrt(n))+1):\n if not n % i:\n l.add(i)\n l.add(n//i)\n return l\n\nN, M = map(int, input().split())\nf = factorization(M)\nans = 1\nfor i in f:\n if (M / i) >= N:\n ans = max(i, ans)\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s025835539', 's190581380', 's410762139'] | [5560.0, 3064.0, 3188.0] | [865.0, 897.0, 21.0] | [678, 656, 311] |
p03241 | u452284862 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N,M = map(int,input().split())\n\na = int(M/N)\n\nif M % 2 == 0:\nm = M / 2\na = int(a/2) + 1\n\nfor i in range(a,0,-1):\n if m % i == 0:\n c = i\n break\n\nif c == 1 and M % 2 == 0\n c = 2\n \nprint(c)\n\n', 'import math\n\nN,M = map(int,input().split())\n\na = int(M/N)\nq = int(math.sqrt(M))\n\nm = 0\nfor i in range(1,q+1):\n if M % i == 0:\n if i <= a:\n m = max(m,i)\n b = int(M / i)\n if b <= a:\n m = max(m,b)\n\nprint(m)\n\n'] | ['Runtime Error', 'Accepted'] | ['s839494609', 's619884257'] | [2940.0, 3060.0] | [18.0, 23.0] | [212, 251] |
p03241 | u456353530 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nN, M = list(map(int, input().split()))\nif N == 1:\n print(M)\n exit()\nX = int(math.sqrt(M))+1\nfor i in range(N, X):\n if M % i == 0:\n print(int(M/i))\n exit()\nprint(1)', 'import math\nN, M = list(map(int, input().split()))\nif N == 1:\n print(M)\n exit()\nX = int(math.sqrt(M))+1\nfor i in range(N, X):\n if M % i == 0:\n print(int(M/i))\n exit()\nX = int(M / N)\nfor i in range(X, 0, -1):\n if M % i == 0:\n print(i)\n exit()\nprint(1)'] | ['Wrong Answer', 'Accepted'] | ['s389253822', 's301547601'] | [3060.0, 3060.0] | [20.0, 40.0] | [188, 274] |
p03241 | u471684875 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import fractions\nn,m=map(int,input().split())\nif m%n==0:\n print(int(m/n))\nelse:\n print(fractions.gcd(m//n,m//n+m%n))\n\n', 'import fractions\nn,m=map(int,input().split())\nif m%n==0:\n print(int(m/n))\nelse:\n ans=1\n for i in range(m//n,1,-1):\n c=fractions.gcd(i,m-i*n)\n if c>ans:\n ans=c\n break\n print(ans)\n\n\n', 'import fractions\nn,m=map(int,input().split())\nif m%n==0:\n print(int(m/n))\nelse:\n ans=1\n for i in range(2,m//n+1):\n c=fractions.gcd(i,m-i*n)\n if c>ans:\n ans=c\n print(ans)\n\n\n', 'import fractions\nn,m=map(int,input().split())\nif m%n==0:\n print(int(m/n))\nelse:\n ans=1\n for i in range(m//n,1,-1):\n c=fractions.gcd(i,i+m-i*n)\n if c>ans:\n ans=c\n break\n else:\n continue\n print(ans)\n\n\n', 'n, m = map(int, input().split())\nl = []\nfor i in range(1, int(m**(1/2)) + 1):\n\tif m % i == 0:\n\t\tl.append(i)\n\t\tl.append(m // i)\nl.sort()\nl=l[::-1]\nfor i in l:\n if m//n>=i:\n print(i)\n break\n\n'] | ['Wrong Answer', 'Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s045119201', 's087642974', 's637868778', 's695331950', 's727959232'] | [5048.0, 5048.0, 5176.0, 5176.0, 3060.0] | [36.0, 67.0, 2104.0, 62.0, 23.0] | [124, 228, 209, 265, 206] |
p03241 | u472065247 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N, M = map(int, input().split())\n\nfor i in range(M, 0, -1):\n if M % i == 0:\n print(i)\n exit()', 'def main():\n N, M = map(int, input().split())\n\n for i in range(M // N, 0, -1):\n if M % i == 0:\n print(i)\n break\n \nmain()'] | ['Wrong Answer', 'Accepted'] | ['s748931284', 's655999141'] | [2940.0, 2940.0] | [19.0, 1777.0] | [100, 140] |
p03241 | u475675023 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['from fractions import gcd\nn,m=map(int,input().split())\nans=1\nfor i in range(m//n+1):\n if gcd(m-i*(n-1),i)==i:\n ans=i\nprint(ans)', 'n,m=map(int,input().split())\ndef divisors(n):\n div=[]\n for i in range(1,int(n**0.5)+1):\n if n%i==0:\n div.append(i)\n if not i==n//i:\n div.append(n//i)\n div=sorted(div)[::-1]\n return div\nans=1\nfor i in divisors(m):\n if m-i*(n-1)>0:\n ans=i\n break\nprint(ans)'] | ['Time Limit Exceeded', 'Accepted'] | ['s971481620', 's565756763'] | [5048.0, 3060.0] | [2104.0, 20.0] | [131, 285] |
p03241 | u476604182 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['from fractions import gcd\nN, M = map(int, input().split())\nif M%N==0:\n print(M//N)\nelse:\n c = M%N\n b = M//N\n ans = 0\n x = M\n for i in range(1,b+1):\n x -= N\n if gcd(i,x)>ans:\n ans = gcd(i,x)\n print(ans+1)\n', 'from fractions import gcd\nN, M = map(int, input().split())\nif M%N==0:\n print(M//N)\nelse:\n c = M%N\n b = M//N\n ls = []\n ans = 0\n for i in range(1,b+1):\n x = M - i*N\n if gcd(i,x)>ans:\n ans = gcd(i,x)\n print(ans)', 'from fractions import gcd\nN, M = map(int, input().split())\nif M%N==0:\n print(M//N)\nelse:\n c = M%N\n b = M//N\n g = 0\n for i in range(1,c+1):\n if c%i==0:\n if g<gcd(c//i,b):\n g = gcd(c//i,b)\n print(g)', "from fractions import gcd\nN, M = map(int, input().split())\nif M%N==0:\n print(M//N)\nelse:\n c = M%N\n b = M//N\n ans = 0\n x = M\n for i in range(1,b+1):\n x -= N\n if gcd(i,x)>ans:\n ans = gcd(i,x)\n print(ans)\n print(' ')", 'N, M = map(int, input().split())\ng = []\nfor i in range(1,M+1):\n if M%i==0:\n j = M//i\n if i<=M//N:\n g += [i]\n if j<=M//N:\n g += [j]\n if i>M**0.5:\n break\nprint(max(g))'] | ['Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Time Limit Exceeded', 'Accepted'] | ['s150077250', 's156307043', 's156348348', 's183510996', 's768391942'] | [5048.0, 5176.0, 5048.0, 5048.0, 3060.0] | [2104.0, 2104.0, 47.0, 2104.0, 33.0] | [222, 226, 217, 232, 189] |
p03241 | u480200603 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n, m = map(int, input().split())\n\n\ndef divisor(num):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n divisors.sort()\n return divisors\n\n\nans = 0\nfor i in divisor(m):\n if n <= m // i:\n ans = i\n else:\n break\nprint(ans)', 'n, m = map(int, input().split())\n\n\ndef divisor(n):\n divisors = []\n for i in range(1, int(n ** 0.5) + 1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n // i)\n divisors.sort()\n return divisors\n\n\nans = 0\nfor i in divisor(m):\n if n <= m // i:\n ans = i\n else:\n break\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s156823381', 's242444050'] | [3060.0, 3060.0] | [17.0, 21.0] | [370, 374] |
p03241 | u484229314 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['from math import sqrt\n\nN, M = [int(_) for _ in input().split()]\nm = M\n\na = 1\nflg = False\nfor i in range(2, int(sqrt(M)) + 1):\n if i <= M / N:\n a = max(a, i)\n b = M // i\n if b <= M / N:\n a = max(a, b)\n\nprint(a)\n', 'from math import sqrt\n\nN, M = [int(_) for _ in input().split()]\nm = M\n\na = 0\nflg = False\nfor i in range(1, int(sqrt(M)) + 1):\n if M % i==0:\n if i <= M / N:\n a = max(a, i)\n b = M // i\n if b <= M / N:\n a = max(a, b)\n\nprint(a)\n'] | ['Wrong Answer', 'Accepted'] | ['s691832391', 's859264235'] | [3060.0, 3060.0] | [47.0, 22.0] | [233, 270] |
p03241 | u490553751 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['def divisore(n):\n divisors=[]\n for i in range(1,int(n**0.5)+1):\n if n%i==0:\n divisors.append(i)\n if i!=n//i:\n divisors.append(n//i)\n divisors.sort(reverse=True)\n return divisors\n\nn,m=map(int,input().split())\nl=divisore(m)\nfor i in l:\n if m/n>=i:\n print(i)\n exit()', 'def divisore(n):\n divisors=[]\n for i in range(1,int(n**0.5)+1):\n if n%i==0:\n divisors.append(i)\n if i!=n//i:\n divisors.append(n//i)\n divisors.sort(reverse=True)\n return divisors\n\nn,m=map(int,input().split())\nl=divisore(m)\nprint(l)\nfor i in l:\n if m/n>=i:\n print(i)\n exit()', 'def divisore(n):\n divisors=[]\n for i in range(1,int(n**0.5)+1):\n if n%i==0:\n divisors.append(i)\n if i!=n//i:\n divisors.append(n//i)\n divisors.sort(reverse=True)\n return divisors\n\nn,m=map(int,input().split())\nl=divisore(m)\nfor i in l:\n if m//n>=i:\n print(i)\n exit()'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s303987789', 's932540035', 's354062881'] | [2940.0, 3060.0, 3060.0] | [17.0, 20.0, 20.0] | [322, 330, 322] |
p03241 | u496687522 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nN, M = map(int, input().split())\n\ndef factorization(n):\n factor_list = []\n if n <= 1:\n return factor_list\n limit = int(math.sqrt(n))+1\n for i in range(2, limit):\n if n % i == 0:\n factor_list.append(i)\n if not n == i**2:\n factor_list.append(n//i)\n\n return factor_list\n\nfactor = factorization(M)\nfactor.sort()\nprint(factor)\nans = 1\nfor f in factor:\n if N * f <= M and f > ans:\n ans = f\nprint(ans)', 'import math\nN, M = map(int, input().split())\n\ndef factorization(n):\n factor_list = []\n if n < 1:\n return factor_list\n limit = int(math.sqrt(n))+1\n for i in range(1, limit):\n if n % i == 0:\n factor_list.append(i)\n if not n == i**2:\n factor_list.append(n//i)\n factor_list.sort()\n return factor_list\n\nfactor = factorization(M)\n\n\nans = 1\nfor f in factor:\n if N * f <= M and f > ans:\n ans = f\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s691103621', 's419187527'] | [3188.0, 3064.0] | [20.0, 21.0] | [482, 477] |
p03241 | u513434790 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N, M = map(int, input().split())\n\nans = 1\nfor i in range(1,min(int(M ** 0.5) + 1, M // N + 1)):\n if M % i == 0:\n ans = max(ans, M // i)\n\nprint(ans)', 'N, M = map(int, input().split())\n\nans = 1\nfor i in range(1,min(int(M ** 0.5) + 1, M // N + 1)):\n if M % i == 0:\n ans = max(ans, M // i)\n\nprint(int(ans))', 'N, M = map(int, input().split())\n\nans = 1\nfor i in range(1,int(M ** 0.5) + 1):\n if M % i == 0:\n if i >= N:\n ans = max(ans, M // i)\n if M // i >= N:\n ans = max(ans, i)\n\nprint(int(ans))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s057178361', 's234701088', 's922130651'] | [3060.0, 3060.0, 3064.0] | [20.0, 21.0, 21.0] | [157, 162, 222] |
p03241 | u518042385 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m=map(int,input().split())\ndef yak1(n,m):\n l=[]\n for i in range(1,min(int((m)**1/2+1)),m//n+1):\n if m%i==0:\n l.append(i)\n if m//(m//i)!=m/i and m//(m//i)<=m//n:\n l.append(m//i)\n return l\nprint(min(yak1(n,m))) ', 'n,m=map(int,input().split())\ndef divisor_gen(n,m):\n l=[]\n o=[]\n for i in range(2, int(n**(1/2))+1):\n if n%i == 0:\n l.append(i)\n l.append(m)\n for i in l:\n if n>=m/i:\n o.append(i)\n print(max(o))\ndivisor_gen(n,m)', 'def make_divisors(n,m):\n divisors = []\n for i in range(1, (n//m)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n return divisors\nn,m=map(int,input().split())\nprint(max(make_divisors(n,m)))', 'n,m=map(int,input().split())\nl=[]\no=[]\nfor i in range(1,m+1):\n if m%i==0:\n l.append(i)\nfor i in l:\n if n>=m/l[i]:\n o.append(l[i])\nprint(max(o))\n', 'n,m=map(int,input().split())\nl=[]\nfor i in range(1,m//n+1):\n if m%i==0:\n l.append(i)\nprint(max(i))', 'n,m=map(int,input().split())\ndef divisor_gen(n,m):\n l=[]\n o=[]\n for i in range(2, int(n*(1/2)+1):\n if n%i == 0:\n l.append(i)\n l.append(m)\n for i in l:\n if n>=m/i:\n o.append(i)\n print(max(o))\ndivisor_gen(n,m)\n', 'n,m=map(int,input().split())\ndef divisor_gen(n,m):\n l=[]\n o=[]\n for i in range(2, int(m*(1/2)+1)):\n if m%i == 0:\n l.append(i)\n l.append(m)\n for i in l:\n if n>=m/i:\n o.append(i)\n print(max(o))\ndivisor_gen(n,m)\n', 'n,m=map(int,input().split())\ndef divisor_gen(n,m):\n l=[]\n o=[]\n for i in range(2, int(n*(1/2)+1)):\n if n%i == 0:\n l.append(i)\n l.append(m)\n for i in l:\n if n>=m/i:\n o.append(i)\n print(max(o))\ndivisor_gen(n,m)\n', 'n,m=map(int,input().split())\nl=[]\no=[]\nfor i in range(1,m+1):\n if m%i==0:\n l.append(i)\nfor i in range(0,len(l)):\n if n>=m/l[i]:\n o.append(l[i])\nprint(max(o))\n', 'n,m=map(int,input().split())\nl=[]\no=[]\nfor i in range(1,m+1):\n if m%i==0:\n l.append(i)\nfor i in l:\n if n>=m/i:\n o.append(i)\nprint(max(o))\n', 'n,m=map(int,input().split())\nl=[]\no=[]\ndef divisor_gen(n):\n for i in range(2, int(m**(1/2))+1):\n if m%i == 0:\n l.append(i)\nl.append(m)\nfor i in l:\n if n>=m/i:\n o.append(i)\nprint(max(o))\n', 'n,m=map(int,input().split())\ndef yak1(n,m):\n l=[]\n for i in range(1,min(int((m)**(1/2))+1,(m//n)+1)):\n if m%i==0:\n l.append(i)\n if m//i!=i and m//i<=m//n:\n l.append(m//i)\n return l\nprint(max(yak1(n,m))) \n'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s310640630', 's351091741', 's357536709', 's494275640', 's660650646', 's687652024', 's719150926', 's759098861', 's832113793', 's898796654', 's951669468', 's272522964'] | [3060.0, 3060.0, 3060.0, 2940.0, 2940.0, 2940.0, 2940.0, 3060.0, 2940.0, 2940.0, 3060.0, 3060.0] | [18.0, 17.0, 17.0, 2104.0, 2103.0, 17.0, 2104.0, 21.0, 2104.0, 2104.0, 17.0, 20.0] | [239, 231, 274, 152, 102, 230, 231, 231, 166, 146, 199, 231] |
p03241 | u533039576 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['#include <cstdio>\n\nusing namespace std;\n\nvector<int> divisor(int m) {\n vector<int> divs;\n for (int i = 1; i*i <= m; i++) {\n if (m % i == 0) {\n divs.push_back(i);\n if (m != i*i) {\n divs.push_back(m / i);\n }\n }\n }\n sort(divs.begin(), divs.end());\n\n return divs;\n}\n\nint main() {\n int n, m;\n\n scanf("%d%d", &n, &m);\n vector<int> divs = divisor(m);\n\n for (int i = divs.size()-1; i >= 0; i--) {\n if (divs[i] * n <= m) {\n printf("%d\\n", divs[i]);\n break;\n }\n }\n return 0;\n}\n', 'import math\nn, m = map(int, input().split())\n\ndef divisor(m):\n ans = []\n for i in range(1, int(math.sqrt(m)) + 1):\n if m % i == 0:\n ans.append(i)\n ans.append(m // i)\n\n return sorted(ans)\n\n\ndivs = divisor(m)\nj = len(divs) - 1\nwhile True:\n if divs[j] * n <= m:\n print(divs[j])\n break\n j -= 1\n'] | ['Runtime Error', 'Accepted'] | ['s275965329', 's276676236'] | [3064.0, 3060.0] | [18.0, 20.0] | [615, 348] |
p03241 | u539517139 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m=map(int,input().split())\np=1\nfor i in range(1,int(m**0.5)+1):\n if m%i==0:\n if m//i>=n:\n p=max(i,m//i,p)\nprint(p)', 'n,m=map(int,input().split())\np=1\nfor i in range(1,int(m**0.5)+1):\n if m%i==0:\n if m//i>=n:\n if i>=n:\n p=max(i,m//i,p)\n else:\n p=max(p,i)\nprint(p)'] | ['Wrong Answer', 'Accepted'] | ['s705462263', 's569472562'] | [2940.0, 3060.0] | [21.0, 21.0] | [125, 173] |
p03241 | u540761833 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N,M = map(int,input().split())\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n return divisors\ndiv = sorted(make_divisors(M))\nimport bisect\nind = bisect.bisect_left(div,N)\nprint(div[ind])\n', 'import bisect\nN,M = map(int,input().split())\nmaxa = M//N\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n return divisors\nmdiv = sorted(make_divisors(M))\nans = mdiv[bisect.bisect_right(mdiv,maxa)-1]\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s010433714', 's722831985'] | [3060.0, 3188.0] | [20.0, 20.0] | [342, 362] |
p03241 | u546959066 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n, m = list(map(int, input().split(" ")))\n\nds = [x for x in range(1, m**.5+1) if m%x==0]\nds = ds + [m%x for x in ds]\nds = [x for x in ds if x<=m//n]\nprint(max(ds))', 'n, m = list(map(int, input().split(" ")))\n\nds = [x for x in range(1, int(m**.5)+1) if m%x==0]\nds = ds + [m//x for x in ds]\nds = [x for x in ds if x<=m//n]\nprint(max(ds))'] | ['Runtime Error', 'Accepted'] | ['s770813267', 's982927645'] | [3060.0, 3060.0] | [17.0, 21.0] | [163, 169] |
p03241 | u547608423 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N,M=map(int,input().split())\n\nbase=M//N\nanswer=[0]*N\nj=0\n\nfor i in range(base,base//2+1,-1):\n if M%i==0:\n answer[j]=i\n break\n elif M%(base-i+1)==0:\n answer[j]=base-i+1\n j+=1\nprint(max(answer))', 'N,M=map(int,input().split())\n\nbase=M//N\nli=[]\n\n\nfor i in range(1,int(pow(M,1/2))+1):\n if i<=base and M%i==0:\n li.append(i)\n if M%i==0 and M//i<=base:\n li.append(M//i)\n\nprint(max(li))'] | ['Runtime Error', 'Accepted'] | ['s396814705', 's529875245'] | [3956.0, 3060.0] | [45.0, 26.0] | [226, 202] |
p03241 | u549383771 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m = map(int,input().split())\nans = 0\ntmp = int(m/n)\nfor i in range(1,int(np.sqrt(m))):\n if m%i == 0:\n if (ans < i) and(i <= tmp):\n ans = i\nprint(ans)', 'import numpy as np\n\nn,m = map(int,input().split())\nans = 0\ntmp = int(m/n)\nfor i in range(1,int(np.sqrt(m)+1)):\n if m%i == 0:\n if (ans < i) and(i <= tmp):\n ans = i\n tmp2 = m//i\n if (ans < tmp2) and(tmp2 <= tmp):\n ans = tmp2\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s013978231', 's988264637'] | [2940.0, 12484.0] | [17.0, 154.0] | [172, 279] |
p03241 | u551909378 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N,M=[int(i) for i in input().split()]\nprint(N,M)\nm=3;list=[1];n=M\nwhile m<=n:\n if n%m==0:\n list.append(m)\n m=m+1\n \nprint(list)\nk = len(list)\nfor i in range(k):\n if N<list[i]:\n break\n\nans = int(M/list[i])\nprint(ans)', 'N,M = map(int,input().split())\n\nif M % N == 0: print(M//N)\nelif M//N > 100000:\n for i in range(N,M//2+1):\n if M % i == 0:\n print(M//i)\n break\n else:\n print(1)\nelse:\n m = M//N\n for i in range(2,m)[::-1]:\n if M % i == 0:\n print(i)\n break\n else:\n print(1)'] | ['Wrong Answer', 'Accepted'] | ['s034623760', 's496176981'] | [3064.0, 3064.0] | [2104.0, 441.0] | [240, 342] |
p03241 | u556225812 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nN, M = map(int, input().split())\nx = M//N\nmid = int(math.sqrt(M))\nif x > mid:\n ans = []\n for i in range(1, mid+1):\n ans.append(i)\n if M%i == 0:\n ans.append(i)\n if M//i <= x:\n ans.append(M//i)\n print(max(ans))\nelse:\n ans = []\n for i in range(x, 0, -1):\n if M%i == 0:\n print(i)\n break', 'import math\nN, M = map(int, input().split())\nx = M//N\nmid = int(math.sqrt(M))\nif x >= mid:\n ans = []\n for i in range(1, mid+1):\n ans.append(i)\n if M%i == 0:\n ans.append(i)\n if M//i <= x:\n ans.append(M//i)\n print(max(ans))\nelse:\n for i in range(x, 0, -1):\n if M%i == 0:\n print(i)\n break', 'import math\nN, M = map(int, input().split())\nx = M//N\nmid = int(math.sqrt(M))\nif x >= mid:\n ans = []\n for i in range(1, mid+1):\n ans.append(i)\n if M%i == 0:\n ans.append(i)\n if M//i <= x:\n ans.append(M//i)\n print(max(ans))\nelse:\n for i in rreversed(range(1, x+1)):\n if M%i == 0:\n print(i)\n break', 'import math\nN, M = map(int, input().split())\nx = M//N\nmid = int(math.sqrt(M))\nif x >= mid:\n ans = []\n for i in range(1, mid+1):\n if M%i == 0:\n ans.append(i)\n if M//i <= x:\n ans.append(M//i)\n print(max(ans))\nelse:\n for i in range(x, 0, -1):\n if M%i == 0:\n print(i)\n break'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s060111410', 's089384871', 's916673176', 's981802620'] | [4352.0, 4352.0, 4352.0, 3060.0] | [26.0, 25.0, 25.0, 21.0] | [389, 377, 386, 355] |
p03241 | u560867850 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['from fractions import gcd\n\ndef primes(n):\n is_prime = [True] * (n + 1)\n is_prime[0] = False\n is_prime[1] = False\n for i in range(2, int(n**0.5) + 1):\n if not is_prime[i]:\n continue\n for j in range(i * 2, n + 1, i):\n is_prime[j] = False\n return [i for i in range(n + 1) if is_prime[i]]\n\nn, m = map(int, input().split())\n\nprime = reversed(primes(m))\n\nfor p in prime:\n x = m - p\n if gcd(x, n-1) % p == 0:\n print(p)\n exit()', 'N, M = list(map(int,input().split()))\n\ndef divisor(n):\n res = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n res.append(i)\n if n % n//i == 0:\n res.append(n//i)\n\n res.sort()\n return res\n\nd = divisor(M)\nans = 1\nfor x in d:\n m = M\n m -= x * (N - 1)\n if m > 0 and m % x == 0:\n ans = x\n\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s728824377', 's981285539'] | [1329628.0, 3064.0] | [2122.0, 20.0] | [490, 373] |
p03241 | u562935282 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['def p_fact(n):\n res = []\n i = 2\n while i ** 2 <= n:\n cnt = 0\n while n % i == 0:\n n /= i\n cnt += 1\n if cnt > 0:\n res.append((i, cnt))\n i += 1\n if n > 0:\n res.append((n, 1))\n return res\n\n\nN, M = map(int, input().split())\n\nif M % N == 0:\n print(M // N)\nelse:\n p = p_fact(M)\n p = sorted(p, reverse=True, key=lambda x: x[0])\n\n N_max = int(M / N)\n\n x = 1\n ans = 0\n for prim, cnt in p:\n print(prim, cnt)\n x *= prim ** cnt\n while x > N_max:\n x //= prim\n ans = max(ans, x)\n \n print(ans)', "def main():\n N, M = map(int, input().split())\n\n st = {1, M}\n d = 2\n while d * d <= M:\n if M % d == 0:\n st.add(d)\n st.add(M // d)\n d += 1\n\n ans = 1\n for d in st:\n if d >= N:\n e = M // d\n ans = max(ans, e)\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n"] | ['Wrong Answer', 'Accepted'] | ['s539007904', 's169546224'] | [3064.0, 3064.0] | [29.0, 24.0] | [630, 342] |
p03241 | u571867512 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['#python D-Partition.py\n\nimport math\nline = list(map(int, input().split(" ")))\nN = int(line[0])\nM = int(line[1])\n\n\n\n\n\nfor i in range(sqrt(M)):\n\ttmp = M-(math.floor(M/N)-i)*(N-1)\n\tif tmp%(math.floor(M/N)-i)==0:\n\t\tprint((math.floor(M/N)-i))\n\t\tbreak\n', 'from math import sqrt\n\nN,M = map(int,input().split())\n\ndivisor = set([])\nfor i in range(1,int(sqrt(M))+1):\n\tif M % i == 0:\n\t\tif i <= int(M / N):\n\t\t\tdivisor.add(i)\n\t\tif (M // i) <= int(M / N):\n\t\t\tdivisor.add(M // i)\n\nprint(max(divisor))\n'] | ['Runtime Error', 'Accepted'] | ['s442855541', 's480531992'] | [3064.0, 3068.0] | [17.0, 22.0] | [606, 236] |
p03241 | u572142121 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N,M=map(int,input().split())\na=M//N\nb=min(a,N)\nwhile (M&b)!=0:\n b-=1\nprint(b)', 'N,M=map(int,input().split())\nD=[]\nfor i in range(1,int(M**0.5+1)):\n if M%i==0:\n D.append(i)\n D.append(M//i)\nD.sort()\nprint(D)\nfor j in D:\n if j >=N:\n print(M//j)\n exit()', 'N,M=map(int, input().split())\ndef make_divisors(n):\n lower_divisors , upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n return lower_divisors + upper_divisors[::-1]\nA=make_divisors(M)\nfor i in range(len(A)):\n if A[i]>=N:\n print(A[-1-i])\n exit()'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s156962499', 's365121906', 's788145515'] | [2940.0, 3188.0, 9224.0] | [20.0, 21.0, 32.0] | [78, 183, 409] |
p03241 | u580362735 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['def calc()\nN,M = map(int,input().split())\nfor gcd in range(M // N,0,-1):\n if M % gcd == 0:\n return(gcd)\n\nprint(calc())', 'def calc():\n N,M = map(int,input().split())\n for gcd in range(M // N,0,-1):\n if M % gcd == 0:\n break\n return(gcd)\nprint(calc())'] | ['Runtime Error', 'Accepted'] | ['s043114700', 's139356595'] | [2940.0, 2940.0] | [17.0, 1764.0] | [119, 130] |
p03241 | u582333355 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N, M = list(map(int,input().split()))\n \nd = int(M/N)\n \nif M%N == 0:\n\tprint(d)\nelse: \n\tfor i in range(d):\n\t\tif M%(d-i) == 0:\n\t\t\tprint(d-i)\n\t\n\t# while True:\n\t# \tif M%(N+i+1) == 0:\n\t# \t\tprint(int(M/(N+i+1)))\n\t# \t\tbreak\n\t# \ti += 1', 'N, M = list(map(int,input().split()))\n \nd = int(M/N)\n\ndef solve():\n # ans = 1\n \n \n # if (M // i) >= N:\n # print(i)\n # break\n for i in range(d+1,0,-1):\n \tif M%d == 0:\n \t\tprint(d)\n \t\tbreak\n\n\t\n\t# while True:\n\t# \tif M%(N+i+1) == 0:\n\t# \t\tprint(int(M/(N+i+1)))\n\t# \t\tbreak\n\t# \ti += 1\n\nif M%N == 0:\n\tprint(d)\nelse:\n\tsolve()', 'N, M = list(map(int,input().split()))\n \nd = int(M/N)\n\ndef solve():\n # ans = 1\n \n \n # if (M // i) >= N:\n # print(i)\n # break\n for i in range(d+1,0,-1):\n \tif M%i == 0:\n \t\tprint(d)\n \t\tbreak\n\n\t\n\t# while True:\n\t# \tif M%(N+i+1) == 0:\n\t# \t\tprint(int(M/(N+i+1)))\n\t# \t\tbreak\n\t# \ti += 1\n\nif M%N == 0:\n\tprint(d)\nelse:\n\tsolve()', 'N, M = list(map(int,input().split()))\n \nd = int(M/N)\n \nif M%N == 0:\n\tprint(d)\nelse: \n ans = 1\n for i in range(m//n+1, 0, -1):\n if m % i == 0:\n if (m // i) >= n:\n print(i)\n break\n\t\n\t# while True:\n\t# \tif M%(N+i+1) == 0:\n\t# \t\tprint(int(M/(N+i+1)))\n\t# \t\tbreak\n\t# \ti += 1', 'N, M = list(map(int,input().split()))\n \nd = int(M/N)\n\ndef solve():\n # ans = 1\n \n \n # if (M // i) >= N:\n # print(i)\n # break\n for i in range(d+1,0,-1):\n \tif M%i == 0:\n \t\tprint(i)\n \t\tbreak\n\n\t\n\t# while True:\n\t# \tif M%(N+i+1) == 0:\n\t# \t\tprint(int(M/(N+i+1)))\n\t# \t\tbreak\n\t# \ti += 1\n\nif M%N == 0:\n\tprint(d)\nelse:\n\tsolve()'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s341317187', 's569935693', 's814784947', 's981049430', 's830998608'] | [3060.0, 2940.0, 2940.0, 3060.0, 2940.0] | [2104.0, 2103.0, 1888.0, 20.0, 1868.0] | [233, 436, 436, 327, 436] |
p03241 | u597455618 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ["def divisor(n):\n i = 1\n res = []\n for i in range(1, n**.5 + 1)\n if n%i == 0:\n res.append(i)\n if n//i not in res:\n res.append(n//i)\n res.sort(reverse=True)\n return res\n\ndef main():\n n, m = map(int, input().split())\n md = divisor(m)\n for i in md:\n if i*n <= m:\n print(i)\n exit()\n\nif __name__ == '__main__':\n main()", "def divisor(n):\n i = 1\n res = set()\n for i in range(1, int(n**.5) + 1):\n if n%i == 0:\n res.add(i)\n res.add(n//i)\n return res\n\ndef main():\n n, m = map(int, input().split())\n md = list(divisor(m))\n md.sort(reverse=True)\n for i in md:\n if i*n <= m:\n print(i)\n exit()\n\nif __name__ == '__main__':\n main()"] | ['Runtime Error', 'Accepted'] | ['s808216869', 's592776288'] | [9012.0, 9272.0] | [29.0, 35.0] | [412, 384] |
p03241 | u606045429 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['def divisors(N):\n U = int(N ** 0.5)\n res = []\n all(res.extend((i, N // i)) for i in range(1, U) if N % i == 0)\n if N % U == 0:\n res.append(U)\n res.sort()\n return res\n\nN, M = map(int, input().split())\nprint(max(d for d in divisors(M) if d * N <= M))\n', 'def divisors(N):\n U = int(N ** 0.5)\n L = {i for i in range(1, U + 1) if N % i == 0}\n R = {N // r for r in L}\n return L | R\n\nN, M = map(int, input().split())\nprint(max(d for d in divisors(M) if d * N <= M))\n'] | ['Wrong Answer', 'Accepted'] | ['s829764216', 's147269822'] | [3060.0, 3060.0] | [17.0, 20.0] | [274, 218] |
p03241 | u608088992 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['def dist(a, b, x, y, h):\n return h + abs(a - x) + abs(b - y)\n \nN = int(input())\nP = [[0 for i in range(101)] for j in range(101)]\nx, y, h = map(int, input().split())\nP[x][y] = h\nfor i in range(101):\n for j in range(101):\n P[i][j] = dist(i, j, x, y, h)\n \nfor i in range(N-1):\n a, b, c = map(int, input().split())\n if P[a][b] != c:\n P[a][b] = False\n for j in range(101):\n for k in range(101):\n if P[j][k] != False and P[j][k] != dist(j, k, a, b, c):\n P[j][k] = False\ntemp = (0, 0, 0)\nfor i in range(101):\n for j in range(101):\n if P[i][j] > temp[2]:\n temp = (i, j, P[i][j])\nprint(temp[0], temp[1], temp[2])', 'def dist(a, b, x, y, h):\n return h + abs(a - x) + abs(b - y)\n \nN = int(input())\nP = [[0 for i in range(101)] for j in range(101)]\nx, y, h = map(int, input().split())\nP[x][y] = h\nfor i in range(101):\n for j in range(101):\n P[i][j] = dist(i, j, x, y, h)\n \nfor i in range(N-1):\n a, b, c = map(int, input().split())\n if P[a][b] != c:\n P[a][b] = False\n for j in range(101):\n for k in range(101):\n if P[j][k] != False and P[j][k] != dist(j, k, a, b, c):\n P[j][k] = False\ntemp = (0, 0, 0)\nfor i in range(101):\n for j in range(101):\n if P[i][j] > ans:\n temp = (i, j, P[i][j])\nprint(temp[0], temp[1], temp[2])', 'import sys\n\ndef solve():\n input = sys.stdin.readline\n N, M = map(int, input().split())\n maxGCD = 1\n for gcd in range(1, M):\n if gcd * gcd > M: break\n else:\n if M % gcd == 0:\n other = M // gcd\n if gcd >= N: maxGCD = max(other, maxGCD)\n if other >= N: maxGCD = max(gcd, maxGCD)\n print(maxGCD)\n\n return 0\n\nif __name__ == "__main__":\n solve()'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s134035711', 's395147367', 's714185388'] | [3064.0, 3064.0, 3064.0] | [17.0, 19.0, 22.0] | [687, 683, 429] |
p03241 | u609061751 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import sys\nimport numpy as np\nimport fractions\ninput = sys.stdin.readline\nM, N = [int(x) for x in input().split()]\na = N // M\nb = N % M\nprint(fractions.gcd(a,b))\n', 'import sys\nimport numpy as np\nimport fractions\ninput = sys.stdin.readline\nN, M = [int(x) for x in input().split()]\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n divisors.sort()\n return divisors\nans = make_divisors(M)\nans = sorted(ans)[::-1]\nfor i in ans:\n if i <= M/N:\n print(i)\n sys.exit()'] | ['Wrong Answer', 'Accepted'] | ['s732377576', 's278079635'] | [13648.0, 15564.0] | [156.0, 156.0] | [162, 468] |
p03241 | u611509859 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n, m = map(int, input().split())\nans = 1\nfor i in range(n, m//2):\n if m % i == 0:\n ans = m//i\n break\nprint(ans)', 'import math\nn, m = map(int, input().split())\nans = 1\nk = m\nsoy = []\nfor i in range(2, int(math.sqrt(m))+1):\n if k % i == 0:\n are = 0\n while True:\n if k % i == 0:\n k = k // i\n are += 1\n else:\n break\n soy.append([i, are])\nif k != 1:\n soy.append([k, 1])\nfor i in range(10-len(soy)):\n soy.append([1, 0])\nfor a in range(soy[0][1] + 1):\n for b in range(soy[1][1] + 1):\n for c in range(soy[2][1] + 1):\n for d in range(soy[3][1] + 1):\n for e in range(soy[4][1] + 1):\n for f in range(soy[5][1] + 1):\n for g in range(soy[6][1] + 1):\n for h in range(soy[7][1] + 1):\n for i in range(soy[8][1] + 1):\n for j in range(soy[9][1] + 1):\n t = soy[0][0]**a * soy[1][0]**b * soy[2][0]**c * soy[3][0]**d * soy[4][0]**e * soy[5][0]**f * soy[6][0]**g * soy[7][0]**h * soy[8][0]**i * soy[9][0]**j\n if n <= t:\n \tans = max(ans, m//t)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s278685286', 's184573162'] | [2940.0, 3188.0] | [2103.0, 23.0] | [128, 1202] |
p03241 | u619379081 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['from math import sqrt\nn, m = list(map(int, input().split()))\ni = 1\nlst = []\nwhile i <= sqrt(m):\n if m % i == 0:\n j = m // i\n if i >= n:\n lst.append(i)\n if j >= n:\n lst.append(j)\n i += 1\nprint(m//min(lst))', 'from math import sqrt\nfrom math import ceil\nn, m = list(map(int, input().split()))\nlst = range(n, ceil(sqrt(m)))\nfor i in lst:\n if m % i == 0:\n print(m // i)\n break\nelse:\n print(1)', 'n, m = list(map(int, input().split()))\nlst = range(n, -(-m//2))\nfor i in lst:\n if m % i == 0:\n print(m // i)\n break\nelse:\n print(1)', 'from math import sqrt\nn, m = list(map(int, input().split()))\ni = 1\nlst = []\nwhile i <= sqrt(m):\n if m % i == 0:\n j = m // i\n if i >= n:\n lst.append(i)\n if j >= n:\n lst.append(j)\n i += 1\nprint(m//min(lst))'] | ['Time Limit Exceeded', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s448018102', 's524373884', 's703131120', 's065806738'] | [3060.0, 3060.0, 2940.0, 3060.0] | [2104.0, 20.0, 2103.0, 31.0] | [257, 200, 151, 253] |
p03241 | u619458041 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ["import sys\n\ndef main():\n input = sys.stdin.readline\n N, M = map(int, input().split())\n O = [0, 1] + [0 for _ in range(int(M**0.5)+1)]\n H = 1\n for i in range(int(M**0.5)+1, 2, -1):\n while M % i == 0:\n if (M // i) < N:\n break\n else:\n M //= i\n H *= i\n print(H)\n\nif __name__ == '__main__':\n main()", "import sys\n\ndef main():\n input = sys.stdin.readline\n N, M = map(int, input().split())\n H = 1\n for i in range(int(M//N), 1, -1):\n if M % i == 0:\n H = i\n break\n\n print(H)\n\nif __name__ == '__main__':\n main()"] | ['Wrong Answer', 'Accepted'] | ['s206843954', 's880544436'] | [3608.0, 2940.0] | [22.0, 1770.0] | [334, 223] |
p03241 | u619819312 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m=map(int,input().split())\ns=[]\nfor i in range(1,int(m**2)+1):\n if m%i==0 and i=<n:\n s.append(i)\n if m/i=<n:\n s.append(m/i)\nprint(max(s))', 'n, m = list(map(int,input().split()))\ndef solve():\n for i in range(m//n, 0, -1):\n if m % i == 0:\n\t\t\tprint(i)\n break\nsolve()', 'n, m = list(map(int,input().split()))\ndef solve():\n for i in range(m//n, 0, -1):\n if m % i == 0:\n print(i)\n break\nsolve()'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s713867803', 's859080268', 's794957696'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 1952.0] | [166, 144, 153] |
p03241 | u620480037 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N,M=map(int,input().split())\n\n\nans=1\n\nfor i in range(1,min(M//N+100,10**5+5)):\n if M%i==0:\n ans=i\nprint(ans)', 'N,M=map(int,input().split())\nans=0\nfor i in range(1,10**5):\n if M%i==0:\n a=max(M//i,i)\n b=min(M//i,i)\n if M//a>=N and ans<a:\n ans=a\n if M//b>=N and ans<b:\n ans=b\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s132059296', 's628624637'] | [3316.0, 3060.0] | [30.0, 30.0] | [122, 225] |
p03241 | u621100542 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nN,T = map(int,input().split())\n \nif T % N == 0:\n print (int(T / N))\n exit()\n \nfor i in range(T): \n A = math.ceil(T / N)\n print(A)\n if T % A ==0:\n print(T)\n break\n T = A', 'N,T = map(int,input().split())\nif T % N == 0:\n print (int(T / N))\n\nd = int(T / N)\nelse:\n for i in range(d+1,0,-1): \n if T % i ==0:\n print(i)\n break', 'import math\nN,T = list(map(int,input().split()))\n#d = int(T / N)\nm = []\ndef ans():\n for i in range(1,int(math.sqrt(T))): \n if T % i ==0:\n m.append(i)\n m.append(T//i)\n print (m[-1])\nif T % N == 0:\n print (int(N / T))\nelse:\n ans()', 'import math\nN,T = list(map(int,input().split()))\n#d = int(T / N)\nm = []\n\ndef ans():\n ans = 1\n for i in range(1,int(math.sqrt(T))): \n if T % i ==0:\n m.append(i)\n m.append(T//i)\n for p in m:\n if p <= T // N:\n ans = max(ans,p)\n print (ans)\n \nif T % N == 0:\n print (int(T / N))\nelse:\n ans()'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s260698307', 's378509592', 's480751804', 's598967920'] | [3060.0, 2940.0, 3060.0, 3060.0] | [17.0, 17.0, 20.0, 20.0] | [219, 186, 285, 370] |
p03241 | u634159866 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N, M = map(int, input().split())\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n return divisors\n\ndiv = sorted(make_divisors(M))\nwhile M//div[i]>=N:\n ans = div[i]\n i+=1\n \nprint(ans)', 'N, M = map(int, input().split())\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n \n return divisors\n\nif N==1:\n print(M)\n\nelse:\n div = sorted(make_divisors(M))\n i = 0 \n while i<=len(div) and M//div[i]>=N:\n ans = div[i]\n i+=1\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s583227950', 's636277949'] | [3064.0, 3064.0] | [21.0, 21.0] | [345, 433] |
p03241 | u655975843 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import sys\nimport math\nns = lambda: sys.stdin.readline().rstrip()\nni = lambda: int(ns())\nnm = lambda: map(int, sys.stdin.readline().split())\nnl = lambda: list(nm())\nnsl = lambda: map(str, sys.stdin.readline().split())\n\nn, m = nm()\nans = 1\nfor i in range(2, int(math.sqrt(m)) + 1):\n if m % i == 0 and m // i >= n:\n ans = max(i, m // i)\nif n == 1:\n print(m)\nelse:\n print(ans)\n', 'import sys\nimport math\nns = lambda: sys.stdin.readline().rstrip()\nni = lambda: int(ns())\nnm = lambda: map(int, sys.stdin.readline().split())\nnl = lambda: list(nm())\nnsl = lambda: map(str, sys.stdin.readline().split())\n\nn, m = nm()\nans = 1\nfor i in range(2, math.ceil(math.sqrt(m)) + 1):\n if m % i == 0:\n ans = max(i, m // i)\nprint(ans)\n', 'import sys\nimport math\nns = lambda: sys.stdin.readline().rstrip()\nni = lambda: int(ns())\nnm = lambda: map(int, sys.stdin.readline().split())\nnl = lambda: list(nm())\nnsl = lambda: map(str, sys.stdin.readline().split())\n\nn, m = nm()\nans = 1\nfor i in range(1, int(math.sqrt(m)) + 2):\n if m % i == 0:\n if m // i >= n and i >= n:\n ans = max(ans, i, m // i)\n elif m // i >= n:\n ans = max(ans, i)\n elif i >= n:\n ans = max(ans, m // i)\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s590621383', 's841985956', 's212336739'] | [3064.0, 3060.0, 3064.0] | [22.0, 21.0, 21.0] | [390, 346, 496] |
p03241 | u657541767 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n, m = map(int, input().split())\n\ndef solve():\n res = 1\n for i in range(2, m+1):\n if m % i == 0:\n if (m // i) >= n:\n res = max(res, i * (m // i // n))\n break\n print(res)\n\nsolve()\n', 'n, m = map(int, input().split())\n\ndef solve():\n res = 1\n for i in range(m//n+1, 0, -1):\n if m % i == 0:\n if (m // i) >= n:\n res = i\n break\n print(res)\n\nsolve()\n'] | ['Wrong Answer', 'Accepted'] | ['s872677255', 's927330771'] | [2940.0, 2940.0] | [2103.0, 1892.0] | [236, 217] |
p03241 | u658993896 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['def factorize(M):\n fact=[]\n for i in range(2,4*10**4):\n tmp=[1]\n if M==1:\n break\n while M%i==0:\n M//=i\n tmp.append(tmp[-1]*i)\n if len(tmp)>1:\n fact.append(tmp)\n return fact\n\ndef divisor(fact,arr,i,p):\n if i == len(fact):\n arr.append(p)\n return 0\n for x in fact[i]:\n divisor(fact,arr,i+1,p*x)\n \nN,M=list(map(int,input().split()))\n\nfact = factorize(M)\narr=[]\ndivisor(fact,arr,0,1)\nprint(fact)\narr=sorted(arr)\nprint(arr)\nans=1\nfor x in arr:\n if x>M//N:\n break\n ans=x\nprint(ans)', 'def factorize(M):\n fact=[]\n for i in range(2,10**5):\n tmp=[1]\n if M==1:\n break\n while M%i==0:\n M//=i\n tmp.append(tmp[-1]*i)\n if len(tmp)>1:\n fact.append(tmp)\n if M!=1:\n fact.append([1,M])\n return fact\n\ndef divisor(fact,arr,i,p):\n if i == len(fact):\n arr.append(p)\n return 0\n for x in fact[i]:\n divisor(fact,arr,i+1,p*x)\n \nN,M=list(map(int,input().split()))\n\nfact = factorize(M)\narr=[]\ndivisor(fact,arr,0,1)\narr=sorted(arr)\nans=1\nfor x in arr:\n if x>M//N:\n break\n ans=x\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s640050282', 's160821051'] | [3064.0, 3064.0] | [27.0, 41.0] | [598, 613] |
p03241 | u665038048 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n, m = map(int, input().split())\n\n\ndef make_divisors(num):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if num % i == 0:\n divisors.append(i)\n if i != num // i:\n divisors.append(num//i)\n return divisors\n\ndiv = make_divisors(num=m)\ndiv.sort()\nans = 0\nfor x in div:\n if x*n <= m:\n ans = max(ans, x)\nprint(ans)\n', 'n, m = map(int, input().split())\n\n\ndef make_divisors(num):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if num % i == 0:\n divisors.append(i)\n if i != num // i:\n divisors.append(num//i)\n return divisors\n\ndiv = make_divisors(num=m)\n\nans = 0\nfor x in div:\n if x*n <= m:\n ans = max(ans, x)\nprint(ans)\n', 'n, m = map(int, input().split())\n\n\ndef make_divisors(num):\n divisors = []\n for i in range(1, m+1):\n if i * i > m:\n break\n if m % i == 0:\n divisors.append(i)\n divisors.append(m // i)\n return divisors\n\ndiv = make_divisors(num=m)\ndiv.sort()\nans = 1\nfor x in div:\n if x*n <= m:\n ans = x\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s078782269', 's642055083', 's462952696'] | [3060.0, 3060.0, 3060.0] | [17.0, 18.0, 23.0] | [376, 366, 360] |
p03241 | u670180528 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['from fractions import*;n,m=map(int,input().split());print(gcd(m//n,m%n))', 'n,m=map(int,input().split())\nans=1\nfor i in range(1,int(m**.5)+1):\n if m%i==0:\n if i*n<=m and ans<i:\n ans=i\n if n<=i and ans<m//i:\n ans=m//i\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s812082059', 's243469367'] | [5304.0, 3060.0] | [39.0, 23.0] | [72, 168] |
p03241 | u672220554 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\ndef main():\n n,m = map(int,input().split())\n for i in range(n,math.ceil(math.sqrt(m))):\n if m%i==0:\n print(m//i)\n break\nmain()', 'import math\ndef main():\n n,m = map(int,input().split())\n\n start = min(m//n,math.sqrt(m))\n\n for i in range(start,0,-1):\n if m%i==0:\n print(i)\n break\n\nmain()', 'import math\ndef main():\n n,m = map(int,input().split())\n for i in range(n,math.floor(math.sqrt(m))):\n if m%i==0:\n print(m//i)\n break\nmain()', 'def main():\n n,m = map(int,input().split())\n\n start = m//n\n\n for i in range(start,0,-1):\n if m%i==0:\n print(i)\n break\n\nmain()'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s563850109', 's659991684', 's749268877', 's306235490'] | [2940.0, 2940.0, 2940.0, 2940.0] | [19.0, 19.0, 19.0, 1754.0] | [173, 193, 174, 163] |
p03241 | u673338219 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m = map(int,input().split())\ng = 1\nfor i in range(1,m):\n if m%i == 0:\n if int(m/i) >= n:\n g = int(m/i)\n else:\n break\n \nprint(g)\n ', 'n,m = map(int,input().split())\ng = 1\nfor i in range(m):\n if m%i == 0:\n if int(m/i) >= n:\n g = int(m/i)\n else:\n break\n \nprint(g)\n ', 'n,m = map(int,input().split())\ng = 1\ndef fact(k):\n a = []\n for i in range(1,int(k **(0.5))+1):\n if k%i ==0:\n a.append(i)\n a.append(int(k/i))\n b = list(set(a))\n b.sort()\n return b\n\ng = fact(m)\nfor i in range(len(g)):\n if g[len(g)-i-1] <= m/n:\n print(g[len(g)-i-1])\n break\n \n \n \n \n\n '] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s197386797', 's286426007', 's689289742'] | [2940.0, 2940.0, 3064.0] | [2104.0, 17.0, 20.0] | [154, 152, 321] |
p03241 | u673361376 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ["from fractions import gcd\nfrom functools import reduce\nfrom itertools import combinations\n\nN,M = map(int,input().split())\nalist = []\nfor cmb in combinations([i for i in range(1,M)],N-1):\n cmb = [0] + list(cmb) + [M]\n tmp_a = sorted([cmb[i]-cmb[i-1] for i in range(1,N+1)])\n if tmp_a not in alist: alist.append(tmp_a)\n\nans = -float('inf')\nfor a in alist:\n ans = max(ans, reduce(gcd,a))\nprint(ans)", "def make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n return divisors\n\nans = -float('inf')\nN,M = map(int,input().split())\nfor div in make_divisors(M):\n if M//div >= N: ans = max(ans, div)\nprint(ans)"] | ['Time Limit Exceeded', 'Accepted'] | ['s024206172', 's661867899'] | [1386360.0, 3060.0] | [2246.0, 20.0] | [399, 348] |
p03241 | u687044304 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['# -*- coding:utf-8 -*-\n\n\n\nfrom fractions import gcd\n\ndef solve():\n N, M = list(map(int, input().split()))\n\n base = M//N\n\n if M%N == 0:\n print(base)\n return\n else:\n last = base + M%N\n ans = gcd(base, last)\n print(ans)\n return\n\n\n\nif __name__ == "__main__":\n solve()\n', '# -*- coding:utf-8 -*-\n\n\n\ndef solve():\n N, M = list(map(int, input().split()))\n\n divs = set() \n\n \n n = 1\n while n*n <= M:\n if M%n == 0:\n \n divs.add(n)\n divs.add(M//n)\n n += 1\n\n \n ans = 0\n for d in divs:\n if d*N <= M:\n ans = max(ans, d)\n\n print(ans)\n\n\ndef solve2():\n N, M = list(map(int, input().split()))\n\n divs = set()\n\n n = 1\n while n <= M**(1/2):\n if M%n == 0:\n divs.add(n)\n divs.add(M//n)\n n += 1\n\n ans = 0\n for d in divs:\n if M >= d*N:\n ans = max(ans, d)\n print(ans)\n\n\nif __name__ == "__main__":\n solve2()\n'] | ['Wrong Answer', 'Accepted'] | ['s181738080', 's999760902'] | [5304.0, 3188.0] | [38.0, 33.0] | [629, 892] |
p03241 | u690536347 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m=map(int,input().split())\nfor i in range(m//n+1)[::-1]:\n\tif m%i==0:\n\t\tprint(i)\n exit()\n', 'def f():\n n,m=map(int,input().split())\n for i in range(m//n+1)[::-1]:\n if m%i==0:return i\nf()', 'N, M = map(int, input().split())\n\nl = []\nfor i in range(1, int(M**0.5)+1):\n if M%i==0:\n l += [M//i]\n if M//i != i:\n l += [i]\nl.sort()\n\nfor i in l:\n if i >= N:\n print(M//i)\n break'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s611444899', 's717976910', 's529960806'] | [2940.0, 2940.0, 3188.0] | [17.0, 1770.0, 21.0] | [97, 98, 223] |
p03241 | u690700473 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ["import math\n\ndef main():\n N, M = list(map(int, input().split(' ')))\n s = min(math.ceil(math.sqrt(M)), M//N)\n while True:\n if M%s == 0:\n print(max(s, M//s))\n break\n s -= 1\n\n\n\nif __name__ == '__main__':\n main()", "import math\n\ndef main():\n N, M = list(map(int, input().split(' ')))\n s = min(math.ceil(math.sqrt(M)), M//N)\n ret = []\n while s > 0:\n if M%s == 0:\n a = M//s\n ret.append(a)\n ret.append(s)\n s -= 1\n print(max([s for s in ret if s <= M//N]))\n\n\n\nif __name__ == '__main__':\n main()"] | ['Wrong Answer', 'Accepted'] | ['s348969046', 's979455704'] | [3060.0, 3060.0] | [19.0, 22.0] | [256, 339] |
p03241 | u691896522 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\n\nn, m = list(map(int, input().split()))\nk = 0\nfor i in range(1, int(math.sqrt(m) + 1)):\n if m % i == 0 and m/k >= n:\n k = i\nprint(k)', 'import math\n\nn, m = list(map(int, input().split()))\nk = 0\nfor i in range(1, int(math.sqrt(m) + 1):\n if m % i == 0:\n k = i\nprint(k)\n', 'import math\n\nn, m = list(map(int, input().split()))\nreg = (m / n)\nk = 1\nfor i in range(1, int(math.sqrt(m) + 1)):\n if m % i == 0:\n a = m/i\n b = i\n if reg >= b and k < b:\n k = b\n if reg >= a and k < a:\n k = a\nprint(int(k))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s482724226', 's834657335', 's489830048'] | [2940.0, 2940.0, 3060.0] | [18.0, 17.0, 21.0] | [154, 141, 274] |
p03241 | u706695185 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nN, M = map(int, input().split())\n\nans = 1\nfor a in range(math.sqrt(M)):\n b = int(M / a)\n if M%a != 0:\n continue\n if a * N <= M:\n ans = max(ans, a)\n if b * N <= M:\n ans = max(ans, b)\n\nprint(ans)\n\n', 'import math\nN, M = map(int, input().split())\n\nans = 1\nfor a in range(1, int(math.sqrt(M))):\n b = int(M / a)\n if M%a != 0:\n continue\n if a * N <= M:\n ans = max(ans, a)\n if b * N <= M:\n ans = max(ans, b)\n\nprint(ans)\n\n'] | ['Runtime Error', 'Accepted'] | ['s272150450', 's392983720'] | [3060.0, 3060.0] | [17.0, 28.0] | [240, 248] |
p03241 | u708255304 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N, M = map(int, input().split()) \n\nans = 1\n\nif N == 1:\n print(M)\n exit()\n\nfor i in range(1000000):\n if (M >= N * i) and (M % i == 0):\n ans = i\n\nprint(ans)\n', 'N, M = map(int, input().split()) \n\nif N == 1:\n print(M)\n exit()\n\n\nprimes = []\nans = 1\n\n\nfor i in range(1, int(M**(1/2))+1):\n if M % i == 0:\n primes.append(i)\n primes.append(M//i)\n\n\nfor d in primes:\n if M >= N * d:\n ans = d\n\nprint(d)\n', 'N, M = map(int, input().split()) \n\nif N == 1:\n print(M)\n eixt()\n\n\nprimes = []\nans = 1\n\n\nfor i in range(1, int(M**(1/2))+1):\n if M % i == 0:\n primes.append(i)\n primes.append(M//i)\n\n\nfor d in primes:\n if M >= N * d:\n ans = d\n\nprint(d)\n', 'N, M = map(int, input().split()) \n\ndivs = []\nfor i in range(1, int((M)**(1/2)+1)):\n if M % i == 0:\n divs.append(i)\n divs.append(M//i)\n\ndivs.sort()\n\nans = 0\nfor d in divs:\n if M//N >= d:\n ans = d\n else:\n break\n\nprint(ans)\n'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s190829031', 's267954874', 's758996206', 's212285035'] | [2940.0, 3060.0, 3060.0, 3188.0] | [17.0, 21.0, 22.0, 21.0] | [191, 345, 345, 333] |
p03241 | u711295009 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nn,m = map(int, input().split())\nif m%n==0:\n print(m//n)\nelse:\n def make_divisor_list(num):\n if num < 1:\n return []\n elif num == 1:\n return [1]\n else:\n divisor_list = []\n divisor_list.append(1)\n for i in range(2, int(math.sqrt(num)) + 1):\n if num % i == 0:\n divisor_list.append(i)\n divisor_list.append(num)\n\n return divisor_list\n \n listD = make_divisor_list(m)\n index =0\n while index <len(listD):\n if listD[index]>n-1:\n print(m//listD[index])\n break\n index+=1\n', 'import math\nimport time\nn, m = map(int, input().split())\nflag=0\nif m%n==0:\n print(m//n)\n\nelse:\n start = time.time()\n index=m//n\n while index >0:\n elapsedTime = time.time()-start\n if elapsedTime > 1:\n flag=1\n break\n elif m%index==0:\n print(index)\n break\n index-=1\n\n if flag==1:\n index = 1\n while index < m+1:\n if m % index == 0:\n if index > n-1:\n print(m//index)\n break\n index += 1'] | ['Wrong Answer', 'Accepted'] | ['s800184212', 's067426441'] | [3064.0, 3064.0] | [20.0, 1018.0] | [657, 556] |
p03241 | u727412592 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\n\nN, M=input().split(" ")\nN=int(N)\nM=int(M)\n\ndef get_number(M):\n result=list()\n for i in range(1,int(math.sqrt(M))):\n if M%i==0:\n result.append(i)\n result.append(int(M/i))\n result.sort()\n return(result)\n \ndef check_number(N,M):\n number=get_number(M)\n answer=list()\n for i in number:\n if M/i>=N:\n answer.append(i)\n \n return(answer[-1])\n \ncheck_number(N,M)', 'import math\n \nN, M=input().split(" ")\nN=int(N)\nM=int(M)\n \ndef get_number(M):\n result=list()\n for i in range(1,int(math.sqrt(M))):\n if M%i==0:\n result.append(i)\n result.append(int(M/i))\n result.sort()\n return(result)\n \ndef check_number(N,M):\n if N==1:\n return(M)\n number=get_number(M)\n answer=list()\n for i in number:\n if M/i>=N:\n answer.append(i)\n \n return(answer[-1])\n \nprint(check_number(N,M))'] | ['Runtime Error', 'Accepted'] | ['s459769958', 's768145932'] | [3064.0, 3064.0] | [20.0, 20.0] | [453, 493] |
p03241 | u729133443 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m=map(int,input().split())\na=0\nfor i in range(1,18000000):\n if m%i:continue\n if m//i>=n:a=i\nprint(a)', 'def s(n):\n return[m(t)for t in d(f(n))]\ndef f(n):\n l=[]\n b,e=2,0\n while b*b<=n:\n while not n%b:\n n//=b\n e+=1\n if e:\n l.append((b,e))\n b,e=b+1,0\n if n>1:\n l.append((n,1))\n return l\ndef d(l):\n b,e=l.pop()\n p=d(l)if l else[[]]\n v=[[(b,k)]for k in range(e+1)]\n return[s+t for s in p for t in v]\ndef m(l):\n a=1\n for b,e in l:\n a*=b**e\n return a\nN,M=map(int,input().split())\nif M<2:print(1);exit()\na=0\nfor i in sorted(s(M))[::-1]:\n if M//i>=N:\n a=i\n break\nprint(a)'] | ['Wrong Answer', 'Accepted'] | ['s392466146', 's885590055'] | [2940.0, 3064.0] | [1972.0, 23.0] | [108, 582] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.