AlgorithmOJ
Problem
Local Problems
All Problems
Problem Category
Status
Contest
Standard Contests
Replay Contests
Virtual Contests
Ranklist
More...
News
About
F.A.Q
Recent Contests
Coming Soon...
Login
Register
2026-11-23 21:21:37
A1 = ?
Time Limit:
1000ms
Memory Limit:
32768KB
This problem will be judged on
HDU
. Original ID:
2086
64-bit integer IO format:
%I64d
Java class name:
Main
Prev
Submit
Status
Statistics
Next
Font Size:
Description
有如下方程:A
i
= (A
i-1
+ A
i+1
)/2 - C
i
(i = 1, 2, 3, .... n).
若给出A
0
, A
n+1
, 和 C
1
, C
2
, .....C
n
.
请编程计算A
1
= ?
Input
输入包括多个测试实例。
对于每个实例,首先是一个正整数n,(n <= 3000); 然后是2个数a
0
, a
n+1
.接下来的n行每行有一个数c
i
(i = 1, ....n);输入以文件结束符结束。
Output
对于每个测试实例,用一行输出所求得的a1(保留2位小数).
Sample Input
1 50.00 25.00 10.00 2 50.00 25.00 10.00 20.00
Sample Output
27.50 15.00
Source
2006/1/15 ACM程序设计期末考试
Language:
C++
C++11
C++14
C
Java
Pascal
Python2
Python3
C#
Fortran
Perl
Ruby
Ada
SML
Visual C++
Visual C
CLang
CLang++
Theme:
Monokai
Solarized Light
Material
Share Code?
Yes
No
×
Login
Username:
Password:
Cookie:
Never
One Day
One Week
One Month
One Year
×
Register
Username:
Password:
Repeat Password:
Nickname:
School:
Email:
×
News Title
by