You are given an integer array dataframes of size n where each element represents the number of frames in a dataframe.
A dataframe is considered valid if it can be divided into at least two chunks of equal size. In other words, if a dataframe contains x frames, there must exist an integer k >= 2 such that:
x is divisible by k, andIf a dataframe cannot be divided this way, you may add the minimum number of frames required to make it divisible into at least two equal-sized chunks.
Your task is to determine the total number of frames that must be added across all dataframes.