You are required to implement a function that calculates the total number of distinct appearances possible for a series of painted rooms. The function, named calculate_total_paintings, will determine how many ways two painters, HELL and Printf, can paint a specified number of rooms, ensuring that not all rooms are painted white.
Functionality
The function must take two parameters:
N (int): The total number of rooms.
K (int): The number of rooms that the painter HELL will paint.
The function should perform the following operations:
Calculate the total number of ways HELL can paint the first K rooms, which can be any color (not solely white). This is computed as (10^K).
Calculate the total number of ways Printf can paint the remaining N-K rooms, which again can be any color, computed as (10^{(N-K)}).
Combine these two results to find the total number of different possible appearances, but exclude cases where all rooms for both painters are painted white. This can be expressed mathematically as:
[
c = (10^K \times 10^{(N-K)}) - 10^K - 10^{(N-K)} + 1
]
The function must return the computed value of c.
Input/Output Requirements
Input: Two integers, N (1 <= N <= 10^6) and K (0 <= K <= N).
Output: An integer representing the total number of distinct appearances of the painted rooms.
Implementation
The solution must be implemented in a file named /app/solution.py with the following function signature:
python
def calculate_total_paintings(N, K):
# Your implementation here
Ensure the implementation follows the logic described and handles edge cases appropriately.