SolarPea thinks inversion is beautiful.
For a 01-sequence
Z with length
n and a constant
c, SolarPea defines the
rating of
Z is:
SolarPea wrote all 01-sequences which have length
n and contain
m '1's on the paper. PolarSea saw it and crossed out all sequences that he doesn't like. Now you're given
c, please calculate the sum of the
ratings of the remaining sequences on the paper.
Since the answer could be very large, you should output it modulo 1065977431 (a prime number).
It is guaranteed that c is generated randomly.