GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Sunday 19 June 2022

[Solution] Too many Floors CodeChef Solution | CodeChef Problem Solution 2022


Chef and Chefina are residing in a hotel.

There are 10 floors in the hotel and each floor consists of 10 rooms.

  • Floor 1 consists of room numbers 1 to 10.
  • Floor 2 consists of room numbers 11 to 20.
  • Floor i consists of room numbers 10(i1)+1 to 10i.
Solution Click Below:-  CLICK HERE

You know that Chef's room number is X while Chefina's Room number is Y.
If Chef starts from his room, find the number of floors he needs to travel to reach Chefina's room.

Input Format

  • First line will contain T, number of test cases. Then the test cases follow.
  • Each test case contains of a single line of input, two integers X,Y, the room numbers of Chef and Chefina respectively.

Output Format

For each test case, output the number of floors Chef needs to travel to reach Chefina's room.

Constraints

  • 1T1000
  • 1X,Y100

No comments:

Post a Comment