Created
March 22, 2019 14:25
-
-
Save alfa-carinae/c570fa19ea908dcd8d1bfee81c19c8ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
u = int(input("Enter the number of round tables\n: ")) | |
v = int(input("Enter the number of people\n: ")) | |
if (u > 0 and v > 0) and (u < 100 and v < 100): | |
from itertools import * | |
if v % u != 0: | |
distr0 = list(combinations([i for i in range(v)], int(v / u))) | |
tmp = list(product(distr0, [i for i in range(v % u)])) | |
else: | |
tmp = list(combinations([i for i in range(v)], int(v / u))) | |
"""for i in tmp: | |
print(i)""" | |
print(len(tmp)) | |
else: | |
print("The number of people and tables must be between 1 and 99.") |
jonatonavich
commented
Mar 23, 2019
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment