You are viewing a single comment's thread. Return to all comments →
#nobara import math import os import random import re import sys def toys(w): w.sort() total = 1 free_toys = w[0] + 4 for i in range(1, len(w)): if w[i] > free_toys: total += 1 free_toys = w[i] + 4 return total n = int(input().strip()) w = list(map(int, input().strip().split(' '))) print(toys(w))
Seems like cookies are disabled on this browser, please enable them to open this website
Priyanka and Toys
You are viewing a single comment's thread. Return to all comments →