($N,$K)=glob<>; / .* /,${$`}[$&]++or++${$`},$_[$'-1]+=$N-${$`^v17}for reverse<>; shift@_;$N*=$N;$N-=$_ for@_;$,=$/;print$N,@_