Paco had w cookies. He gave x cookies to his friend and ate y cookies. How many more cookies did he eat than those he gave to his friend?
Let's say that Paco has w cookies, he gave x cookies to his friend and ate y cookies. Thus, the number of cookies that were left after he gave some to his friend and ate some himself is w - x - y. 

The task is to find out how many more cookiesPacowas left with than his friend. In other words, we need to find out how many more cookies there are in w - x - y than in x. 

This is the same as asking how many more cookies there are in w - y than in x. In other words, we need to solve the equation w - y - x = 0. 

We can do this by solving for w. w = x + y.