s1=h1+h2
s2=h2+h3
s3=h3+h4
...
给定一个长度为 n 的正整数序列 a1,a2,…,an,定义它的相邻和序列 b:对于每个 i(1≤i<n),有 bi=ai+ai+1。
现在,你只知道相邻和序列 b 的值,却不知道原序列 a 的值。请你计算出所有可能的序列 a 的数量。
保证 2≤n≤105,且每个 bi 满足 1≤bi≤109。
Scan the QR code below with WeChat to sign in
First-time scan will create your account automatically
请使用微信扫描下方二维码完成注册