I'm trying to solve a problem that amounts to:(adsbygoogle = window.adsbygoogle || []).push({});

Given b_{0}, ..., b_{n-1}where1 <= b_{i}, find the max of |a_{0}- a_{1}| + |a_{1}- a_{2}| + ... + |a_{n-2}- a_{n-1}| where 1 <= a_{i}<= b_{i}.

I'm 100% confident that each a_{i}is either 1 or b_{i}.

I'm 90% confident that the elements a_{0}, ..., a_{n-1}are either

1, b_{0}, 1, b_{1}, ...,

or

b_{0}, 1, b_{1}, 1, ...

Are there any simple counterexamples?

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# C/++/# Counterexamples to my claim?

Tags:

Have something to add?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**