H. Robocon Club

Codeforces
IDCF10106H
Time2000ms
Memory64MB
Difficulty
English · Original
Formal · Original
Ahmed thought that robotics is fun so he quit ACM and joined Robocon club ! Unfortunately his first task at the Robocon Club did not go as well as he expected. He was supposed to build a robot that moves in a straight line. The robot he had built consists of a line segment of length L with a wheel of radius R on each of it's endpoints. He placed the robot on the x axis, such that the center of the robot was the point (0, 0) , facing the positive y axis (the left and right wheels are located on and respectively). The two wheels started moving at the same time, however, instead of moving at the same speed, the left wheel rotated at VL revolutions per second(RPS), while the right wheel rotated at VR RPS. both wheels stopped moving after S seconds. Can you help Ahmed locate the center of his robot? The first line of the input consists of a single integer T , the number of test cases. T lines follow , each describing a test case consisting of five integers L , R , VL , VR , S . indicating the length of the robot , the radius of each wheel , the speed of the left wheel in (RPS), the speed of the right wheel in (RPS) and the duration that the robot had moved , respectively . where (1 ≤ L ≤ 100 ,1 ≤ R ≤ 100 ,0 ≤ VL ≤ 100 ,0 ≤ VR ≤ 100 , 1 ≤ S ≤ 100 ) . for each test case print two real numbers on a line separated by a space denotes the coordinates of the center of the robot rounded to three decimal places . ## Input The first line of the input consists of a single integer T , the number of test cases. T lines follow , each describing a test case consisting of five integers L , R , VL , VR , S . indicating the length of the robot , the radius of each wheel , the speed of the left wheel in (RPS), the speed of the right wheel in (RPS) and the duration that the robot had moved , respectively . where (1 ≤ L ≤ 100 ,1 ≤ R ≤ 100 ,0 ≤ VL ≤ 100 ,0 ≤ VR ≤ 100 , 1 ≤ S ≤ 100 ) . ## Output for each test case print two real numbers on a line separated by a space denotes the coordinates of the center of the robot rounded to three decimal places . [samples]
**Definitions** Let $ N, M \in \mathbb{Z}^+ $ denote the number of songs for Taylor Swift and Katy Perry, respectively. Let $ A = (a_1, \dots, a_N) \in (\mathbb{Z}^+)^N $ be the sequence of song qualities for Taylor. Let $ B = (b_1, \dots, b_M) \in (\mathbb{Z}^+)^M $ be the sequence of song qualities for Katy. The **Glauber mean** of a non-empty multiset $ S = \{x_1, \dots, x_k\} \subseteq \mathbb{Z}^+ $ is defined as: $$ \text{GlauberMean}(S) = \frac{\prod_{x \in S} x}{|S|} $$ **Constraints** 1. $ 1 \le N, M \le 50 $ 2. $ 1 \le a_i, b_j \le 100 $ for all $ i, j $ **Objective** Determine whether there exist non-empty subsets $ A' \subseteq A $, $ B' \subseteq B $ such that: $$ \frac{\prod_{x \in A'} x}{|A'|} = \frac{\prod_{y \in B'} y}{|B'|} $$ If such subsets exist: - Output "Y", followed by $ |A'| $, $ |B'| $, then the elements of $ A' $ and $ B' $. - Otherwise, output "N".
API Response (JSON)
{
  "problem": {
    "name": "H. Robocon Club",
    "description": {
      "content": "Ahmed thought that robotics is fun so he quit ACM and joined Robocon club ! Unfortunately his first task at the Robocon Club did not go as well as he expected. He was supposed to build a robot that mo",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 65536
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10106H"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Ahmed thought that robotics is fun so he quit ACM and joined Robocon club ! Unfortunately his first task at the Robocon Club did not go as well as he expected. He was supposed to build a robot that mo...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ N, M \\in \\mathbb{Z}^+ $ denote the number of songs for Taylor Swift and Katy Perry, respectively.  \nLet $ A = (a_1, \\dots, a_N) \\in (\\mathbb{Z}^+)^N $ be the sequence of song q...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments