brain

tamnd's digital brain — notes, problems, research

43815 notes

Kvant Math Problem 907

Let $A=\widehat A$, $B=\widehat B$, $C=\widehat C$.

kvantmathematicsolympiad
Kvant Math Problem 905

Consider the equation

kvantmathematicsolympiad
Kvant Math Problem 903

A plane section of a convex polyhedron changes combinatorially only when the plane passes through a vertex.

kvantmathematicsolympiad
Kvant Math Problem 901

Consider triangle $ABC$ with bisectors $AK$ and $BM$ intersecting at $O$.

kvantmathematicsolympiad
Kvant Math Problem 898

Consider the given odd natural numbers $a<b<c<d$ satisfying $ad=bc$, $a+d=2^k$, and $b+c=2^m$.

kvantmathematicsolympiad
Kvant Math Problem 896

The condition that the circle with diameter $AB$ is tangent to the line $CD$ has a simple metric interpretation.

kvantmathematicsolympiad
Kvant Math Problem 893

The complete graph on $n$ vertices is $K_n$.

kvantmathematicsolympiad
Kvant Math Problem 892

Write

kvantmathematicsolympiad
Kvant Math Problem 890

The problem concerns connecting 51 cities in a square-shaped country of side 1000 km with 11,000 km of highways.

kvantmathematicsolympiad
Kvant Math Problem 887

Consider a circle $\Gamma_1$ with tangents $CA$ and $CB$ meeting at $C$, so $A$ and $B$ are points of tangency.

kvantmathematicsolympiad
Kvant Math Problem 886

Label the cells on the boundary of the $n\times n$ square cyclically by

kvantmathematicsolympiad
Kvant Math Problem 883

Working

kvantmathematicsolympiad
Kvant Math Problem 880

The sequence begins as $1, 0, 1, 0, 1, 0$ and each subsequent term is defined as the last digit of the sum of the preceding six terms.

kvantmathematicsolympiad
Kvant Math Problem 878

Consider a pyramid with apex $A$ and base $B_1B_2\dots B_n$.

kvantmathematicsolympiad
Kvant Math Problem 877

Consider a smaller version of the problem first.

kvantmathematicsolympiad
Kvant Math Problem 874

We begin by testing small integer values to see whether the equation $(5+3\sqrt{2})^m = (3+5\sqrt{2})^n$ admits any obvious solutions.

kvantmathematicsolympiad
Kvant Math Problem 872

Let $O_1,O_2,O_3$ be the centers of the circles $C_1,C_2,C_3$.

kvantmathematicsolympiad
Kvant Math Problem 870

Let the occupied rooms be represented by the multiset of integer positions of all pianists.

kvantmathematicsolympiad
Kvant Math Problem 867

Let the boys' heights be $b_1,\dots,b_{17}$ and the girls' heights be $g_1,\dots,g_{17}$.

kvantmathematicsolympiad
Kvant Math Problem 864

Consider first a right triangle.

kvantmathematicsolympiad
Kvant Math Problem 863

Consider a small board, $n=3$.

kvantmathematicsolympiad
Kvant Math Problem 861

Consider small values of $n$ to understand the behavior of the sums modulo $1$.

kvantmathematicsolympiad
Kvant Math Problem 860

Consider the triangle $ABC$ with circumcircle $(O)$ and incircle $(Z)$.

kvantmathematicsolympiad
Kvant Math Problem 859

Let

kvantmathematicsolympiad
Kvant Math Problem 858

Let

kvantmathematicsolympiad
Kvant Math Problem 856

```

kvantmathematicsolympiad
Kvant Math Problem 855

```

kvantmathematicsolympiad
Kvant Math Problem 854

Before I begin, could you provide the full text of Kvant problem M854? I need the problem statement in order to construct the rigorous solution according to your specifications.

kvantmathematicsolympiad
Kvant Math Problem 852

```

kvantmathematicsolympiad
Kvant Math Problem 849

```

kvantmathematicsolympiad
Kvant Math Problem 848

The function $f_0(x) = ||x-1|-2||x|-3||$ involves nested absolute values.

kvantmathematicsolympiad
Kvant Math Problem 846

Let the regular polygon have $n$ sides and circumradius $R$.

kvantmathematicsolympiad
Kvant Math Problem 845

We consider the problem of forming a centrally symmetric polygon using two types of tiles: a “corner” formed by four $1\times1$ squares arranged in an L-shape, and $4\times1$ rectangles.

kvantmathematicsolympiad
Kvant Math Problem 844

For the first representation, the coefficients are constrained by $0\le a_k\le k$.

kvantmathematicsolympiad
Kvant Math Problem 842

Consider the first identity $\sin\alpha + \sin\beta + \sin\gamma$ under the constraint $\alpha + \beta + \gamma = 0$.

kvantmathematicsolympiad
Kvant Math Problem 841

Consider a right triangle $ABC$ with right angle at $C$.

kvantmathematicsolympiad
Kvant Math Problem 839

For a set of integers with no three-term arithmetic progression, the classical example is obtained by writing numbers in base $3$ and allowing only digits $0$ and $1$.

kvantmathematicsolympiad
Kvant Math Problem 837

Consider the simpler case where two of the numbers are coprime.

kvantmathematicsolympiad
Kvant Math Problem 835

Represent the previous encounters by a bipartite graph.

kvantmathematicsolympiad
Kvant Math Problem 833

Compute the first few terms to detect patterns.

kvantmathematicsolympiad
Kvant Math Problem 832

Consider first the case of dividing a square into smaller squares.

kvantmathematicsolympiad
Kvant Math Problem 829

Consider small values of $m$ to detect a pattern.

kvantmathematicsolympiad
Kvant Math Problem 827

The figure consists of a triangle subdivided into smaller regions, four of which are blue triangles of equal area.

kvantmathematicsolympiad
Kvant Math Problem 826

The operation described on the board replaces one number with the sum of the other two numbers minus one.

kvantmathematicsolympiad
Kvant Math Problem 824

I need the diagram from Figure 3 to solve the problem rigorously.

kvantmathematicsolympiad
Kvant Math Problem 823

Before I begin the full solution, I need clarification: does the photograph provide any perspective cues such as vanishing points, the relative positions of the corners, or angles of the visible wall?

kvantmathematicsolympiad
Kvant Math Problem 820

A parallelogram has two pairs of parallel sides.

kvantmathematicsolympiad
Kvant Math Problem 818

Consider small $n$-gons to understand what a uniform set of blue vertices looks like.

kvantmathematicsolympiad
Kvant Math Problem 816

Let $s(n)$ denote the sum of the decimal digits of $n$.

kvantmathematicsolympiad
Kvant Math Problem 814

A natural number is representable as a sum of two squares if and only if every prime congruent to $3 \pmod 4$ appears with even exponent in its prime factorization.

kvantmathematicsolympiad
Kvant Math Problem 813

Consider three segments $OA$, $OB$, and $OC$ of equal length $R$, with $B$ inside the angle $AOC$.

kvantmathematicsolympiad
Kvant Math Problem 811

The quantities involving medians and altitudes suggest rewriting everything in terms of the sides.

kvantmathematicsolympiad
Kvant Math Problem 809

Compute the first few terms of the series to detect a pattern.

kvantmathematicsolympiad
Kvant Math Problem 808

Begin by examining small values of $k$.

kvantmathematicsolympiad
Kvant Math Problem 805

Consider the planar case first.

kvantmathematicsolympiad
CF 193B - Xor

We are given a small system of length-n arrays that evolves through a fixed number of global transformations. We start with an array a, and we repeatedly apply exactly u operations.

codeforcescompetitive-programmingbrute-force
CF 193C - Hamming Distance

We are asked to reconstruct four binary strings consisting only of letters a and b, given the Hamming distances between every pair of strings. The Hamming distance between two strings counts the positions where the strings differ.

codeforcescompetitive-programmingconstructive-algorithmsgreedymathmatrices
CF 193E - Fibonacci Number

We are given a single number $f$, and we consider the infinite sequence generated by Fibonacci rules, but taken modulo 1013. The sequence starts with 0 and 1, and every next value is the sum of the previous two, reduced modulo 1013.

codeforcescompetitive-programmingbrute-forcemathmatrices
Kvant Math Problem 804

Place a right circular cylinder vertically with axis along the $z$-axis and center at the origin, so that $O=(0,0,0)$ is the midpoint of the axis.

kvantmathematicsolympiad
CF 193D - Two Segments

We are given a permutation of integers from 1 to n. A permutation means each integer appears exactly once. The task is to count pairs of contiguous subarrays (segments) such that when we combine the two segments, the union of their elements forms a consecutive sequence of…

codeforcescompetitive-programmingdata-structures
CF 193A - Cutting Figure

We are given a rectangular grid of size n × m representing a sheet of squared paper. Some squares are painted, forming a set A.

codeforcescompetitive-programmingconstructive-algorithmsgraphstrees
CF 190A - Vasya and the Bus

We are asked to compute the minimum and maximum bus fare collected given a number of grown-ups n and children m on a bus. Each grown-up pays one ruble for themselves, and each grown-up can take at most one child for free. Any additional children cost one ruble each.

codeforcescompetitive-programminggreedymath
CF 190B - Surrounded

We are given two circular “threat zones” on a plane. Each one is defined by a center point and a radius. The center is a city, and the radius describes how far the enemy ring extends from that city. We are allowed to place a single radar anywhere in the plane.

codeforcescompetitive-programminggeometry
Kvant Math Problem 802

The data involve two right triangles erected externally on sides $AB$ and $BC$.

kvantmathematicsolympiad
CF 190E - Counter Attack

We are given a set of cities, but the twist is that the input does not describe the real road system directly. Instead, it describes the complement of it.

codeforcescompetitive-programmingdata-structuresdsugraphshashingsortings
CF 190D - Non-Secret Cypher

We are given a sequence of integers and a threshold value $k$. The task is to count how many contiguous subarrays contain some value that appears at least $k$ times inside that subarray.

codeforcescompetitive-programmingtwo-pointers
Kvant Math Problem 801

Compute several small cases to see the pattern.

kvantmathematicsolympiad
CF 190C - STL

We are given a sequence of tokens that were spoken in order, each token being either int or pair. These tokens are supposed to form a valid nested type expression of a very specific grammar.

codeforcescompetitive-programmingdfs-and-similar
Kvant Math Problem 798

Consider first small values of $k$.

kvantmathematicsolympiad
CF 188F - Binary Notation

The task is to take a single positive integer and express it in base 2, meaning we rewrite it using only powers of two with coefficients 0 or 1. Instead of the usual decimal representation, we want the binary string that tells us which powers of two sum up to the number.

codeforcescompetitive-programming*specialimplementation
Kvant Math Problem 796

Consider a square $ABCD$ with a point $P$ inside it.

kvantmathematicsolympiad
CF 188E - HQ9+

We are asked to analyze a string representing a program written in HQ9+, a toy language with four instructions: H, Q, 9, and +. Only the first three produce output when executed: H prints "Hello, World!

codeforcescompetitive-programming*specialimplementation
CF 188D - Asterisks

The problem asks us to generate a simple text pattern. We are given a single integer n, which represents the number of lines we need to print. The first line should contain a single asterisk, the second line two asterisks, and so on, until the n-th line contains n asterisks.

codeforcescompetitive-programming*specialimplementation
CF 188B - A + Reverse B

The task is to compute the sum of a number a and the reversed digits of another number b. Reversing a number means writing its digits in opposite order while ignoring any leading zeros that appear after reversal. For example, reversing 230 produces 32, and reversing 0 remains 0.

codeforcescompetitive-programming*specialimplementation
CF 185C - Clever Fat Rat

We are given a triangular structure of “weighing plates” arranged in rows. The top row has $n$ plates, the next has $n-1$, and so on until the last row which has a single plate. Each plate has a threshold weight.

codeforcescompetitive-programmingdp
CF 185A - Plant

We are asked to model the growth of a triangular plant over a number of years. Each plant triangle has an orientation: "upwards" or "downwards". The growth rules are deterministic: every year, each triangle produces four new triangles.

codeforcescompetitive-programmingmath
CF 185E - Soap Time! - 2

We are given a set of dwarves located at integer coordinates on a Cartesian plane, and optionally a set of subway stations also at integer coordinates.

codeforcescompetitive-programmingbinary-searchdata-structures
CF 185D - Visit of the Great

We are asked to calculate the number of dwarves who can see the Great Mushroom King for multiple visits. Each visit is specified by three integers $k$, $l$, and $r$, which define a sequence of numbers $k cdot 2^l + 1, k cdot 2^l + 2, dots, k cdot 2^r + 1$.

codeforcescompetitive-programmingmathnumber-theory
Kvant Math Problem 795

Consider small values of $n$ and their divisor sums $\sigma(n)$.

kvantmathematicsolympiad
CF 185B - Mushroom Scientists

We are asked to maximize a function defined on three non-negative real variables x, y, and z subject to a sum constraint. The function has the form f(x, y, z) = x^a · y^b · z^c, where a, b, c are non-negative integers.

codeforcescompetitive-programmingmathternary-search
CF 180B - Divisibility Rules

We are asked to determine the type of divisibility rule that applies to a given number d in a given base b. The types are categorized as 2-type, 3-type, 11-type, 6-type, or 7-type depending on whether the divisibility can be checked using only the last few digits (2-type), the…

codeforcescompetitive-programmingmathnumber-theory
Kvant Math Problem 793

Let

kvantmathematicsolympiad
CF 180A - Defragmentation

The disk is a linear array of fixed-size cells, and each cell either stores a fragment of some file or is empty. Every file is already present on the disk, but its fragments may be scattered across arbitrary positions, while still appearing in the correct internal order for…

codeforcescompetitive-programmingimplementation
CF 180F - Mathematical Analysis Rocks!

Each student initially owns a single notebook. There is a fixed hidden permutation p over students, meaning every student has exactly one “best friend” and every student is the best friend of exactly one other student.

codeforcescompetitive-programmingconstructive-algorithmsimplementationmath
CF 180E - Cubes

We have a row of cubes, each painted in one of m colors, and we are allowed to remove up to k cubes to maximize the length of a consecutive segment of cubes all having the same color.

codeforcescompetitive-programmingbinary-searchdptwo-pointers
CF 180D - Name

We are given two strings, s and t. The string s represents a set of letters we are allowed to rearrange freely, and the string t represents a benchmark name.

codeforcescompetitive-programminggreedystrings
CF 180C - Letter

We are given a string consisting of uppercase and lowercase letters. Patrick wants to transform it into a "fancy" string, defined as having all uppercase letters on the left and all lowercase letters on the right. We can change the case of any letter at the cost of one action.

codeforcescompetitive-programmingdp
Kvant Math Problem 791

Petya's calculator allows addition, subtraction, increment by one, and reciprocal operations.

kvantmathematicsolympiad
CF 178F3 - Representative Sampling

We are given a multiset of strings, each string representing a protein. From this collection, we must choose exactly $k$ strings and assign a score to the chosen subset. The score is defined over all unordered pairs of chosen strings.

codeforcescompetitive-programming
CF 178F2 - Representative Sampling

We are given a collection of n protein strings, and we are asked to select exactly k of them such that the sum of the longest common prefixes (LCPs) between every pair in the selected subset is maximized. Each protein is a non-empty string of lowercase letters.

codeforcescompetitive-programmingdpsortingsstrings
CF 178F1 - Representative Sampling

We are given a multiset of strings, each string representing a protein sequence. From these strings, we must choose exactly k of them.

codeforcescompetitive-programming
CF 178E3 - The Beaver's Problem - 2

We are given a square, monochrome image represented as an $n times n$ matrix, where each element is either 0 (white background) or 1 (black foreground). Within this image are several distinct geometric shapes, each either a square or a circle.

codeforcescompetitive-programming
Kvant Math Problem 789

Consider first a small number of points on a circle, for example, four points dividing the circle into four equal arcs.

kvantmathematicsolympiad
CF 178E2 - The Beaver's Problem - 2

We are given a large binary grid representing a noisy black-and-white image. The white background contains several black connected regions, and each such region is guaranteed to be either a square or a circle, possibly rotated in any orientation.

codeforcescompetitive-programming
CF 178E1 - The Beaver's Problem - 2

We are given a large binary image represented as an $n times n$ grid, where each cell is either white or black. The black cells form several disconnected shapes, and each shape is guaranteed to be either a circle or a square, possibly rotated arbitrarily.

codeforcescompetitive-programming
CF 178D3 - Magic Squares

The task is to take a set of $n^2$ integers and arrange them into an $n times n$ matrix such that the sum of every row, every column, and both diagonals is equal. This sum is called the magic constant $s$.

codeforcescompetitive-programming
CF 178D2 - Magic Squares

We are asked to construct an $n times n$ magic square using a given multiset of $n^2$ integers. A magic square has the property that the sums of all rows, all columns, and both diagonals are equal.

codeforcescompetitive-programming
Kvant Math Problem 786

Consider small values of $n$ and $k$ to identify a pattern.

kvantmathematicsolympiad
CF 178D1 - Magic Squares

We are asked to arrange a given set of $n^2$ integers into an $n times n$ matrix so that it forms a magic square. A magic square is defined as a matrix where the sum of every row, every column, and the two main diagonals is the same value $s$.

codeforcescompetitive-programming
CF 178C3 - Smart Beaver and Resolving Collisions

We are maintaining a hash table with a fixed number of slots, where each slot can hold at most one object. Each object has a unique identifier and a preferred starting position given by its hash value. When inserting an object, we first try its hash position.

codeforcescompetitive-programming