Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def read_file():
- f = open("in.txt")
- nums = ""
- for line in f:
- if line[-1] == "\n":
- line = line[:-1]
- nums += line
- nums = nums.split(" ")
- for i in range(len(nums)):
- nums[i] = int(nums[i])
- nums.sort()
- return nums
- def find_n(binominal_coeff):
- n = 3
- while True:
- bc = math.factorial(n)/(math.factorial(2)*math.factorial(n-2))
- if int(bc) == binominal_coeff:
- return n
- else:
- n += 1
- def find_smaller_dist(nums, n):
- m = max(nums)
- nums = read_file()
- n = find_n(len(nums))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement