#P4867. Maximum Value
Maximum Value
Maximum Value
题面翻译
- 给定一个序列 ,请找出两个数 ,使得 ,并且使得 的值最大,求这个 的最大值。
- 对于 的数据,,。
- Translated by 一只书虫仔 & QwQcOrz。
题目描述
You are given a sequence consisting of integers. Find the maximum possible value of (integer remainder of divided by ), where and .
输入格式
You are given a sequence consisting of integers. Find the maximum possible value of (integer remainder of divided by ), where and .
输出格式
Print the answer to the problem.
样例 #1
样例输入 #1
3
3 4 5
样例输出 #1
2