#include <stdio.h>

    int main()
    {
      int trees[3] = {24, 7, 16};
      int limit = 11;
      int allowedRemainder = 0;
      int mod = 0;
      int modCount = 0;
      int i;
      for (i = 0; i < 3; ++i)
      {
      	allowedRemainder = (trees[i] / limit) - 1;
      	mod = trees[i] % limit;

        modCount += (allowedRemainder > 0) * (allowedRemainder * limit) + (allowedRemainder >= 0) * mod;
        printf("Loop %d: mod = %d\n", i, modCount);
      }
      printf("Amount to remove: %d\n", modCount);
      return 0;
    }