Can anyone provide some hints to this problem? Although N <= 10^18 but there is some pattern which I am not able to detect.
Part of course:
Secret Cow Code (Silver, January Contest: USACO 2017)
Show admin stats
Can anyone provide some hints to this problem? Although N <= 10^18 but there is some pattern which I am not able to detect.