speed up development the game has n quick travel towers. I-th tower is situated at area (xai,yai). To have the option to quickly venture out to the pinnacle from any area in the game world it should initially be actuated. Initiation of pinnacle I occurs right when the player is in cell (xai,yai) after this the pinnacle stays dynamic all through the whole game. William additionally realizes that the game has m missions. I-th
Correct answer will be upvoted else downvoted.
speed up development the game has n quick travel towers. I-th tower is situated at area (xai,yai). To have the option to quickly venture out to the pinnacle from any area in the game world it should initially be actuated. Initiation of pinnacle I occurs right when the player is in cell (xai,yai) after this the pinnacle stays dynamic all through the whole game.
William additionally realizes that the game has m missions. I-th journey can be finished immediately by being at area (xbi,ybi) on turn ti.
William needs to discover the maximal number of missions he will actually want to finish by ideally navigating the game world.
Input :The main line contains two integers n and m (0≤n≤14,1≤m≤100), which are the number of pinnacles and the number of journeys, individually.
Every one of the following n lines contains two integers xai,yai (1≤xai,yai≤106), which are the directions of quick travel towers.
Every one of the following m lines contains two integers xbi, ybi and ti (1≤xbi,ybi≤106, 1≤ti≤109), which are the directions of journeys and the turn at which it very well might be finished.
It is ensured that all areas in a test are unique.
Output :Print a solitary number — the maximal number of journeys William will actually want to finish.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images