Itsmdshahin's blog

By Itsmdshahin, history, 6 months ago, In English

Hello everyone :) I need help to find out the following problem named Subway Ride. Here is the statement

Subway Surfers is an endless runner video game. The game starts by tapping the touchscreen, while Jake (the game's starter character) or any other character sprays graffiti on a subway, and then gets caught in the act by the inspector and his dog, who starts chasing the character.

In Subway Ride, a simplified version of Subway Surfers, the gaming character Jake will win if he can pass N meters of the subway (an endless road with lots of obstacles). Jake can use M kinds of hoverboard in the game. By using the i-th hoverboard Jake can pass Xi meters, at the cost of Yi coins.

Find the minimum total points Jake needs to cost for passing N meters or more of the subway.

Constraints:

1 <= N <= 10^4

1 <= M <= 10^3

1 <= X,Y <= 10^4

Input The first line contains two integer N and M. Each of the following M lines will have two integers X and Y for i-th hoverboard.

Output Print the minimum total points Jake needs to cost for wining the game.

Samples Input 9 3 8 3 4 2 2 1 Output 4

Thank you :)

Read more »

 
 
 
 
  • Vote: I like it
  • -10
  • Vote: I do not like it

By Itsmdshahin, history, 6 months ago, In English

Just practice it. Solve problems & solve problems & solve some more problems.

Intro

visit my another blog :

  1. https://codeforces.com/blog/entry/97366

How to practice a particular topic?

What should I learn next?

What platform should I use?

How to train for a particular competition (IOI, ICPC, GCJ, etc.)?

Thank you so much for reading my blog :)

Read more »

 
 
 
 
  • Vote: I like it
  • -23
  • Vote: I do not like it

By Itsmdshahin, history, 6 months ago, In English
 
 
 
 
  • Vote: I like it
  • -5
  • Vote: I do not like it