Skip to main content
Back to problems
Codeforces
Medium
Greedy
Math
Number Theory
TL

Given several time values, determine whether a valid configuration exists according to the problem's rules.

Acceptance 0%
Problem Statement

You are given a set of time-like values. Your task is to determine whether they can be arranged or transformed to satisfy the condition described by the problem.

The core challenge is to reason about the values carefully, often using ordering, greedy selection, and arithmetic constraints rather than brute force.

Because the original statement is unavailable here, this practice version focuses on the same general style: analyze the input, apply the required validity checks, and print the appropriate result.

Input Format

  • The first line contains an integer nn.
  • The next line contains nn integers describing the given values.

The exact interpretation of the values follows the problem's validity rules.

Output Format

  • Print the required answer for the given instance.
  • The answer is typically a single value such as YES/NO or the resulting transformed value, depending on whether the configuration is valid.

Constraints

  • 1n1 \le n
  • Values fit in standard 32-bit signed integers.
  • Use a solution that is efficient enough for a medium-difficulty contest problem.
Examples
Sample cases returned by the problem API.

Example 1

Input

4
1 2 3 4

Output

YES

Explanation

This illustrative example shows a simple feasible case after applying the required checks.

Premium problem context

Unlock deeper context for this problem

Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.

Guided hints
Editorial and discussion links
Concept map and variants
Sign in to unlock
Track your progress
Sign in to bookmark this problem, save notes, and manage its revision plan.