{"task": {"agent_timeout": 600, "task": "818", "verifier_timeout": 7200, "instruction": "Please implement a Python 3 solution to the below problem.\nReason through the problem and:\n1. Restate the problem in plain English\n2. Conceptualize a solution first in plain English\n3. Write a pseudocode solution\n4. Save your solution as solution.py\nNo outside libraries are allowed.\n\n[BEGIN PROBLEM]\nBored of farm life, the cows have sold all their earthly possessions and joined\nthe crew of a traveling circus. So far, the cows had been given easy acts:\njuggling torches, walking tightropes, riding unicycles -- nothing a handy-hoofed\ncow couldn't handle.  However, the ringmaster wants to create a much more\ndramatic  act for their next show.\n\nThe stage layout for the new act involves $N$ platforms arranged in a circle. \nOn each platform, between $1$ and $N$ cows must form a stack, cow upon cow upon\ncow. When the ringmaster gives the signal, all stacks must simultaneously fall\nclockwise, so that the bottom cow in a stack doesn't move, the cow above her\nmoves one platform clockwise, the next cow moves two platforms clockwise, and so\nforth.  Being accomplished gymnasts, the cows know they will have no trouble\nwith the technical aspect of this act. The various stacks of cows will not\n\"interfere\" with each other as they fall, so every cow will land on the intended\nplatform. All of the cows landing on a platform form a new stack, which does not\nfall over.\n\nThe ringmaster thinks the act will be particularly dramatic if after the stacks\nfall, the new stack on each platform contains the same number of cows as the\noriginal stack on that platform.  We call a configuration of stack sizes\n\"magical\" if it satisfies this condition.  Please help the cows by computing the\nnumber of magical configurations. Since this number may be very large, compute\nits remainder modulo $10^9 + 7$.\n\nTwo configurations are considered distinct if there is any platform for which\nthe configurations assign a different number of cows. \n\nINPUT FORMAT:\nThe input is a single integer, $N$ ($1 \\leq N \\leq 10^{12}$).\n\nOUTPUT FORMAT:\nA single integer giving the number of magical configurations modulo $10^9 + 7$.\n\nSAMPLE INPUT:\n4\nSAMPLE OUTPUT: \n6\n\nFor $N = 4$, the valid configurations are $(1,1,1,1)$, $(2,2,2,2)$, $(3,3,3,3)$,\n$(4,4,4,4)$, $(2,3,2,3)$, and $(3,2,3,2)$.\n\nProblem credits: Dhruv Rohatgi\n\n[END PROBLEM]\n", "memory": "2048m", "runnable": false, "difficulty": "medium", "language": "", "cpus": 1, "instruction_truncated": false, "category": "python_programming", "compose": false, "has_solution": true, "oracle": null, "docker_image": "", "taskset": "usaco", "tags": ["python", "programming", "usaco"]}, "runs": []}