You can put this solution on YOUR website! For the first problem, do you mean ?
If so it can be solved easily. As written it is ambiguous and other ways to interpret it would make it harder to solve.
Note that and . We could rewrite the problem as , so , leading to
---------
Second problem: