Solution for A
Solution for B
Add solutin for D
Use Int instead of double to avoid rounding error
Remove old import
Broken solution for C
Include inputs