Skip to main content
Back to problems
Codeforces
Medium
Matrices
Greedy
Arrays
Grid L

Construct or analyze an L-shaped pattern on a grid using simple grid logic.

Acceptance 0%
Also Available On
Other platform versions and source mappings for the same problem.
Problem Statement

You are given a rectangular grid. The task is to determine or construct an arrangement that forms an L shape according to the problem’s rules, using grid cells as the basic unit.

Typically, problems of this style ask you to reason about positions on a matrix, mark cells that belong to the shape, and ensure the shape satisfies constraints such as size, placement, or coverage.

Your solution should use straightforward grid reasoning and careful handling of boundaries.

Input Format

  • The input describes a grid-related instance.
  • Read the dimensions and the parameters needed to define the L shape.
  • Interpret the remaining values according to the grid specification.

Output Format

  • Output the required result for the grid problem.
  • This is usually either a count, a valid construction, or a yes/no style answer.

Constraints

  • Use only the information provided by the input.
  • Handle boundary conditions carefully.
  • A linear or near-linear scan over the grid is usually sufficient.
Examples
Sample cases returned by the problem API.

Example 1

Input

3 3
1 1

Output

Yes

Explanation

A tiny illustrative example: the specified location can be treated as a valid corner for an L-shaped arrangement under simple grid rules.

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.