A. Time

Codeforces
IDCF10093A
Time2000ms
Memory64MB
Difficulty
English · Original
Formal · Original
A plane can go from city X to city Y in 1 hour and 20 minutes. However, when it returns from city Y to city X, with the same speed, it spends only 80 minutes! If you don’t know how might that happen, just remember that 1 hour and 20 minutes is the same as 80 minutes ;-) In this problem you will have 2 durations of time and you have to decide if they are equal or not. The first line will be the number of test cases T. Each test case has two lines, the first line represents the first duration and contains 3 integers: h, m, s; these are the Hours, Minutes and Seconds. The second line represent the second duration with 3 integers also, in the same way. All integers are positive and below 5000. For each test case, print one line which contains the number of the test case. Then print “Yes” if the 2 durations are equal and print “No” otherwise, see the samples and follow the output format. ## Input The first line will be the number of test cases T. Each test case has two lines, the first line represents the first duration and contains 3 integers: h, m, s; these are the Hours, Minutes and Seconds. The second line represent the second duration with 3 integers also, in the same way. All integers are positive and below 5000. ## Output For each test case, print one line which contains the number of the test case. Then print “Yes” if the 2 durations are equal and print “No” otherwise, see the samples and follow the output format. [samples]
**Definitions** Let $ T \in \mathbb{Z} $ be the number of test cases. For each test case $ k \in \{1, \dots, T\} $: - First duration: $ (h_1, m_1, s_1) \in \mathbb{Z}_{>0}^3 $ - Second duration: $ (h_2, m_2, s_2) \in \mathbb{Z}_{>0}^3 $ **Constraints** 1. $ 1 \le T \le \text{unspecified} $ 2. For all $ i \in \{1,2\} $: $ 0 < h_i, m_i, s_i < 5000 $ **Objective** For each test case $ k $, determine if the two durations are equal: $$ 3600 \cdot h_1 + 60 \cdot m_1 + s_1 = 3600 \cdot h_2 + 60 \cdot m_2 + s_2 $$ Output "Yes" if equal, "No" otherwise.
API Response (JSON)
{
  "problem": {
    "name": "A. Time",
    "description": {
      "content": "A plane can go from city X to city Y in 1 hour and 20 minutes. However, when it returns from city Y to city X, with the same speed, it spends only 80 minutes!  If you don’t know how might that happen,",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 65536
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10093A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "A plane can go from city X to city Y in 1 hour and 20 minutes. However, when it returns from city Y to city X, with the same speed, it spends only 80 minutes!  If you don’t know how might that happen,...",
      "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- First duration: $ (h_1, m_1, s_1) \\in \\mathbb{Z}_{>0}^3 $  \n- Second duratio...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments