Vasya and Basketball (brute force)