I've started programming a few months ago, i've done basic before, then i tried pascal for a while but now i'm comfortable with C++. The problem is, i'm trying to learn as much as i can from the net and books, but i can't find a good book i could actually learn how to make complicated algorithms required by the problems found on coding competitions (by that i mean stuff like "mark has a garden that is triangle-shaped, the coordinates of the points are given in the input, also the coordinates of the trees. if one tree is closer than n meters to the other it must be removed, print the coordinates of the trees to be removed" and stuff like that (i made this one up)). Are there any books on such problems and solving them? cause i'm kinda not into studying c++ primer-like books cause i need the logical stuff more.