#C4236. Opposite House Number
Opposite House Number
Opposite House Number
In this problem, you are given an integer ( n ) representing the number of houses on each side of a street. The houses on the left side are numbered sequentially from 1 to ( n ), and the houses on the right side are numbered in reverse order, from ( n ) down to 1. Given a house number ( k ) on the left side, your task is to determine the house number directly facing it on the right. The relationship between ( k ) and its opposite house is given by the formula: ( n - k + 1 ).
This problem is a simple exercise in arithmetic and is designed to test basic competitive programming I/O and computational skills.
inputFormat
The input begins with an integer ( t ) denoting the number of test cases. Each of the following ( t ) lines contains two space-separated integers ( n ) and ( k ), where ( n ) is the number of houses on each side and ( k ) is a particular house number on the left side.
outputFormat
For each test case, output the house number on the right side that faces the house numbered ( k ). Each result should be printed on its own line.## sample
3
3 1
3 2
5 4
3
2
2
</p>