n,m = map(int,input().split()) assert 5 <= n <= 300 assert 0 <= m <= n*(n-1)//2