umm sorry for not finishing the post properly, I'll just post enire question .
As I said, I'm pretty sure I can do this on my own, I just need a hint on the part I've posted above.
If anyone interested it's from math test to get schoolarship to study natural sciences or math in Japan.