from itertools import combinations
import numpy as np
import random
import math
def select_combination(N_papers:int, N_speakers:int):
    '''
    Produces the list of combinations of N_papers taken N_speakers at a time.
    Returns a random item from the list.
    
    INPUT
    N_papers      [int] number of papers on benty-fields
    N_speakers    [int] number of speakers participating to the weekly activity
    
    VARIABLES 
    comb          [list] combinations
    len_comb      [int] length of combination list
    idx           [int] random index that picks a combination
    
    OUTPUT
    comb[idx]     [list] list of papers. The number identifies the 
                  benty-fields order, while the position in the list
                  identifies the speakers' order.
    '''
    comb = list(combinations(np.arange(1, N_papers+1), N_speakers))
    len_comb = len(comb) #s.comb(30,10)
    idx = math.floor(random.uniform(1, len_comb))
    return comb[idx]#, len_comb
    N_papers = int(input("How many papers are on this week's benty-fields list?"))
    N_speakers = int(input("How many speakers will participate this week?"))
    selected_comb = select_combination(N_papers, N_speakers)
    print(selected_comb)