F. TROY Query

Codeforces
IDCF10057F
Time2000ms
Memory256MB
Difficulty
English · Original
Formal · Original
De Prezer loves TROYs. A TROY is a 1018 × 1018 square and there is either  + 1 or  - 1 in each cell of this square (actually it's a grid). There are two types of operation : 1. Multiply all numbers in a row by  - 1 . 2. Multyply all numbers in a column by  - 1 . De Prezer has found two TROYs, the number in the j - th column of the i - th row of the first TROY is ai, j and in the second TROY is bi, j . De Prezer also loves query, so he gives you some queries. First of all, you don't have any information about numbers in these two TROYs. Each query, gives the values x ,y, ax, y, bx, y (that you didn't get before), and you should tell him if it is can be possible to transform the first TROY to the second one (the values in the cells that we don't know, could be the way that we can transform the first TROY to the second one) using the operations above, with the information you got so far. The first line of input contains integer n, the number of queries. Each of the next n lines, contain 4 integers x ,y, ax, y, bx, y . 1 ≤ n ≤ 105 1 ≤ x, y ≤ 1018 and For each query, print a single string in a line, "Yes" or "No" (Without quotes). ## Input The first line of input contains integer n, the number of queries.Each of the next n lines, contain 4 integers x ,y, ax, y, bx, y .1 ≤ n ≤ 1051 ≤ x, y ≤ 1018 and ## Output For each query, print a single string in a line, "Yes" or "No" (Without quotes). [samples]
Let $ n, m \in \mathbb{Z} $ with $ 1 \leq n, m \leq 10^{100} $. The maximum number of happy customers is $ \left\lfloor \frac{n}{m} \right\rfloor $.
API Response (JSON)
{
  "problem": {
    "name": "F. TROY Query",
    "description": {
      "content": "De Prezer loves TROYs. A TROY is a 1018 × 1018 square and there is either  + 1 or  - 1 in each cell of this square (actually it's a grid). There are two types of operation :  1. Multiply all numbers",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10057F"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "De Prezer loves TROYs. A TROY is a 1018 × 1018 square and there is either  + 1 or  - 1 in each cell of this square (actually it's a grid).\n\nThere are two types of operation : \n\n1. Multiply all numbers...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "Let $ n, m \\in \\mathbb{Z} $ with $ 1 \\leq n, m \\leq 10^{100} $.  \nThe maximum number of happy customers is $ \\left\\lfloor \\frac{n}{m} \\right\\rfloor $....",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments