Im getting a runtime error for the MUFFINS3 problem ,working on IDE

The logic in my code was basically to create a function which find the size of each box when the remainder is maximum , and then i created an array for the test values and just printed the sizes,
im not able to figure out what the problem is

    int A[N];

N can be as large as 10^8: c - Getting a stack overflow exception when declaring a large array - Stack Overflow

After editing the code its now exceeding the time limit

That’s because you’re creating and populating a (dynamic) array of size up to 10^8, up to 1000 times! :slight_smile:

Probably best to just read this: