problem1 in go
problem2 in go