We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
count = 0
for i in range(2,n+1):
x = i
for r in range(1,(n//2)+1):
if x > k:
count = count + (i-2*r+1)
break
x = (x*(i-r))//(r+1)
answer = count
return answer
t = 1
for i in range(0,t):
n,k = map(int, input().split())
answer = Solve_Prob(n,k)
print(answer)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Project Euler #53: Combinatoric selections
You are viewing a single comment's thread. Return to all comments →
Short and simple:
def Solve_Prob(n,k):
t = 1 for i in range(0,t): n,k = map(int, input().split()) answer = Solve_Prob(n,k) print(answer)