#!/usr/bin/python3
import random
import math
total=None
n=None
def gen_lst(n):
    return [round(random.uniform(10,100),2) for _ in range(n)]

def get_count(ml,total):
    count=0
    msum=0
    for el in ml:
        msum+=el
        count+=1
        if msum>=total:
            break
    return count
def print_lst(ml):
    print(ml, sep=",")

def main():
    global n, total
    try:
        n=int(input("Δώσε n:"))
        total=float(input("Δώσε total:"))
    except Exception as e:
        print (str(e))
        exit(1)
    ml=gen_lst(n)
    print (f"Count={get_count(ml,total)}")
    print_lst(ml)



if __name__=="__main__":
    main()
