A. A Very Hard Question

Codeforces
IDCF10150A
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Husam was preparing himself for the Graduate Record Examinations (GRE). Yesterday, he read a very hard question, but he could not find a solution for it, so he did not sleep all the night. Husam decided to tell you about the question, so you can help him to find the solution. The question is: _If the price of the orange was increased by x%. How many oranges can be bought for the amount that used to buy y oranges?_ Can you help Husam to solve this question? The first line contains an integer T (1  ≤  T  ≤  104), where T is the number of test cases. Then T lines follow, each line contains two integers y and x (1  ≤  y  ≤  106) (0  ≤  x  ≤  100), where y is the number of oranges, and x is the percentage increase in price. For each test case, print a single line containing the number of oranges that can be bought for the same amount of money that used to buy y oranges before the price increased. *It is guaranteed that all answers are integer numbers. Do not print any floating-point values.* ## Input The first line contains an integer T (1  ≤  T  ≤  104), where T is the number of test cases.Then T lines follow, each line contains two integers y and x (1  ≤  y  ≤  106) (0  ≤  x  ≤  100), where y is the number of oranges, and x is the percentage increase in price. ## Output For each test case, print a single line containing the number of oranges that can be bought for the same amount of money that used to buy y oranges before the price increased.*It is guaranteed that all answers are integer numbers. Do not print any floating-point values.* [samples]
**Definitions** Let $ T \in \mathbb{Z} $ be the number of test cases. For each test case $ k \in \{1, \dots, T\} $: - Let $ y_k \in \mathbb{Z}^+ $ be the original number of oranges. - Let $ x_k \in \mathbb{Z} $ be the percentage price increase, $ 0 \leq x_k \leq 100 $. **Constraints** 1. $ 1 \leq T \leq 10^4 $ 2. For each $ k $: - $ 1 \leq y_k \leq 10^6 $ - $ 0 \leq x_k \leq 100 $ **Objective** For each test case $ k $, compute the number of oranges that can be bought after the price increase, given the same total expenditure: $$ \text{Answer}_k = \left\lfloor \frac{y_k}{1 + \frac{x_k}{100}} \right\rfloor $$ *It is guaranteed that the result is an integer.*
API Response (JSON)
{
  "problem": {
    "name": "A. A Very Hard Question",
    "description": {
      "content": "Husam was preparing himself for the Graduate Record Examinations (GRE). Yesterday, he read a very hard question, but he could not find a solution for it, so he did not sleep all the night. Husam deci",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10150A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Husam was preparing himself for the Graduate Record Examinations (GRE). Yesterday, he read a very hard question, but he could not find a solution for it, so he did not sleep all the night.\n\nHusam deci...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, T\\} $:  \n- Let $ y_k \\in \\mathbb{Z}^+ $ be the original number of oranges.  \n- Let $ x_...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments