# My Weblog

## SPOJ Uncle Jack

Uncle Jack problem is related to combinatorics . Lets say we have N CDs and K nephew . Now each CD can be assigned to one of the K nephew so first CD can be assigned in K way , second in a K way ,…… Nth is also in K way . Total number of ways in $K^N$.

```import Data.List

solve :: [Integer] -> String
solve ( a : b: _ ) = show \$ a^b

main = interact \$ unlines . map ( solve . map read . words ) . init . lines
```