My issue
i got output wrong i want correct code for this
My code
import sys
import math
def min_boxes_with_m_balls(test_cases):
results = []
for N, M, A in test_cases:
total_boxes_with_m_balls = 0
for a in A:
total_boxes_with_m_balls += (a + N - 1) // N
results.append(total_boxes_with_m_balls)
return results
input_data = sys.stdin.read().strip().splitlines()
T = int(input_data[0]) # number of test cases
index = 1
test_cases = []
for _ in range(T):
N, M = map(int, input_data[index].split())
index += 1
A = list(map(int, input_data[index].split()))
index += 1
test_cases.append((N, M, A))
results = min_boxes_with_m_balls(test_cases)
for result in results:
print(result)
Learning course: Design and Analysis of Algorithms
Problem Link: https://www.codechef.com/learn/course/kl-daa/KLDAA2400G/problems/DSSA110