Problem: You are given a chessboard of size . It is filled with numbers from to in the following way: the first numbers from to are written in the cells with even sum of coordinates from left to right from top to bottom. The rest numbers from to are written in the cells with odd sum of coordinates from left to right from top to bottom. The operation means division by rounded up.
For example, the left board on the following picture is the chessboard which is given for and the right board is the chessboard which is given for .
You are given queries. The -th query is described as a pair . The answer to the -th query is the number written in the cell ( is the row, is the column). Rows and columns are numbered from to .
Input Format: The first line contains two integers and (, ) — the size of the board and the number of queries.
The next lines contain two integers each. The -th line contains two integers () — description of the -th query.
Output Format: For each query from to print the answer to this query. The answer to the -th query is the number written in the cell ( is the row, is the column). Rows and columns are numbered from to . Queries are numbered from to in order of the input.
Note: Answers to the queries from examples are on the board in the picture from the problem statement.