The problem B of today's educational round was unusual. I struggled a lot and solved it very slowly. But after doing so I was able to solve C, D, E quickly enough which saved my ass. I am totally clueless as to why I sucked so much. I saw demoralizer and some other high rated coders struggle in it too. What is your opinion on this problem? What was your thought process? What should one do to improve one's skill in this type of problem? The tag says it is a number theory problem. Do you think it would be enough to practice number theory to get a greater grasp? Or would you suggest something else? Please let me know in the comment section!