303046: CF593C. Beautiful Function

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Beautiful Function

题意翻译

题目描述 给出$n$个圆,构造两个合法的函数$f(t),g(t)$,设点集$S$是整数$t\in[0,50]$时$(f(t),g(t))$构成的点的集合,你需要保证对于每一个圆,至少存在一个点(包括边界)在点集$S$中。 令$w(t)$与$h(t)$为两个合法的函数,那么合法的函数由以下几种函数复合而成: ①$s(t) = abs(w(t))$,其中$abs()$表示取绝对值 ②$s(t) = (w(t) + h(t))$ ③$s(t) = (w(t) - h(t))$ ④$s(t) = (w(t) \times h(t))$ ⑤$s(t) = C$(C为整数) ⑥$s(t) = t$ 在$f(t)$与$g(t)$中,只能至多出现$50$次函数相乘的操作,函数长度不能超过$100n$,**输出时不能出现空格**,并且当整数$t \in [0,50]$时,$-10^9 \leq f(t),g(t) \leq 10^9$ 输入格式: 第一行一个整数$n(1 \leq n \leq 50)$表示圆的数量 接下来$n$行每行三个整数$x,y,r(0 \leq x , y \leq 50 , 2 \leq r \leq 50)$描述一个圆的坐标与半径。 输出格式: 两行,第一行为$f(x)$,第二行为$g(x)$

题目描述

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 $ (x_{t}=f(t),y_{t}=g(t)) $ , where argument $ t $ takes all integer values from $ 0 $ to $ 50 $ . Moreover, $ f(t) $ and $ g(t) $ should be correct functions. Assume that $ w(t) $ and $ h(t) $ are some correct functions, and $ c $ is an integer ranging from $ 0 $ to $ 50 $ . The function $ s(t) $ is correct if it's obtained by one of the following rules: 1. $ s(t)=abs(w(t)) $ , where $ abs(x) $ means taking the absolute value of a number $ x $ , i.e. $ |x| $ ; 2. $ s(t)=(w(t)+h(t)) $ ; 3. $ s(t)=(w(t)-h(t)) $ ; 4. $ s(t)=(w(t)*h(t)) $ , where $ * $ means multiplication, i.e. $ (w(t)·h(t)) $ ; 5. $ s(t)=c $ ; 6. $ s(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) $ and $ g(t) $ for any set of at most $ 50 $ circles. In each of the functions $ f(t) $ and $ g(t) $ you are allowed to use no more than $ 50 $ multiplications. The length of any function should not exceed $ 100·n $ characters. The function should not contain spaces. Ruslan can't keep big numbers in his memory, so you should choose $ f(t) $ and $ g(t) $ , such that for all integer $ t $ from $ 0 $ to $ 50 $ value of $ f(t) $ and $ g(t) $ and all the intermediate calculations won't exceed $ 10^{9} $ by their absolute value.

输入输出格式

输入格式


The first line of the input contains number $ n $ ( $ 1<=n<=50 $ ) — the number of circles Ruslan thinks of. Next follow $ n $ lines, each of them containing three integers $ x_{i} $ , $ y_{i} $ and $ r_{i} $ ( $ 0<=x_{i},y_{i}<=50 $ , $ 2<=r_{i}<=50 $ ) — the coordinates of the center and the raduis of the $ i $ -th circle.

输出格式


In the first line print a correct function $ f(t) $ . In the second line print a correct function $ g(t) $ . The set of the points $ (x_{t}=f(t),y_{t}=g(t)) $ ( $ 0<=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. $ 10 $ 2. ( $ 1 $ + $ 2 $ ) 3. (( $ t $ - $ 3 $ )+( $ t $ \* $ 4 $ )) 4. $ abs((t $ - $ 10)) $ 5. $ (abs((((23 $ - $ t $ )\*( $ t $ \* $ t $ ))+(( $ 45 $ + $ 12 $ )\*( $ t $ \* $ t)))) $ \* $ ((5 $ \* $ t $ )+(( $ 12 $ \* $ t $ )- $ 13))) $ 6. $ abs((t $ -( $ abs((t $ \* $ 31 $ ))+ $ 14)))) $ Incorrect functions: 1. $ 3 $ + $ 5 $ + $ 7 $ (not enough brackets, it should be (( $ 3 $ + $ 5 $ )+ $ 7 $ ) or ( $ 3 $ +( $ 5 $ + $ 7 $ ))) 2. $ abs(t $ - $ 3) $ (not enough brackets, it should be $ abs((t $ - $ 3)) $ 3. $ 2 $ + $ (2 $ - $ 3 $ (one bracket too many) 4. $ 1 $ ( $ t $ + $ 5 $ ) (no arithmetic operation between 1 and the bracket) 5. $ 5000 $ \* $ 5000 $ (the number exceeds the maximum) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF593C/e80d91c4b1d24e07611a960f814301ef4e0c4fc3.png) The picture shows one of the possible solutions

Input

题意翻译

题目描述 给出$n$个圆,构造两个合法的函数$f(t),g(t)$,设点集$S$是整数$t\in[0,50]$时$(f(t),g(t))$构成的点的集合,你需要保证对于每一个圆,至少存在一个点(包括边界)在点集$S$中。 令$w(t)$与$h(t)$为两个合法的函数,那么合法的函数由以下几种函数复合而成: ①$s(t) = abs(w(t))$,其中$abs()$表示取绝对值 ②$s(t) = (w(t) + h(t))$ ③$s(t) = (w(t) - h(t))$ ④$s(t) = (w(t) \times h(t))$ ⑤$s(t) = C$(C为整数) ⑥$s(t) = t$ 在$f(t)$与$g(t)$中,只能至多出现$50$次函数相乘的操作,函数长度不能超过$100n$,**输出时不能出现空格**,并且当整数$t \in [0,50]$时,$-10^9 \leq f(t),g(t) \leq 10^9$ 输入格式: 第一行一个整数$n(1 \leq n \leq 50)$表示圆的数量 接下来$n$行每行三个整数$x,y,r(0 \leq x , y \leq 50 , 2 \leq r \leq 50)$描述一个圆的坐标与半径。 输出格式: 两行,第一行为$f(x)$,第二行为$g(x)$

加入题单

上一题 下一题 算法标签: