competitions: Fix histogram and problem count generation