## UVA Problem 113 – Power of Cryptography Solution

UVA Problem 113 – Power of Cryptography Solution:

Click here to go to this problem in uva Online Judge.

Solving Technique:

This is a very easy mathematical problem. The formula is given. kn = p. We can solve this with taking ln on each sides and calculating for k using k = e(ln(p)/n). But the formula below is easier.

Simplify kn = p,

```kn = p
(kn)(1/n) = p(1/n)
k = p(1/n)       /* k = pow(p,1/n) */
```

or, just using power formula below. We are asked to find the value of k given n and p. Also The formula for calculating k is given n√p.

For this problem taking n and p is double is enough. Also for this problem there is no digits after decimal. For c double printf to discard values after decimal point we can use,

`%.0lf`

Also we should keep scanning until EOF is encountered.

Important:  Be sure to add or print a new line after each output. The outputs should match exactly because sometimes even a space character causes the answer to be marked as wrong answer.

Input:

```2
16
3
27
7
4357186184021382204544```

Output:

```4
3
1234```

Code:

```/*
* @author Quickgrid ( Asif Ahmed )