A- Irrational problem p Time Limit: 2000MS Memory Limit: 262144K 64bit IO Format: %I64d& %I64 Description Little Petya was given this problem for homework: You are given function Irrational problem (here Irrational problem represents the operationof…