mardi 22 novembre 2022

C++ I’m struggling to find a solution to this excercise [closed]

there are N chickens, the corresponding chickens every t1, t2, ..., tn seconds will lay 1 egg. Write a program to calculate the minimum time to bake X cakes, knowing that 1 cake only uses 1 egg.

-Line 1: 2 integers x (0<x<10^15) and N (0<N<20) -Line 2: N integers, 0<ti<500 (i= 1…N)

Testcase: INPUT 3 2 50 70 OUTPUT 100

can someone help me with this exercise?

Aucun commentaire:

Enregistrer un commentaire