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 ... | ['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... | ['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... | ['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... | ['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... | ['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,inpu... | ['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)... | ['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... | ['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 fo... | ['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... | ['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 = li... | ['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 ... | ['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 divi... | ['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 ... | ['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 ... | ['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 ... | ['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)... | ['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 ... | ['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 item... | ['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 exi... | ['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.fl... | ['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... | ['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)\np... | ['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... | ['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//... | ['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)... | ['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 ... | ['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 ... | ['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 divisor... | ['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 ... | ['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(... | ['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... | ['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/(... | ['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 = m... | ['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 ... | ['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 ... | ['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)', 'impor... | ['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... | ['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 ... | ['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... | ['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 ... | ['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 = facto... | ['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 =... | ['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', ... | ['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 [... | ['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))... | ['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 ... | ['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:\... | ['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... | ['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 pri... | ['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 ... | ['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()]\... | ['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 ... | ['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_lis... | ['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)... | ['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=[... | ['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()... | ['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.... | ['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... | ['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(... | ['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... | ['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... | ['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 ... | ['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 ... | ['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())\... | ['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()... | ['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())\nde... | ['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)... | ['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 ... | ['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... | ['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(... | ['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... | ['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 ... | ['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\... | ['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 ... | ['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 br... | ['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 i... | ['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... | ['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 ... | ['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 //... | ['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 ... | ['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):... | ['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 ... | ['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):\... | ['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 \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.app... | ['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__ ==... | ['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 ... | ['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(... | ['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', '... | ['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\nf... | ['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... | ['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,... | ['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_numb... | ['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))... | ['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.