In the opening ceremony of the 2014 FIFA World Cup Brazil, all football teams who participates gathered together. The team captain of each team was handshaking with one another to promote their new act for world peace which was called "A Handshake for Peace!". Each team captain is as polite as the other. How many teams are there if there were a total of 595 handshakes?
Let's say there are x teams.
Each team captain shakes hands x-1 times (everyone except themselves). There are x team captains so there are x(x-1) handshakes. However, we have to divide by two because for one handshake, we counted twice- once for each person shaking hands. So in all, there are x(x-1)/2 handshakes.
This equals 595 so x(x-1)/2=595
Prime factorizing 595*2 = 2*5*7*17*= 34*35
So we can factorize as (x-35)(x+34)=0
We get two solutions, 35 & -34. Since the number must be positive, the answer is 35.