分类
外汇交易 外汇基本面

双线macd指标参数最佳设置

身份认证 购VIP最低享 7 折!

双线macd指标参数最佳设置

Dark is going to attend Motarack’s birthday. Dark decided that the gift he is going to give to Motarack is an array a of n 双线macd指标参数最佳设置 non-negative integers.

Dark created that array 1000 years ago, so some elements in that array disappeared. Dark knows that Motarack hates to see an array that has two adjacent elements with a high absolute difference between them. He doesn’t have much time so he wants to choose an integer k (0≤k≤109) and replaces all missing elements in the array a 双线macd指标参数最佳设置 with k.

Let m be the maximum absolute difference between 双线macd指标参数最佳设置 all adjacent elements (i.e. the maximum value of |ai−ai+1| for all 1≤i≤n−1) in the array a after Dark replaces all missing elements with k.

Dark should choose an integer k so that m is minimized. Can you help him?

Input
The input consists of multiple test cases. The first line contains a single integer t (1≤t≤104) — the number of test cases. The description of the test cases follows.

The first line of each test case contains one integer 双线macd指标参数最佳设置 n (2≤n≤105) — the size of the array a.

The second line of each test case contains n integers a1,a2,…,an (−1≤ai≤109). If ai=−1, then the i-th integer is missing. It is guaranteed that at least one integer 双线macd指标参数最佳设置 is missing in every test case.

It is guaranteed, that the sum of n for all test cases does not exceed 4⋅105.

Output
Print the answers for each test case in the following format:

You should print two integers, the minimum possible value of m and an integer k (0≤k≤109) that makes the maximum absolute difference between adjacent elements in the array a equal to m.

Make sure that after replacing all the missing elements with k, the maximum absolute difference between adjacent elements becomes m.

If there is more than one possible k, you can print any of them.双线macd指标参数最佳设置

Example

inputCopy
7
5
-1 10 -1 12 -1
5
-1 40 35 -1 35
6
-1 -1 9 -1 3 -1
2
-1 -1
2
0 -1
4
1 -1 3 -1
7
1 -1 7 5 2 -1 5
outputCopy
1 11
5 35
3 6
0 42
0 0
1 2
3 4
Note
In the first test case after replacing all missing elements with 11 the array becomes [11,10,11,12,11]. The absolute difference between any adjacent elements is 1. It is impossible to choose a value of k, such that the absolute difference between any adjacent element will be ≤0. So, the answer is 1.

In the third test case after replacing all missing elements with 6 the array becomes [6,6,9,6,3,双线macd指标参数最佳设置 6].

|a1−a2|=|6−6|=0;
|a2−a3|=|6−9|=3;
|a3−a4|=|9−6|=3;
|a4−a5|=|6−3|=3;
|a5−a6|=|3−6|=3.
So, the maximum difference between any adjacent elements is 3.

题意:
给你n个数,有些位置得数会丢少,那么该位置就为-1 .问你在丢少的位置上填什么数,可以使得相邻数差得绝对值最小。填完数之后再问你1~n差值最大是多少。

解析:
有三种情况
第一种 : 8,-1,-1,-1
第二种:-1,-1,-1,-1;
第三种 :8,-1,9

双CCI交易系统,用于Mt4平台

身份认证 购VIP最低享 7 折!

CCIarrow.mq4 MT4顺势指标

CDP_短线_MT4指标_

MT4各种指标程序代码

5星 · 资源好评率100%

MT4-KDJ指标及用法

MT4我一共分享给大家5个自用的指标以及模板《1》

3星 · 编辑精心推荐

百分九十胜率自动提示买卖点MT4指标系统.rar

MT4 CCI on MA

MT4指标:多空提示指标

5星 · 资源好评率100%

cci指标的用法

mt4指标之RSI.箭头mq4指标源码

CCI_EA_CCi指标_cci_ea_MT4EA_源码

MT4压力位 反转信号

3星 · 编辑精心推荐

cci交易系统

CCI Zero外汇交易系统,外汇交易中心系统,C,C++

CCI_MA. 智能交易使用不同寻常的 CCI 和 MA - MetaTrader 4EA.zip

3星 · 编辑精心推荐

MT4-EA编写实例分析_ea编写实例_外汇EA实例_MT4EA_mt4ea源码_

5星 · 资源好评率100%

FF-Capital-and-Analysis/OnceTrader2018-MACD

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Use Git or checkout with SVN using the web URL.

Work fast with our official CLI. Learn more.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.双线macd指标参数最佳设置

Latest commit

Git stats

Files

Failed to load latest commit information.

About

Stars

Watchers

Forks

Releases 双线macd指标参数最佳设置

Packages 0

Footer

© 2022 GitHub, Inc.

You can’t perform 双线macd指标参数最佳设置 that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Problem L.Videos

C-bacteria takes charge of two kinds of videos: ’The Collection of Silly Games’ and ’The Collection of Horrible Games’.
For simplicity’s sake, they will be called as videoA and videoB.
There are some people who want to watch videos during today, and they will be happy after watching videos of C-bacteria.
There are n hours a day, m videos are going to be show, and the number of people is K.
Every video has a type(videoA or videoB), a running time, and the degree of happi- ness after someone watching whole of it.
People can watch videos continuous(If one video is running on 2pm to 3pm and another is 3pm to 5pm, people can watch both of them).
But each video only allows one person for 双线macd指标参数最佳设置 watching.
For a single person, it’s better to watch two kinds to videos alternately, or he will lose W happiness.
For example, if the order of video is ’videoA, videoB, videoA, videoB, …’ or ’B, A, B, A, B, …’, 双线macd指标参数最佳设置 he won’t lose happiness; But if the order of video is ’A, B, B, B, A, B, A, A’, he 双线macd指标参数最佳设置 will lose 3W happiness.
Now you have to help people 双线macd指标参数最佳设置 双线macd指标参数最佳设置 to maximization the sum of the degree of happiness.

Multiple query.
On the first line, there is a positive integer 双线macd指标参数最佳设置 T, which describe the number of data. Next there are T groups of data.
for each group, the first line have four positive integers n, m, K, W : n hours a day, m videos, K people, lose W happiness when watching same videos).
and then, the next m line will describe m videos, four positive integers each line S, T, 双线macd指标参数最佳设置 w, op : video is the begin at S and end 双线macd指标参数最佳设置 双线macd指标参数最佳设置 at T, the happiness that people can get is w, and op describe it’s tpye(op=0 for videoA and op=1 for videoB).
There is a blank line before each groups 双线macd指标参数最佳设置 of data.
Top=0 or op=1

Your output should include T lines, for each line, output the maximum happiness for the corresponding datum.