CF593C.Beautiful Function

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Every day Ruslan tried to count sheep to fall asleep, but this didn't help. Now he has found a more interesting thing to do. First, he thinks of some set of circles on a plane, and then tries to choose a beautiful set of points, such that there is at least one point from the set inside or on the border of each of the imagined circles.

Yesterday Ruslan tried to solve this problem for the case when the set of points is considered beautiful if it is given as (xt=f(t),yt=g(t))(x_{t}=f(t),y_{t}=g(t)) , where argument tt takes all integer values from 00 to 5050 . Moreover, f(t)f(t) and g(t)g(t) should be correct functions.

Assume that w(t)w(t) and h(t)h(t) are some correct functions, and cc is an integer ranging from 00 to 5050 . The function s(t)s(t) is correct if it's obtained by one of the following rules:

  1. s(t)=abs(w(t))s(t)=abs(w(t)) , where abs(x)abs(x) means taking the absolute value of a number xx , i.e. x|x| ;
  2. s(t)=(w(t)+h(t))s(t)=(w(t)+h(t)) ;
  3. s(t)=(w(t)h(t))s(t)=(w(t)-h(t)) ;
  4. s(t)=(w(t)h(t))s(t)=(w(t)*h(t)) , where * means multiplication, i.e. (w(t)h(t))(w(t)·h(t)) ;
  5. s(t)=cs(t)=c ;
  6. s(t)=ts(t)=t ;

Yesterday Ruslan thought on and on, but he could not cope with the task. Now he asks you to write a program that computes the appropriate f(t)f(t) and g(t)g(t) for any set of at most 5050 circles.

In each of the functions f(t)f(t) and g(t)g(t) you are allowed to use no more than 5050 multiplications. The length of any function should not exceed 100n100·n characters. The function should not contain spaces.

Ruslan can't keep big numbers in his memory, so you should choose f(t)f(t) and g(t)g(t) , such that for all integer tt from 00 to 5050 value of f(t)f(t) and g(t)g(t) and all the intermediate calculations won't exceed 10910^{9} by their absolute value.

输入格式

The first line of the input contains number nn ( 1<=n<=501<=n<=50 ) — the number of circles Ruslan thinks of. Next follow nn lines, each of them containing three integers xix_{i} , yiy_{i} and rir_{i} ( 0<=xi,yi<=500<=x_{i},y_{i}<=50 , 2<=ri<=502<=r_{i}<=50 ) — the coordinates of the center and the raduis of the ii -th circle.

输出格式

In the first line print a correct function f(t)f(t) . In the second line print a correct function g(t)g(t) . The set of the points (xt=f(t),yt=g(t))(x_{t}=f(t),y_{t}=g(t)) ( 0<=t<=500<=t<=50 ) must satisfy the condition, that there is at least one point inside or on the border of each of the circles, Ruslan thinks of at the beginning.

输入输出样例

  • 输入#1

    3
    0 10 4
    10 0 4
    20 10 4
    

    输出#1

    t 
    abs((t-10))

说明/提示

Correct functions:

  1. 1010
  2. ( 11 + 22 )
  3. (( tt - 33 )+( tt * 44 ))
  4. abs((tabs((t - 10))10))
  5. (abs((((23(abs((((23 - tt )*( tt * tt ))+(( 4545 + 1212 )*( tt * t))))t)))) * ((5((5 * tt )+(( 1212 * tt )- 13)))13)))
  6. abs((tabs((t -( abs((tabs((t * 3131 ))+ 14))))14))))

Incorrect functions:

  1. 33 + 55 + 77 (not enough brackets, it should be (( 33 + 55 )+ 77 ) or ( 33 +( 55 + 77 )))
  2. abs(tabs(t - 3)3) (not enough brackets, it should be abs((tabs((t - 3))3))
  3. 22 + (2(2 - 33 (one bracket too many)
  4. 11 ( tt + 55 ) (no arithmetic operation between 1 and the bracket)
  5. 50005000 * 50005000 (the number exceeds the maximum)

The picture shows one of the possible solutions

首页