You are required to implement a function that calculates the minimum number of blimps needed to reduce the sadness levels of several cities. Each city has a certain level of sadness, and a blimp can lower the sadness level by a fixed amount. The function should handle two scenarios based on the effectiveness of the blimps and output the minimum number of blimps required.
Input/Output Requirements
Input:
An integer N (1 ≤ N ≤ 1000): the number of cities.
An integer X (1 ≤ X ≤ 1000): the amount of sadness reduced by a single blimp for cities with a sadness level less than or equal to X.
An integer Y (1 ≤ Y ≤ 1000): the amount of sadness reduced by a single blimp for cities with a sadness level greater than X.
A list of integers cities_sadness of length N: the current sadness levels of the cities. Each value represents the sadness level of a city (0 ≤ cities_sadness[i] ≤ 10000).
Output:
An integer representing the minimum number of blimps required to reduce the sadness levels across all cities to zero or below.
Implementation Details
Create a file named /app/solution.py.
Implement the function calculate_min_blimps(N, X, Y, cities_sadness) inside this file.
Ensure the function handles both scenarios where Y is greater than or equal to X, and where Y is less than X.
Example
python
N = 5
X = 3
Y = 5
cities_sadness = [10, 15, 0, 20, 5]
result = calculate_min_blimps(N, X, Y, cities_sadness)
print(result) # Expected output should be the minimum number of blimps required.
Make sure to include appropriate error handling and testing to ensure that the function works as intended for all valid inputs.