Given two numbers N and X, you need to write a program that will output the smallest value of (X*K) which is closest to N. Where K is any positive number greater than zero.

**Input:**

The first line of input contains a single integer T which denotes the number of test cases. Then T test cases follows. The only line of each test case contains two space separated integers N and X.

**Output:**

For each test print the closest value of (X*K) in a new line, where is any positive number greater than zero.

Note: If there are two closest elements then print the bigger one.

**Constraints:**

1<=T<=100

1<=X<=1000

1<=N<=1000

**Example:**

**Input:**

2

9 2

2855 13

**Output:**

10

2860

Author: harsh.agarwal0

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

makeitdonesolo | 64 |

ShubhamJain18 | 64 |

Bishnu Dev Panda | 54 |

DanishBansal | 50 |

abhithakur588 | 50 |

Bishnu Dev Panda | 777 |

yk12 | 512 |

okayboss | 490 |

DevMittal | 472 |

VijethaShastri | 431 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4925 |

Quandray | 4547 |

Login to report an issue on this page.