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.
t = int(input().strip())
for a0 in range(t):
n = int(input().strip())
if (n in range(1,1000000001) and t in range(1,100001)):
s=su(3,n)+su(5,n)-su(15,n)
print(s)
why is this not working
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #1: Multiples of 3 and 5
You are viewing a single comment's thread. Return to all comments →
import sys
def su(x,n): b=(n-1)//x c=b*((b+1)*x)/2 return int(c)
t = int(input().strip()) for a0 in range(t): n = int(input().strip()) if (n in range(1,1000000001) and t in range(1,100001)): s=su(3,n)+su(5,n)-su(15,n) print(s)
why is this not working