Stay ahead of learning milestones! Enroll in a class over the summer!

G
Topic
First Poster
Last Poster
k a April Highlights and 2025 AoPS Online Class Information
jlacosta   0
Apr 2, 2025
Spring is in full swing and summer is right around the corner, what are your plans? At AoPS Online our schedule has new classes starting now through July, so be sure to keep your skills sharp and be prepared for the Fall school year! Check out the schedule of upcoming classes below.

WOOT early bird pricing is in effect, don’t miss out! If you took MathWOOT Level 2 last year, no worries, it is all new problems this year! Our Worldwide Online Olympiad Training program is for high school level competitors. AoPS designed these courses to help our top students get the deep focus they need to succeed in their specific competition goals. Check out the details at this link for all our WOOT programs in math, computer science, chemistry, and physics.

Looking for summer camps in math and language arts? Be sure to check out the video-based summer camps offered at the Virtual Campus that are 2- to 4-weeks in duration. There are middle and high school competition math camps as well as Math Beasts camps that review key topics coupled with fun explorations covering areas such as graph theory (Math Beasts Camp 6), cryptography (Math Beasts Camp 7-8), and topology (Math Beasts Camp 8-9)!

Be sure to mark your calendars for the following events:
[list][*]April 3rd (Webinar), 4pm PT/7:00pm ET, Learning with AoPS: Perspectives from a Parent, Math Camp Instructor, and University Professor
[*]April 8th (Math Jam), 4:30pm PT/7:30pm ET, 2025 MATHCOUNTS State Discussion
April 9th (Webinar), 4:00pm PT/7:00pm ET, Learn about Video-based Summer Camps at the Virtual Campus
[*]April 10th (Math Jam), 4:30pm PT/7:30pm ET, 2025 MathILy and MathILy-Er Math Jam: Multibackwards Numbers
[*]April 22nd (Webinar), 4:00pm PT/7:00pm ET, Competitive Programming at AoPS (USACO).[/list]
Our full course list for upcoming classes is below:
All classes run 7:30pm-8:45pm ET/4:30pm - 5:45pm PT unless otherwise noted.

Introductory: Grades 5-10

Prealgebra 1 Self-Paced

Prealgebra 1
Sunday, Apr 13 - Aug 10
Tuesday, May 13 - Aug 26
Thursday, May 29 - Sep 11
Sunday, Jun 15 - Oct 12
Monday, Jun 30 - Oct 20
Wednesday, Jul 16 - Oct 29

Prealgebra 2 Self-Paced

Prealgebra 2
Sunday, Apr 13 - Aug 10
Wednesday, May 7 - Aug 20
Monday, Jun 2 - Sep 22
Sunday, Jun 29 - Oct 26
Friday, Jul 25 - Nov 21

Introduction to Algebra A Self-Paced

Introduction to Algebra A
Monday, Apr 7 - Jul 28
Sunday, May 11 - Sep 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Wednesday, May 14 - Aug 27
Friday, May 30 - Sep 26
Monday, Jun 2 - Sep 22
Sunday, Jun 15 - Oct 12
Thursday, Jun 26 - Oct 9
Tuesday, Jul 15 - Oct 28

Introduction to Counting & Probability Self-Paced

Introduction to Counting & Probability
Wednesday, Apr 16 - Jul 2
Thursday, May 15 - Jul 31
Sunday, Jun 1 - Aug 24
Thursday, Jun 12 - Aug 28
Wednesday, Jul 9 - Sep 24
Sunday, Jul 27 - Oct 19

Introduction to Number Theory
Thursday, Apr 17 - Jul 3
Friday, May 9 - Aug 1
Wednesday, May 21 - Aug 6
Monday, Jun 9 - Aug 25
Sunday, Jun 15 - Sep 14
Tuesday, Jul 15 - Sep 30

Introduction to Algebra B Self-Paced

Introduction to Algebra B
Wednesday, Apr 16 - Jul 30
Tuesday, May 6 - Aug 19
Wednesday, Jun 4 - Sep 17
Sunday, Jun 22 - Oct 19
Friday, Jul 18 - Nov 14

Introduction to Geometry
Wednesday, Apr 23 - Oct 1
Sunday, May 11 - Nov 9
Tuesday, May 20 - Oct 28
Monday, Jun 16 - Dec 8
Friday, Jun 20 - Jan 9
Sunday, Jun 29 - Jan 11
Monday, Jul 14 - Jan 19

Intermediate: Grades 8-12

Intermediate Algebra
Monday, Apr 21 - Oct 13
Sunday, Jun 1 - Nov 23
Tuesday, Jun 10 - Nov 18
Wednesday, Jun 25 - Dec 10
Sunday, Jul 13 - Jan 18
Thursday, Jul 24 - Jan 22

Intermediate Counting & Probability
Wednesday, May 21 - Sep 17
Sunday, Jun 22 - Nov 2

Intermediate Number Theory
Friday, Apr 11 - Jun 27
Sunday, Jun 1 - Aug 24
Wednesday, Jun 18 - Sep 3

Precalculus
Wednesday, Apr 9 - Sep 3
Friday, May 16 - Oct 24
Sunday, Jun 1 - Nov 9
Monday, Jun 30 - Dec 8

Advanced: Grades 9-12

Olympiad Geometry
Tuesday, Jun 10 - Aug 26

Calculus
Tuesday, May 27 - Nov 11
Wednesday, Jun 25 - Dec 17

Group Theory
Thursday, Jun 12 - Sep 11

Contest Preparation: Grades 6-12

MATHCOUNTS/AMC 8 Basics
Wednesday, Apr 16 - Jul 2
Friday, May 23 - Aug 15
Monday, Jun 2 - Aug 18
Thursday, Jun 12 - Aug 28
Sunday, Jun 22 - Sep 21
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

MATHCOUNTS/AMC 8 Advanced
Friday, Apr 11 - Jun 27
Sunday, May 11 - Aug 10
Tuesday, May 27 - Aug 12
Wednesday, Jun 11 - Aug 27
Sunday, Jun 22 - Sep 21
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

AMC 10 Problem Series
Friday, May 9 - Aug 1
Sunday, Jun 1 - Aug 24
Thursday, Jun 12 - Aug 28
Tuesday, Jun 17 - Sep 2
Sunday, Jun 22 - Sep 21 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Monday, Jun 23 - Sep 15
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

AMC 10 Final Fives
Sunday, May 11 - Jun 8
Tuesday, May 27 - Jun 17
Monday, Jun 30 - Jul 21

AMC 12 Problem Series
Tuesday, May 27 - Aug 12
Thursday, Jun 12 - Aug 28
Sunday, Jun 22 - Sep 21
Wednesday, Aug 6 - Oct 22

AMC 12 Final Fives
Sunday, May 18 - Jun 15

F=ma Problem Series
Wednesday, Jun 11 - Aug 27

WOOT Programs
Visit the pages linked for full schedule details for each of these programs!


MathWOOT Level 1
MathWOOT Level 2
ChemWOOT
CodeWOOT
PhysicsWOOT

Programming

Introduction to Programming with Python
Thursday, May 22 - Aug 7
Sunday, Jun 15 - Sep 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Tuesday, Jun 17 - Sep 2
Monday, Jun 30 - Sep 22

Intermediate Programming with Python
Sunday, Jun 1 - Aug 24
Monday, Jun 30 - Sep 22

USACO Bronze Problem Series
Tuesday, May 13 - Jul 29
Sunday, Jun 22 - Sep 1

Physics

Introduction to Physics
Wednesday, May 21 - Aug 6
Sunday, Jun 15 - Sep 14
Monday, Jun 23 - Sep 15

Physics 1: Mechanics
Thursday, May 22 - Oct 30
Monday, Jun 23 - Dec 15

Relativity
Sat & Sun, Apr 26 - Apr 27 (4:00 - 7:00 pm ET/1:00 - 4:00pm PT)
Mon, Tue, Wed & Thurs, Jun 23 - Jun 26 (meets every day of the week!)
0 replies
jlacosta
Apr 2, 2025
0 replies
k i Adding contests to the Contest Collections
dcouchman   1
N Apr 5, 2023 by v_Enhance
Want to help AoPS remain a valuable Olympiad resource? Help us add contests to AoPS's Contest Collections.

Find instructions and a list of contests to add here: https://artofproblemsolving.com/community/c40244h1064480_contests_to_add
1 reply
dcouchman
Sep 9, 2019
v_Enhance
Apr 5, 2023
k i Zero tolerance
ZetaX   49
N May 4, 2019 by NoDealsHere
Source: Use your common sense! (enough is enough)
Some users don't want to learn, some other simply ignore advises.
But please follow the following guideline:


To make it short: ALWAYS USE YOUR COMMON SENSE IF POSTING!
If you don't have common sense, don't post.


More specifically:

For new threads:


a) Good, meaningful title:
The title has to say what the problem is about in best way possible.
If that title occured already, it's definitely bad. And contest names aren't good either.
That's in fact a requirement for being able to search old problems.

Examples:
Bad titles:
- "Hard"/"Medium"/"Easy" (if you find it so cool how hard/easy it is, tell it in the post and use a title that tells us the problem)
- "Number Theory" (hey guy, guess why this forum's named that way¿ and is it the only such problem on earth¿)
- "Fibonacci" (there are millions of Fibonacci problems out there, all posted and named the same...)
- "Chinese TST 2003" (does this say anything about the problem¿)
Good titles:
- "On divisors of a³+2b³+4c³-6abc"
- "Number of solutions to x²+y²=6z²"
- "Fibonacci numbers are never squares"


b) Use search function:
Before posting a "new" problem spend at least two, better five, minutes to look if this problem was posted before. If it was, don't repost it. If you have anything important to say on topic, post it in one of the older threads.
If the thread is locked cause of this, use search function.

Update (by Amir Hossein). The best way to search for two keywords in AoPS is to input
[code]+"first keyword" +"second keyword"[/code]
so that any post containing both strings "first word" and "second form".


c) Good problem statement:
Some recent really bad post was:
[quote]$lim_{n\to 1}^{+\infty}\frac{1}{n}-lnn$[/quote]
It contains no question and no answer.
If you do this, too, you are on the best way to get your thread deleted. Write everything clearly, define where your variables come from (and define the "natural" numbers if used). Additionally read your post at least twice before submitting. After you sent it, read it again and use the Edit-Button if necessary to correct errors.


For answers to already existing threads:


d) Of any interest and with content:
Don't post things that are more trivial than completely obvious. For example, if the question is to solve $x^{3}+y^{3}=z^{3}$, do not answer with "$x=y=z=0$ is a solution" only. Either you post any kind of proof or at least something unexpected (like "$x=1337, y=481, z=42$ is the smallest solution). Someone that does not see that $x=y=z=0$ is a solution of the above without your post is completely wrong here, this is an IMO-level forum.
Similar, posting "I have solved this problem" but not posting anything else is not welcome; it even looks that you just want to show off what a genius you are.

e) Well written and checked answers:
Like c) for new threads, check your solutions at least twice for mistakes. And after sending, read it again and use the Edit-Button if necessary to correct errors.



To repeat it: ALWAYS USE YOUR COMMON SENSE IF POSTING!


Everything definitely out of range of common sense will be locked or deleted (exept for new users having less than about 42 posts, they are newbies and need/get some time to learn).

The above rules will be applied from next monday (5. march of 2007).
Feel free to discuss on this here.
49 replies
ZetaX
Feb 27, 2007
NoDealsHere
May 4, 2019
Olympiad book reading help
Enes040612   2
N a minute ago by AshAuktober
Hello, does anyone else struggle with reading math olympiad books or am I just the only one? Whenever i try to study any different books I often get confused or overwhelmed very easily. This makes the process of studying very hard for me. Do you guys have any tips, or techniques you used? Any good videos you know?
2 replies
Enes040612
Jan 4, 2025
AshAuktober
a minute ago
one cyclic formed by two cyclic
CrazyInMath   22
N 4 minutes ago by ItzsleepyXD
Source: EGMO 2025/3
Let $ABC$ be an acute triangle. Points $B, D, E$, and $C$ lie on a line in this order and satisfy $BD = DE = EC$. Let $M$ and $N$ be the midpoints of $AD$ and $AE$, respectively. Suppose triangle $ADE$ is acute, and let $H$ be its orthocentre. Points $P$ and $Q$ lie on lines $BM$ and $CN$, respectively, such that $D, H, M,$ and $P$ are concyclic and pairwise different, and $E, H, N,$ and $Q$ are concyclic and pairwise different. Prove that $P, Q, N,$ and $M$ are concyclic.
22 replies
+1 w
CrazyInMath
Yesterday at 12:38 PM
ItzsleepyXD
4 minutes ago
sequence infinitely similar to central sequence
InterLoop   14
N 5 minutes ago by ItzsleepyXD
Source: EGMO 2025/2
An infinite increasing sequence $a_1 < a_2 < a_3 < \dots$ of positive integers is called central if for every positive integer $n$, the arithmetic mean of the first $a_n$ terms of the sequence is equal to $a_n$.

Show that there exists an infinite sequence $b_1$, $b_2$, $b_3$, $\dots$ of positive integers such that for every central sequence $a_1$, $a_2$, $a_3$, $\dots$, there are infinitely many positive integers $n$ with $a_n = b_n$.
14 replies
2 viewing
InterLoop
Yesterday at 12:38 PM
ItzsleepyXD
5 minutes ago
pairwise coprime sum gcd
InterLoop   27
N 5 minutes ago by ItzsleepyXD
Source: EGMO 2025/1
For a positive integer $N$, let $c_1 < c_2 < \dots < c_m$ be all the positive integers smaller than $N$ that are coprime to $N$. Find all $N \ge 3$ such that
$$\gcd(N, c_i + c_{i+1}) \neq 1$$for all $1 \le i \le m - 1$.
27 replies
InterLoop
Yesterday at 12:34 PM
ItzsleepyXD
5 minutes ago
Projection of vertex onto bisectors
randomusername   8
N 6 minutes ago by AshAuktober
Source: ITAMO 2016, Problem 1
Let $ABC$ be a triangle, and let $D$ and $E$ be the orthogonal projections of $A$ onto the internal bisectors from $B$ and $C$. Prove that $DE$ is parallel to $BC$.
8 replies
randomusername
May 11, 2016
AshAuktober
6 minutes ago
Determining Integers From Sums
oVlad   1
N 26 minutes ago by removablesingularity
Source: Romania Junior TST 2025 Day 1 P3
Let $n\geqslant 3$ be a positiv integer. Ana chooses the positive integers $a_1,a_2,\ldots,a_n$ and for any non-empty subset $A\subseteq\{1,2,\ldots,n\}$ she computes the sum \[s_A=\sum_{k
\in A}a_k.\]She orders these sums $s_1\leqslant s_2\leqslant\cdots\leqslant s_{2^n-1}.$ Prove that there exists a subset $B\subseteq\{1,2,\ldots,2^n-1\}$ with $2^{n-2}+1$ elements such that, regardless of the integers $a_1,a_2,\ldots,a_n$ chosen by Ana, these can be determined by only knowing the sums $s_i$ with $i\in B.$
1 reply
1 viewing
oVlad
Saturday at 9:45 AM
removablesingularity
26 minutes ago
Colouring numbers
kitun   4
N 2 hours ago by quasar_lord
What is the least number required to colour the integers $1, 2,.....,2^{n}-1$ such that for any set of consecutive integers taken from the given set of integers, there will always be a colour colouring exactly one of them? That is, for all integers $i, j$ such that $1<=i<=j<=2^{n}-1$, there will be a colour coloring exactly one integer from the set $i, i+1,.... , j-1, j$.
4 replies
kitun
Nov 15, 2021
quasar_lord
2 hours ago
Arithmetic mean of all values
Zelderis   1
N 2 hours ago by Rohit-2006
Source: Brazil Undergrad MO - Galois-Noether 2018 #14
What is the arithmetic mean of all values of the expression $ | a_1-a_2 | + | a_3-a_4 | $
Where $ a_1, a_2, a_3, a_4 $ is a permutation of the elements of the set {$ 1,2,3,4 $}?
1 reply
Zelderis
Nov 26, 2019
Rohit-2006
2 hours ago
If p^23, p^24, q^23, q^24 are in AP, then it also includes p and q
Tintarn   4
N 3 hours ago by de-Kirschbaum
Source: All-Russian MO 2024 10.1
Let $p$ and $q$ be different prime numbers. We are given an infinite decreasing arithmetic progression in which each of the numbers $p^{23}, p^{24}, q^{23}$ and $q^{24}$ occurs. Show that the numbers $p$ and $q$ also occur in this progression.
Proposed by A. Kuznetsov
4 replies
Tintarn
Apr 22, 2024
de-Kirschbaum
3 hours ago
Trigonometric Equation
VitaPretor   0
3 hours ago
\[
\text{Given that } 0 < \theta < 90^\circ,\ \text{solve the equation: } \sin(\theta - 60^\circ)\sin\theta + \sin(54^\circ - \theta)\sin 54^\circ = 0
\]\[
\text{What is the value of } \theta\ (\text{in degrees})\ \text{that satisfies the equation?}
\]
0 replies
VitaPretor
3 hours ago
0 replies
AO and KI meet on $\Gamma$
Kayak   28
N 3 hours ago by Ilikeminecraft
Source: Indian TST 3 P2
Let $ABC$ be an acute-angled scalene triangle with circumcircle $\Gamma$ and circumcenter $O$. Suppose $AB < AC$. Let $H$ be the orthocenter and $I$ be the incenter of triangle $ABC$. Let $F$ be the midpoint of the arc $BC$ of the circumcircle of triangle $BHC$, containing $H$.

Let $X$ be a point on the arc $AB$ of $\Gamma$ not containing $C$, such that $\angle AXH = \angle AFH$. Let $K$ be the circumcenter of triangle $XIA$. Prove that the lines $AO$ and $KI$ meet on $\Gamma$.

Proposed by Anant Mudgal
28 replies
Kayak
Jul 17, 2019
Ilikeminecraft
3 hours ago
Mock 22nd Thailand TMO P4
korncrazy   2
N 3 hours ago by EeEeRUT
Source: own
Let $n$ be a positive integer. In an $n\times n$ table, an upright path is a sequence of adjacent cells starting from the southwest corner to the northeast corner such that the next cell is either on the top or on the right of the previous cell. Find the smallest number of grids one needs to color in an $n\times n$ table such that there exists only one possible upright path not containing any colored cells.
2 replies
korncrazy
Yesterday at 6:53 PM
EeEeRUT
3 hours ago
NEPAL TST 2025 DAY 2
Tony_stark0094   6
N 4 hours ago by GeoKing
Consider an acute triangle $\Delta ABC$. Let $D$ and $E$ be the feet of the altitudes from $A$ to $BC$ and from $B$ to $AC$ respectively.

Define $D_1$ and $D_2$ as the reflections of $D$ across lines $AB$ and $AC$, respectively. Let $\Gamma$ be the circumcircle of $\Delta AD_1D_2$. Denote by $P$ the second intersection of line $D_1B$ with $\Gamma$, and by $Q$ the intersection of ray $EB$ with $\Gamma$.

If $O$ is the circumcenter of $\Delta ABC$, prove that $O$, $D$, and $Q$ are collinear if and only if quadrilateral $BCQP$ can be inscribed within a circle.

$\textbf{Proposed by Kritesh Dhakal, Nepal.}$
6 replies
Tony_stark0094
Saturday at 8:40 AM
GeoKing
4 hours ago
Combinatorics or algebra?
persamaankuadrat   1
N 4 hours ago by removablesingularity
Source: OSNK 2024
How many sequences of $\left(a_{1},a_{2},a_{3},a_{4},a_{5},a_{6} \right)$ where the $a_{i}$ are positive integers such that each $1 \le a_{i} \le 4$ and none of two consecutive terms when summed are equal to $4$.
1 reply
persamaankuadrat
Yesterday at 6:34 AM
removablesingularity
4 hours ago
Another square grid :D
MathLuis   43
N Apr 2, 2025 by akliu
Source: USEMO 2021 P1
Let $n$ be a fixed positive integer and consider an $n\times n$ grid of real numbers. Determine the greatest possible number of cells $c$ in the grid such that the entry in $c$ is both strictly greater than the average of $c$'s column and strictly less than the average of $c$'s row.

Proposed by Holden Mui
43 replies
MathLuis
Oct 30, 2021
akliu
Apr 2, 2025
Another square grid :D
G H J
Source: USEMO 2021 P1
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
MathLuis
1487 posts
#1 • 11 Y
Y by megarnie, HWenslawski, Mogmog8, centslordm, OlympusHero, Zyz1010, 554183, The_Turtle, Pluto1708, Tastymooncake2, ItsBesi
Let $n$ be a fixed positive integer and consider an $n\times n$ grid of real numbers. Determine the greatest possible number of cells $c$ in the grid such that the entry in $c$ is both strictly greater than the average of $c$'s column and strictly less than the average of $c$'s row.

Proposed by Holden Mui
This post has been edited 2 times. Last edited by MathLuis, Nov 4, 2021, 11:10 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
VulcanForge
626 posts
#2 • 7 Y
Y by HWenslawski, centslordm, megarnie, Pluto1708, metricpaper, Tastymooncake2, MS_asdfgzxcvb
Answer: $(n-1)^2$.

Construction shown below is easily generalizable.
$$\begin{bmatrix}
0&0&0&1\\
0&0&0&1\\
0&0&0&1\\
-1&-1&-1&0
\end{bmatrix}$$
Let $A$ be the set of minimums in the columns, and $B$ be the set of maximums in the rows (if these min/maxes are not unique, then perturb them so they are unique). Notice $|A \cap B| \le 1$, or else we get a contradiction. Hence we have at least $2n-1$ of the cells are bad, so at most $(n-1)^2$ of them are good.
This post has been edited 3 times. Last edited by VulcanForge, Oct 31, 2021, 4:30 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Knty2006
50 posts
#3 • 3 Y
Y by HWenslawski, centslordm, samrocksnature
My answer seems really bad, but here goes nothing.



A "fat" square is a square that is minimum in column and maximum in its row.
Call a number that is non-"$c$", "dumb"

$subclaim$: If we have a fat square on the same column or row, it is as good as not having another fat square.
Proof:
Firstly, note that each row and column has a minimum and a maximum value, therefore there should be a unique dumb square that corresponds to each row and column as long as a fat square does not cover it.

Observe that the new fat square that shares a column or row with an existing fat square only corresponds to a new column/row but it does not cover a new row/column. Hence, observe that even if we replace the new fat square with a dumb square the number of dumb squares that are needed still decreases by the same amount.

Therefore, we do not need to consider fat squares that are in the same row/column.


$claim 1:$ If there are$ \geq 2$ fat squares in a different column and row, the number of dumb squares is the same as having no fat squares at all.

$Proof:$
For the sake of contradiction, suppose that there are $\geq 2$ fat squares in a different column and row. Select one fat square and rearrange it such that the fat square is on the bottom left of the $n$ by $n$ grid.

Suppose that the value in the fat square is $x$. Note that the numbers in the same column $\geq x$, numbers in the same row $\leq x$

Rearrange the row and column such that it is from largest to smallest ( left to right) and smallest to largest (bottom to top)

Now, consider the second fat-square in a different column and row, suppose that it has a value of $j$

Note that $j\leq x$ if you consider the column while $j\geq x$ if you consider the row. This implies that $$j=x$$
This means that all the edges of the rectangle formed by the terms containing $j$ and $x$ as it's corner pieces must all have the value $x$.

Now, notice that the edges of the rectangle are "dumb" since they are either the minimum in column or maximum in their row, since they share the same value as $x$ and $j$

Furthermore, note that every row and column has $\geq1$ unique dumb square that corresponds to it as long as it is not covered by a "fat" square.

However, since there are no more fat squares outside of this rectangle, there is a unique dumb square for the remaining rows and columns.

Suppose that the rectangle has dimensions $a$ and $b$ then the number of dumb squares $\geq 2n-1 +(a+b-3)$
Since $a\geq, b\geq 2$, we get that no of dumb squares $\geq 2n$

$claim2$: If there are no "fat squares", no of dumb squares $\geq 2n$
Furthermore, note that every row and column has $\geq1$ unique dumb square that corresponds to it as long as it is not covered by a "fat" square.
So, there is a unique dumb square for each column and row $=>$ no. of dumb squares $\geq n+n=2n$

$claim3$ If we have $1 $fat square, the number of dumb squares $\geq 2n-1$
Note that 1 fat square will be able to cover $1$ dumb square for $1$ row and $1$ column, however, the remaining $n-1$columns and rows will require a unique dumb square to correspond to it .
Therefore the number of dumb square $\geq (n-1) + (n-1) +1 =2n-1$

$claim 4$ Number of $c$'s $\leq (n-1)^2$
Proof:
no of $c= n^2$-no. of dumb squares $\leq$ $n^2-(2n-1)=(n-1)^2$

Construction:
Fill the $(n-1)$ by $(n-1)$ at the bottom left of the grid with $1$, the topmost row's first $n-1$ values with $0$'s, the rightmost column's bottom most $n-1$ values with $2$ and the top right grid with $69420$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
MathJams
3229 posts
#4 • 5 Y
Y by HWenslawski, YBSuburbanTea, centslordm, RP3.1415, LLL2019
This is what I submitted.
Attachments:
This post has been edited 1 time. Last edited by MathJams, Oct 30, 2021, 11:09 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
DottedCaculator
7331 posts
#5 • 3 Y
Y by centslordm, megarnie, IMUKAT
solution attached
Attachments:
2021 USEMO Problem 1.pdf (259kb)
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
The_Turtle
254 posts
#6 • 25 Y
Y by ike.chen, Knty2006, MathJams, MathLuis, MarkBcc168, HamstPan38825, centslordm, megarnie, HrishiP, math31415926535, Idio-logy, Aryan-23, tigerzhang, 554183, mathleticguyyy, pad, Radio2, Atpar, pog, rayfish, mira74, Mogmog8, Pluto1708, mijail, Yiyj1
My problem :D

Solution
This post has been edited 1 time. Last edited by The_Turtle, Oct 30, 2021, 11:30 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Mogmog8
1080 posts
#7 • 2 Y
Y by centslordm, Pluto1708
We claim that the greatest value is $(n-1)^2.$ Call a cell "good" if it satisfies the conditions and "bad" if not. Assign coordinates to our cells with $(1,1)$ the bottom left corner and $(n,n)$ the top right.

Claim: $(n-1)^2$ good cells is possible.
Proof. Let the upper-right $n\times n$ square be all zeros, the left-most column excluding $(1,1)$ be $1,$ and the down-most row be $-1.$ We see that all the zeros are good as $0<\tfrac{1}{n}<\tfrac{0(n-1)+1}{n}$ and $0>-\tfrac{1}{n}=\tfrac{0(n-1)-1}{n}.$ Also note that all the ones and negative ones are bad. $\blacksquare$

Let the cells with $x$ or $y$ coordinate $k$ with $k\in[1,n]$ be called the $k$th "shell." Note each row/column cannot be all good so each shell must have at least one bad cell.

Claim: Each $n\times n$ grid can have at most one shell with one bad cell.
Proof. FTSOC let the $p$th and $k$th shell have only one bad cell, $b_p$ and $b_k.$

Sub-Claim: All cells with $x$ coordinate $p$ will be greater than $b_p,$ and all cells with $y$ coordinates $p$ will be less than $b_p.$
Proof. We will prove the $x$ coordinate part and the $y$ coordinate part will follow analogously. Notice that the cells with $x$ coordinate $p$ is the $p$th column. Let the average of the column be $a_p.$ FTSOC assume at least one cell in the $p$th column be less than or equal to $b_p.$
Case 1: $a_p<b_p.$ Since all other cells in the column are good, they are greater than the average. But then all the cells are greater than the average, so a contradiction.
Case 2: $a_p=b_p.$ Then, at least one other cell is less than or equal to $a_p,$ so a contradiction since all other cells must be good.
Case 3: $a_p>b_p$ Then, at least one other cell is less than $a_p,$ a contradiction. $\blacksquare$

Consider cells $(p,q)$ and $(q,p).$ Since $(p,q)$ has $x$ coordinate $p,$ it is greater than $b_p.$ Since it has $y$ coordinate $q,$ it is less than $b_q.$ Thus, $b_p<b_q.$ Similarly, $b_q<b_p$ from $(q,p).$ We have our desired contradiction $\blacksquare$

There are $n$ shells, and since all but one cell needs at least $2$ bad cells, there are at least $2n-1$ bad cells. Hence, there are at most $n^2-2n+1=(n-1)^2$ good cells. $\square$
This post has been edited 3 times. Last edited by Mogmog8, Oct 31, 2021, 3:12 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
AwesomeYRY
579 posts
#8 • 2 Y
Y by centslordm, opIst_w
Sketch of my solution:

Answer: $(n-1)^2$.
Construction. Top row are -1s, right column is 1s, everything else is 0.

We now show that this is optimal. Let $A$ be the set of cells consisting of the leftmost cell in each row that is $\geq $ the average of the row. Let $B$ be the set of cells consisting of the uppermost cell of each column that is $\leq$ the average of the column. Clearly, $|A|=|B|=n$.

Claim: $|A\cap B| \leq 1$.
Proof: If we take $X,Y\in A\cap B$, and the two cells in the rectangle together with them are $M,N$, then we'll have some sort of
\[X>M>Y>N>X\]contradiction.

Then, $|A\cup B| \geq 2n-1$, so at most $n^2-(2n-1) = (n-1)^2$ squares are good.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
megarnie
5560 posts
#9 • 1 Y
Y by centslordm
We claim the answer is $\boxed{(n-1)^2}$.

This is achievable by making the rightmost column all ones except for the topmost cell and making the top row all $-1$ except for the rightmost cell. We label all other cells $0$. This works because all the zeroes except for the zero in the top right cell can be a value of $c$, which gives $(n-1)^2$ total values.

Now we will prove the bound.

Consider the smallest cell in each column and the largest cell in each row (if there are two within the same row or column, choose any one of these). There are $2n$ of these cells minus the number of cells that are the smallest in its column and largest in its row. None of these can be a value of $c$.

Claim: There can be only one cell that is the smallest cell in its column and largest in its row.
Proof: AFTSOC that there are two. Label them $a$ and $b$. Now we consider the two other intersection points between the columns and rows of these $a$ and $b$. One of them must be labeled greater than $a$ and less than $b$, which implies $a<b$. The other must be labeled greater than $b$ and less than $a$, which implies $b<a$, a contradiction.

So we discard at least $2n-1$ cells, giving a maximum of $n^2-2n+1=(n-1)^2$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
HrishiP
1346 posts
#10 • 4 Y
Y by BlackMax, centslordm, megarnie, pog
The answer is $\boxed{(n-1)^2}$. For construction, consider the following example for $n=4$ which easily generalizes:
[asy]
unitsize(14);
int n = 4;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
if (i < n && j < n || i == n && j == n) {
label("1", (i, j));
} else if (i == n) {
label("$2$", (i, j));
} else {
label("$0$", (i, j));
}
}
}
[/asy]
Now call a cell satisfying the desired condition cool. Every row and column must have at least one cell that is less than the average of that row or cell (all the numbers in a set cannot be greater than the average). Thus we can count $2n$ cells that cannot be cool. However, we claim at most one square is counted twice, that is, there is at most one square that is the smallest in its row and largest in its column. Assume that there exists two such cells, with numbers say $x$ and $y$. Consider the intersection of the column of $x$ and the row of $y$. This implies that $x>y$. Similarly $y<x$, contradiction. Thus the maximum number of cool cells is $n^2-(2n-1) = (n-1)^2$. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
edfearay123
92 posts
#11 • 1 Y
Y by centslordm
Sketch of a hard solution:
We will say that a cell is special if fulfills the conditions on the problem. We will say that a set of $n$ cells is special if all of its cells are special.
Claim 1: Each line (column or row) cannot be special.
Claim 2: We will say that a set of n cells is happy if there are not cells on the same column or row, then there are not a happy special set.

We define the above sets with fantastic (happy or lines) and they need at least one non special cell.

Now, basically we have to solve the following problem: In $n \times n$ find the maximum number of cells that are painted such that each fantastic set has at least one cell choosed. (Of course the answer is $2n-1$ painted cells!)

(Now please try this problem, it took me much time and if you have a solution please put it on the thread)
Click to reveal hidden text

The example for $2n-1$ is on the other solutions.
This post has been edited 2 times. Last edited by edfearay123, Nov 1, 2021, 3:32 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
TheStrayCat
161 posts
#12 • 1 Y
Y by centslordm
My idea: call a cell marked if it satisfies the condition from the statement and unmarked otherwise. Assume there are fewer than $2n-1$ unmarked cells. Consider the bipartite graph whose $2n$ vertices are the $n$ rows and $n$ columns, and in which a row is connected to a column whenever the cell at their intersection is unmarked. This graph must be disconnected, hence, there is at least one partitioning of all rows into disjoint sets $A$ and $B$, and at least one partitioning of all columns into disjoint sets $C$ and $D$ such that all cells in $A \times C$ and $B \times D$ are marked. This implies $avg(A \times C)<avg(A \times D)<avg(B \times D)<avg(B \times C)<avg(A \times C)$, where $avg(X)$ is the average of all numbers in the set $X$ of cells. Contradiction.

Examples for $n^2-2n+1$ have already been constructed above.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
LLL2019
834 posts
#13 • 1 Y
Y by centslordm
Solution from my mocking
Attachments:
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
pad
1671 posts
#14 • 2 Y
Y by Eyed, centslordm
Call a cell good if it's greater than the average of its column and less than the average of its row.
  • Call a cell row-bad if it is the maximum of its row (if there are multiple, define the cell to be the leftmost maximum), and
  • Call a cell column-bad if it the minimum of its column (choose lowest if multiple).
Note that there exists a (unique) row-bad square in each row and a (unique) column-bad square in each column. Let $R_i$ be the row-bad square of row $i$ for each $i$, and similarly define $C_i$.

Claim. $|\{R_1,\ldots,R_n\}\cap \{C_1,\ldots,C_n\}| \le 1$.

Proof. Suppose square $(i',j)$ (value $a$) and $(i,j')$ (value $b$) are both row-bad and column-bad. (The ordering of these coordinates is irrelevant.) Call $c$ the value in $(i,j)$ and $d$ the value in $(i',j')$.
https://media.discordapp.net/attachments/752979051370774612/904198258732195850/unknown.png
Since we assumed $a$ is the leftmost maximum, we know $d\not = a$. We have
\begin{align*}
a&\ge d, \quad a\le c \\
b&\ge c, \quad b\le d,
\end{align*}which means $a>d\ge b\ge c\ge a$, contradiction. $\blacksquare$

Now, notice $R_i$ are all bad and $C_i$ are all bad, and so there are at least $\{R_1,\ldots,R_n\}\cup \{C_1,\ldots,C_n\} \ge n+n-1 = 2n-1$ bad cells, so there are at most $n^2-(2n-1)=(n-1)^2$ good cells. A construction is to take an $(n-1)\times (n-1)$ grid of $0$'s, and add on a row of $1$'s to the right and a column of $-1$'s to the bottom.
Motivation: First, I noticed that in each row, at least one cell exists that is greater than average, so it is bad. Similarly for the columns. So each row has at least 1 bad square, and so does each column; however, this is too weak to conclude the $(n-1)^2$ bound. A counterexample that illustrates this is if the set of bad squares is the diagonal of the grid. Then the $n$ ``row-bad'' and $n$ ``column-bad'' squares ``match up'', so we don't get $\approx 2n$ distinct bad squares, as needed.

So this made me think about when the row-bad and column-bad squares match up -- we want to prove this happens at most once. I called a square doubly-bad if it was not good and all squares on its row and column were good. This was the crucial mistake, since it is not true that if a square is less than the average of its column and more than the average of its row, then it is doubly-bad; we also need everything to be good, which is not always going to happen.

Anyways, I let $C_1,\ldots,C_n$ and $R_1,\ldots,R_n$ be arbitrary squares in the columns and rows respectively, which are greater than the average of the row and less than the average of the column, respectively. The key in my above solution is to instead make these the maximum and minimum, removing the necessity of everything else in the row/column being good. With this old definition, I made an inequality chain similar to my solution above's, where instead of the maximum and minimum giving the inequalities, it was the fact that one is greater and one is less than the average in the row/column. Again, while the claim is technically true for this definition, it is useless, since $C_i=R_j$ does not imply $(i,j)$ is doubly bad.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
math90
1476 posts
#15
Y by
I don't understand the problem statement. Is $c$ a number or a subset of cells?
This post has been edited 1 time. Last edited by math90, Oct 31, 2021, 4:40 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
math31415926535
5617 posts
#16
Y by
math90 wrote:
I don't understand the problem statement. Is $c$ a number or a subset of cells?

the former
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
math90
1476 posts
#17
Y by
So what is "the entry in $c$"?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
blackbluecar
302 posts
#18 • 1 Y
Y by centslordm
Let $S$ denote the set of squares with the desired property. Wlog slightly tweak the value on each cell so that they are all distinct. We let $A$ be the set of maximal numbers on each row and $B$ be the minimum value of each column. Notice that all elements in $A \cup B$ are not in $S$.

Claim: $|A \cup B| \geq 2n-1$

Assume the contrary, this implies that there exists distinct $x$ and $y$ in both $A$ and $B$. Let their rows and columns be $R_X$, $C_X$, $R_Y$, and $C_Y$. Notice that this implies that every number in $C_X$ is strictly greater than every value in $R_X$ and the same for $R_Y$ and $C_Y$. But, if $R_X$ and $C_Y$ intersect at $s_1$ and $R_Y$ and $C_X$ intersect to $s_2$, this implies $s_1>s_2$ and $s_1<s_2$. Contradiction.

Thus $|S| \leq n^2-|A \cap B| \leq (n-1)^2$. Indeed, we get the following construction.

$M$ $m$ $m$ $m$
$M$ $1 \text{ } \text{ } 1 \text{ } \text{ } 1$
$M$ $1 \text{ } \text{ } 1 \text{ } \text{ } 1$
$M$ $1 \text{ } \text{ } 1 \text{ } \text{ } 1$

Where $M$ super large and $m$ is super small
This post has been edited 3 times. Last edited by blackbluecar, Nov 2, 2021, 3:17 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
v_Enhance
6872 posts
#19 • 4 Y
Y by megarnie, math90, centslordm, HamstPan38825
math90 wrote:
I don't understand the problem statement. Is $c$ a number or a subset of cells?

$c$ is a single cell
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
asdf334
7586 posts
#20 • 1 Y
Y by centslordm
use induction and take cases, we can show the maximum for each case is $n^2-2n+1$ and then provide construction
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
aopsuser305
678 posts
#21
Y by
pad wrote:
Click to reveal hidden text

I also used this solution method, was nervous that I got it wrong because no one posted a similar sol (until you now did).
This post has been edited 2 times. Last edited by aopsuser305, Oct 31, 2021, 3:52 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
gghx
1069 posts
#22 • 1 Y
Y by centslordm
Someone please tell me if this is wrong:

We colour a cell black if it satisfies the condition in the question statement.

Claim 1: no entire row/column is black (obvious).

Claim 2: for any $n$ cells which are all in distinct rows and columns, not all of them are black.
Proof: Suppose there exists such $n$ cells, and their total sum is $t$.
Then, consider the sum of all the other cells, $s$.
We have $s>(n-1)t$ when looking at rows, but $s<(n-1)t$ when looking at columns, contradiction.

We now ignore the numbers altogether.

We show that for any set of $n$ cells that satisfy the two claims, the number of black cells is $\le (n-1)^2$.
Suppose that there is such a colouring with $(n-1)^2+2$ cells.

Let the number of black cells in row $i$ be $x_i$. WLOG $x_i\ge x_{i-1}$.

By claim 1, $x_1\ge 1$.

If there is some $x_i<i$, then we have $(n-1)^2+1=x_1+x_2+...+x_n\le (i-1)i+(n-1)(n-i)$. This is equivalent to $(i-1)(i+1-n)\ge 1$, which can only happen when $i=n$.

This means $x_1\ge 1, x_2\ge 2, ..., x_{n-1}\ge n-1$ and $x_n\ge n-1$.

If the $n-1$ and $n$ columns have the different sets of black cells, we can construct a set of $n$ cells that contradict claim 2 by picking one from column $1$, one from column $2$ which is not part of the current set, one from column $3$, ..., one from column $n-2$ and for the last two cells, one from column $n-1$ and column $n$. This is a contradiction.

If the $n-1$ and $n$ columns have the same set of black cells, WLOG that they both do not have a black cell in the nth row. There must be some column $i$ that has a black cell in the nth row. Suppose that $i$ is the smallest such column. We can thus tweak our previous method a bit by taking the black cell in the nth row when it comes to picking a cell from the ith column.

Construction is the same as all the above (with 0,1,-1s).

I hope this made sense.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
edfearay123
92 posts
#23
Y by
gghx wrote:
Someone please tell me if this is wrong:

We colour a cell black if it satisfies the condition in the question statement.

Claim 1: no entire row/column is black (obvious).

Claim 2: for any $n$ cells which are all in distinct rows and columns, not all of them are black.
Proof: Suppose there exists such $n$ cells, and their total sum is $t$.
Then, consider the sum of all the other cells, $s$.
We have $s>(n-1)t$ when looking at rows, but $s<(n-1)t$ when looking at columns, contradiction.

We now ignore the numbers altogether.

We show that for any set of $n$ cells that satisfy the two claims, the number of black cells is $\le (n-1)^2$.
Suppose that there is such a colouring with $(n-1)^2+2$ cells.

Let the number of black cells in row $i$ be $x_i$. WLOG $x_i\ge x_{i-1}$.

By claim 1, $x_1\ge 1$.

If there is some $x_i<i$, then we have $(n-1)^2+1=x_1+x_2+...+x_n\le (i-1)i+(n-1)(n-i)$. This is equivalent to $(i-1)(i+1-n)\ge 1$, which can only happen when $i=n$.

This means $x_1\ge 1, x_2\ge 2, ..., x_{n-1}\ge n-1$ and $x_n\ge n-1$.

If the $n-1$ and $n$ columns have the different sets of black cells, we can construct a set of $n$ cells that contradict claim 2 by picking one from column $1$, one from column $2$ which is not part of the current set, one from column $3$, ..., one from column $n-2$ and for the last two cells, one from column $n-1$ and column $n$. This is a contradiction.

If the $n-1$ and $n$ columns have the same set of black cells, WLOG that they both do not have a black cell in the nth row. There must be some column $i$ that has a black cell in the nth row. Suppose that $i$ is the smallest such column. We can thus tweak our previous method a bit by taking the black cell in the nth row when it comes to picking a cell from the ith column.

Construction is the same as all the above (with 0,1,-1s).

I hope this made sense.

I think that your solution is correct, I thought the same problem of the black squares, and I put a solution of that above (Is a bit harder than yours).
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
554183
484 posts
#24 • 1 Y
Y by centslordm
I hope this works. Anyway this is a really nice problem.
WLOG all entries are distinct. Let all cells satisfying the condition in the problem statement be called good and bad otherwise. I claim that there are a minimum of $2n-1$ bad cells. Notice that the cell with the maximum entry in each row and minimum entry in each column is always bad. But there might be cells which have the maximum entry in their row and minimum entry in their column. Now I claim that there can be at maximum of one such cell. FTSOC assume there are at least 2. Now in the figure attached, its easy to see that $a>c>b$ and $a<d<b$, contradiction, so our claim is proven.
Therefore, it follows that there are at least $2n-1$ of bad cells and our result follows (construction has been provided above.)
Attachments:
This post has been edited 2 times. Last edited by 554183, Nov 1, 2021, 8:14 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
edfearay123
92 posts
#25
Y by
pad wrote:
\begin{align*}
a&\ge d, \quad a\le c \\
b&\ge c, \quad b\le d,
\end{align*}which means $a>d\ge b\ge c\ge a$, contradiction. $\blacksquare$

I saw that various solutions use that the number on the cells are different, but the problem doesn't say it.
This post has been edited 1 time. Last edited by edfearay123, Nov 4, 2021, 1:19 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
edfearay123
92 posts
#26
Y by
AwesomeYRY wrote:
Claim: $|A\cap B| \leq 1$.
Proof: If we take $X,Y\in A\cap B$, and the two cells in the rectangle together with them are $M,N$, then we'll have some sort of
\[X>M>Y>N>X\]contradiction.
HrishiP wrote:
Now call a cell satisfying the desired condition cool. Every row and column must have at least one cell that is less than the average of that row or cell (all the numbers in a set cannot be greater than the average). Thus we can count $2n$ cells that cannot be cool. However, we claim at most one square is counted twice, that is, there is at most one square that is the smallest in its row and largest in its column. Assume that there exists two such cells, with numbers say $x$ and $y$. Consider the intersection of the column of $x$ and the row of $y$. This implies that $x>y$. Similarly $y<x$, contradiction. Thus the maximum number of cool cells is $n^2-(2n-1) = (n-1)^2$. $\blacksquare$
Prabh2005 wrote:
I hope this works. Anyway this is a really nice problem.
WLOG all entries are distinct. Let all cells satisfying the condition in the problem statement be called good and bad otherwise. I claim that there are a minimum of $2n-1$ bad cells. Notice that the cell with the maximum entry in each row and minimum entry in each column is always bad. But there might be cells which have the maximum entry in their row and minimum entry in their column. Now I claim that there can be at maximum of one such cell. FTSOC assume there are at least 2. Now in the figure attached, its easy to see that $a>c>b$ and $a<d<b$, contradiction, so our claim is proven.
Therefore, it follows that there are at least $2n-1$ of bad cells and our result follows (construction has been provided above.)

For example, here there is not a contradiction:

\begin{tabular}{| c | c | c  c  c | c |c |}
\hline
 & 3  &   &   &   &  3 &  \\ \hline
 1&  2 & 1  &  \dots &  1 &  2 & 1 \\ \hline
 &  3 &   &   &   &  3 &  \\
 &  3 &   &  &    &  3 &  \\ \hline
 1&  2 &  1 & \dots &   1 &  2 & 1 \\ \hline
 &  3 &   &   &   & 3  &  \\ \hline
\end{tabular}
I don't say that there is an example with various of that type of cells and answer more than $(n-1)^2$, but I think that the solution doesn't finish in that part (a friend showed me a solution if the cells are equal)
This post has been edited 2 times. Last edited by edfearay123, Nov 4, 2021, 2:49 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
554183
484 posts
#27
Y by
i mean we can wlog assume that the entries in all cells are distinct by just increasing the entries in the appropriate cells by a very small value chosen so that the "good" cells (the ones satisfying the problem condition) remain good, right?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
IAmTheHazard
5001 posts
#31 • 1 Y
Y by centslordm
A bit overcomplicated but I used Hall's on an actual problem without being told to use Hall's for the first time. Did not think of infinitesimal perturbations

The answer is $c=(n-1)^2$, which is achievable by making the bottom right cell $0$, the rest of the bottom row $-1$, the rest of the right column $1$, and everything else $0$. It remains to prove that this is the maximum.
Call a square that's greater than its column's average but less than its row's blue. Evidently there must be at most $n-1$ blue cells in a single column or row. Now, suppose FTSOC that there are at least $n^2-2n+2$ blue squares, so there are most $2n-2$ non-blue squares. Given this, the key claim is the following:

Claim: There exists a perfect matching of rows to columns such that their intersection is a blue square.
Proof: We will use Hall's marriage lemma, so it suffices to prove that any set $S$ of $k$ rows there are at least $k$ columns that intersect some element of $S$ at a blue square. Suppose otherwise. Then for $k<n$, among the $k$ rows in $S$ there are at most $k(k-1)$ blue cells, and in the remaining $n-k$ rows there are at most $(n-k)(n-1)$, for a total of
$$k(k-1)+(n-k)(n-1)=k^2-nk+(n^2-n),$$which being a upwards-opening parabola in $k$ symmetric about $k=\tfrac{n}{2}$ is maximized when $k=1$, where it attains a value of $n^2-2n+1<n^2-2n+2$, contradiction. If $k=n$, then note that the rows which do overlap some element of $S$, of which there are at most $n-1$, can have at most $n-1$ blue squares, for a total of $(n-1)^2<n^2-2n+2$ cells in total as well. Thus Hall's condition holds so a perfect matching exists. $\blacksquare$

Given this perfect matching, let $f(r)$ denote the column paired with row $r$ and $g(r)$ the (blue) intersection between $r$ and $f(r)$. Next let $M(a)$ denote the average of row or column $a$, so we have
$$M(r)>g(r)>M(f(r)).$$Summing over all $r$, this means
$$\sum_{r \in R} M(r) > \sum_{c \in C} M(c),$$where $R,C$ denote the sets of rows and columns respectively. But this is absurd, as the two quantities should be equal by double counting. Hence $c \geq (n-1)^2+1$ is impossible, as desired. $\blacksquare$
This post has been edited 1 time. Last edited by IAmTheHazard, Nov 26, 2021, 7:11 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Cindy.tw
54 posts
#32 • 1 Y
Y by centslordm
The answer is $(n-1)^2$.

Construct a $n \times n$ grid of numbers in the following way
$$ \begin{matrix} 
0 & 0 & \cdots & 0 & 1 \\
0 & 0 & \cdots & 0 & 1 \\
\vdots & & \cdots & \vdots & \vdots \\
0 & 0 & \cdots & 0 & 1 \\
-1 & -1 & \cdots & -1 & 0
\end{matrix} $$Thus $(n-1)^2$ is obtainable. Now we show that $(n-1)^2$ is optimized.

Let $r_i$ be the average of the $i$-th row and $c_j$ be the average of the $j$-th column. Assume for the sake of correctness that there are $(n-1)^2 + 1$ cell satisfying the condition. Draw a bipartite graph with vertex $r_i$s and $c_j$s, if the cells in the $i$-th row and $j$-th column satisfies the condition, connect two vertex $r_i$ and $c_j$. In this case, we have $r_i > \text{the entry in the cell} > c_j$. While the number of edges is at least $(n-1)^2 + 1$, thus, there is a perfect matching between $r_i$ and $c_j$ (well-known). However, this will derive $\sum_{i=1}^n r_i > \sum_{j=1}^n c_j$, which is absurd since it is an equality.
This post has been edited 1 time. Last edited by Cindy.tw, Feb 11, 2022, 1:48 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
TortilloSquad
305 posts
#33 • 1 Y
Y by Mathlover_1
The answer is $(n-1)^2$, which can be achieved with the bottom right square $=0$, the rest of the rightmost column $=1$, the rest of the bottom row $=-1$ and everything else $=0$.

Call a cell good if it satisfies the problem condition and call it bad if it doesn't. Consider a grid, and if the values are not unique simply shift them by very small numbers to make them unique. Clearly, if a cell is the maximum in its row, it is bad. If it is the minimum of its column, it is also bad. Call a cell that is both the maximum in its row and the minimum in its column noob.

Claim: There is at most one noob cell in the grid.

Assume there can be more than one, and consider two noob cells $X$ and $Y$. Clearly they are in different rows and columns. Let $X=(x_1,y_1)$ and $Y=(x_2,y_2)$. Then, let $A=(x_1,y_2)$ and $B=(x_2,y_1)$. Since $A$ is in $X$'s column, we have $A>X$. Since $A$ is in $Y$'s row, we have $A<Y$, so we have $X<A<Y$, so $X<Y$. Doing something similar for $B$ we end up having $Y<B<X$, which is a clear contradiction.

Therefore we have at least $n+n-1=2n-1$ bad cells, so at most $n^2-(2n-1)=(n-1)^2$ good cells, which is achievable with the construction above. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
PHSH
60 posts
#35
Y by
Here goes my lol IQ solution.

We claim the answer is ${(n-1)}^2$ which is achived by similar constructions described in the above solutions (say, make a $(n-1)\times (n-1)$ square with whatever you want, and then make each number in the remaining column large enough and all number in the remaining row small enough).

Now we show ${(n-1)}^2$ is optimal. Call a cell good if it satisfies the conditions in the problem statement. Define a group as a set of $n$ cells such that any two among them lie in different row and column. The key idea (of my solution) is to notice that we cannot have an entire row, column or group covered by good cells (row and column is clear; in order to see that a group cannot be covered by good cells, notice that this would imply that the sum of all numbers in the grid(counted by row) is stricktly greater than the sum of all numbers in the grid(now counted by columns) which is absurd). Now we can rephrase problem as follows
Quote:
If $S$ is a set of cells in a $n\times n$ grid such that $S$ does not covers a group, a row or a column, then $S$ has at most ${(n-1)}^2$ cells.
Proof:
We proceed by induction with base case trivial. First notice that if any row in the grid has at most $n-2$ cells in $S,$ then we have in total at most $n(n-2) = {(n-1)}^2-1$ cells and we are done. Similarly, we take off the cases where each column and each group has at most $(n-2)$ cells.

Now assume that the situations described in the last paragraph does not hold any, and furthermore assume for the sake of contradiction that $S$ has at least ${(n-1)}^2+1$ cells. Then let $i$ and $j$ be a row and a column, respectively, containing $n-1$ cells of $S.$ If $i\cap j$ is not an empty cell, we can remove $i$ and $j$ and then apply inductive hyphothesys to the remaining square which contains at least ${(n-1)}^2-2(n-1) + 2 = {(n-2)}^2 +1$ so that we find a row, line or group $k$ covered by $S$ in the remaining square. If $k$ is a group, we can merge it with $i\cap j$ and we die. Otherwise, $k$ is a row or a column; if $k$ is a column (respectively row), it must be the case that, in the original grid, the column of $k$ (respectively row) must contain the unique non-covered cell of $j$ (respectively i). In either case, by replacing $j$ with $k$ (respectively $i$ with $k$) we find a row and a column $p$ and $q$ each with $n-1$ cells in $S$, intersecting at the unique non-covered cell of both.

Now remove $p$ and $q$ from the grid. Then the remaining square has at least ${(n-2)}^2$ cells in $S.$ We cannot apply inductive hyphothesis directly but we can proceed as follows: consider a cell of the square which is not in $S$ and put in $S$ temporally. Then we find a group, row or column in $S$ (which may contain our added cell); if it is a group, we can delete a cell of this group (if one of these cells is the one we added, then we necessarily remove this one) and add the two corresponding cells in $p$ and $q$ (i.e., the cell in $p$ which is at the same column of the deleted cell, and the cell in $q$ that is at the same row of the deleted cell); these cells are necessarily in $S$ by construction and so we find a group in the original grid and then die. Finally, we repeat this to all non-empty cells of the new grid, if we have not died after this, we conclude that each non-covered cell of the new grid must lie on a row or in a column with all other cells in $S.$ This bounds the number of non-covered cells in the new grid by $n-1$ so that we can apply inductive hyphothesis now and get an absurd once again. $\square.$

remark
This post has been edited 8 times. Last edited by PHSH, Sep 20, 2022, 9:44 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
HamstPan38825
8857 posts
#36 • 2 Y
Y by centslordm, Mango247
The answer is $(n-1)^2$.

Construction: Fix some very small $\varepsilon$, and use the grid
$$\begin{bmatrix}
1 & 1 & \cdots & 1 & 1/\varepsilon \\ 
1 & 1 & \cdots & 1 & 1/\varepsilon \\ 
\vdots & \vdots & \ddots & \vdots & \vdots \\ 
\varepsilon & \varepsilon & \cdots & \varepsilon & 1.
\end{bmatrix}$$This obviously works when $\varepsilon$ is sufficiently small: every square in the top $(n-1) \times (n-1)$ portion of the grid satisfies the conditions.

Proof of Bound: Call a balanced square in the grid a square that does not satisfy the given conditions, and let there be $k$ balanced squares. Observe that there must be at least one balanced square in every row and column. Furthermore, color a balanced square red if it is the local maximum in its row and blue if it is the local minimum in its column. It is guaranteed that there are exactly $2n$ colorings, including multiplicity.

Claim. There cannot be two squares that are double-colored.

Proof. Suppose that there are two such squares, say containing values $a$ and $b$, respectively. Furthermore, let the numbers in the squares that constitute the other two intersections between those two rows and columns be $c$ and $d$, with $c$ sharing a row with $a$. Then, by definition, we have $$a>c>b \text{ and } a<d<b$$simultaneously, which is obviously impossible. $\blacksquare$

Because no square can be triple-colored, this implies that there are at least $2n-1$ balanced squares. Thus, the number of valid squares is at most $$n^2-k \leq n^2-(2n-1) = (n-1)^2,$$as required.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Taco12
1757 posts
#37 • 1 Y
Y by megarnie
We claim the answer is $(n-1)^2$. Our construction is to keep the bottom right cell as a $0$, the rest of the bottom row as a $-1$, the rest of the rightmost column as a $1$, and the rest of the cells as $0$s. We now show that this is optimal. Note that a square is "bad" (doesn't satisfy the condition) if it is the max in its row and the min in its column.

Claim: At most $1$ square can be the max in its row and the min in its column.
Proof. Assume that there are $2$ such cells, with entries $a$ and $b$. Let the intersection of $a$s row and $b$s column be $c$. Let the intersection of $a$s column and $b$s row be $d$. Then note that we have $$c < a < d, d<b<c,$$a contradiction. $\square$

Thus, there are a maximum of $n^2-(2n-1)=(n-1)^2$ cells satisfying the requirement. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
huashiliao2020
1292 posts
#38
Y by
The answer is $(n-1)^2$. To construct this take a 0 in the top right, -1s in the top row other than that, and 1s in the right column other than that. Now, we complement count. If X and Y are the sets containing the cells such that they're the smallest cell in their column and largest in their row and vice versa, respectively, then |X|+|Y|=2n (for example, for X, in each row there's one cell that satisfies, so in n rows there's n ways).

Now, we prove the intersection of X and Y is at most 1. FTSOC if there were at least two elements, taking the intersections of their 2 rows and 2 columns (let these cells be P and Q) makes two other cells R and S. From the condition of P and Q we know that Q>R>P and P>S>Q, contradiction.

So the complement set union is at least 2n-1, hence the cells that work are at most $n^2-2n+1=(n-1)^2$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Jndd
1417 posts
#39
Y by
The answer is $(n-1)^2$, so let's prove it. A construction to show that's possible is
\begin{align*}
    &1\text{ }\text{ } 1\text{ }\text{ } 1\text{ }\text{ } 2\\
    &1\text{ }\text{ } 1\text{ }\text{ } 1\text{ }\text{ } 2\\
    &1\text{ }\text{ } 1\text{ }\text{ } 1\text{ }\text{ } 2\\
    &0\text{ }\text{ } 0\text{ }\text{ } 0\text{ }\text{ } 1
\end{align*}which is an example for a $4\times 4$ grid, but we can extend this by letting the upper left $(n-1)\times (n-1)$ grid be all $1$s, and extend the bottom row and right column accordingly as well.

Now we consider what happens when the least number of every column and greatest number of every row is distinct. For each row, at least one number must be greater than or equal to its average, and for each column, at least one number must be less than or equal to its average. That makes the number of bad cells at least $2n-\alpha$ where $\alpha=\text{number of cells that are both greater than the row average and less than the column average}$.

Now we show that $\alpha$ is $1$ at maximum. Let $a_1, a_2,\ldots, a_{n-1}$ be the numbers in a row, $c_1, c_2, \ldots, c_{n-1}$ be the numbers in a column, and let $b$ be a cell that's in both the row and the column. Now, let $a_i<b<c_j$ for all $i,j\in\{1, 2, \ldots, n-1\}$, so $b$ counts for $\alpha$. Now, say there was another cell $b'$ that also counter for $\alpha$. That would mean for some $a_i$, we have $a_i$ is in the column of $b'$, and for some $c_j$, we have that $c_j$ is in the row of $b'$, meaning $c_j<b'<a_i$, contradiction. So, $\alpha$ is at most $1$.

So, since the number of bad cells is at least $2n-1$, the number of good cells is at most $n^2-(2n-1)=(n-1)^2$. Now, if the least number from a column or the greatest number from a row wasn't distinct, we can perturb those numbers by a sufficiently small amount so that the state of every cell being good or bad for doesn't change, so we're done.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
joshualiu315
2513 posts
#40
Y by
The answer is $\boxed{n^2-2n+1}$, achievable with the following formation:

$$
\begin{bmatrix}
0&0&0&1\\
0&0&0&1\\
0&0&0&1\\
-1&-1&-1&0
\end{bmatrix}
$$
which is easily generalized to $n>4$.

Notice that there is at most one number that is the least in their column and the most in their row. If there are two, an impossible chain of inequalities arises.

Then, consider the set of numbers that are either the least in their column or the most in their row. There are at least $2n-1$ of them, none of them being able to be $c$. This means the maximum is $n^2-2n+1$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
shendrew7
793 posts
#41
Y by
Claim: There is at most one number which is strictly the greatest in its row and strictly the least in its column.

Suppose FTSOC there exists two numbers $a \ge b$ (obviously in different rows and columns) which satisfies this condition. Then the cell in the same column as $a$ and the same row as $b$ should be greater than $a$ but less than $b$, contradiction. ${\color{blue} \Box}$

Note each number which is the greatest in its row or the least in its column cannot satisfy the problem statement, and PIE tells us there must be at least $2n-1$ of them. Hence the greatest possible number of valid cells is $\boxed{n^2-2n+1}$, which are the 0's in the top left of the following construction:
\[\begin{matrix}
0 & 0 & \cdots & 0 & -1 \\
0 & 0 & \cdots & 0 & -1 \\
\vdots & \vdots & \cdots & \vdots & \vdots \\
0 & 0 & \cdots & 0 & -1 \\
1 & 1 & \cdots & 1 & 0
\end{matrix}\]
This post has been edited 1 time. Last edited by shendrew7, Dec 18, 2023, 1:42 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
RGB
19 posts
#42
Y by
Denote the $i$th row's average as $r_i$ and the $j$th column's average as $c_j$.

For a cell $c_{ij}$ at the intersection of row $i$ and column $j$, the condition given can be represented as $c_{ij} > r_i$ and $c_{ij} < c_j$. We want to maximize the number of cells that satisfy this condition.

Let's consider the strategy to maximize the count of such cells:

Assign the maximum value to the top-left cell $c_{11}$.
Assign increasing values to the first row $r_1$ from left to right.
Assign increasing values to the first column $c_1$ from top to bottom.
This pattern ensures that for any cell $c_{ij}$ beyond the first row and first column, it will have a value greater than the average of its row and less than the average of its column. Therefore, all cells beyond the first row and first column satisfy the given condition.

The count of such cells beyond the first row and first column is $(n - 1) \times (n - 1) = (n - 1)^2$.

Additionally, the top-left cell $c_{11}$ is greater than the averages of both its row and column. Therefore, the total count of cells satisfying the condition is $(n - 1)^2 + 1$.

Hence, the greatest possible number of cells that satisfy the given condition in an $n \times n$ grid of real numbers is $(n - 1)^2 + 1$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
de-Kirschbaum
191 posts
#43
Y by
We claim that the answer is $(n-1)^2$. Let us denote each cell by $a_{11}, a_{12},...a_{1n}, a_{21},...,a_{nn}$. Let us denote the sum of the $i$th row as $r_i$ and the sum of the $i$th column as $c_i$. Note that in any row if we take $n$ cells to be entries satisfying the condition, then we get that $r_i<r_i$ and if we take $n$ cells in a column to be entries satisfying the condition, we get that $c_i>c_i$. Thus, $c \leq (n-1)^2$. We will show by construction that $c=(n-1)^2$ works. If it does, that means the following inequalities are true
$$
(r_1+...+r_{n-1}-a_{1n}-a_{2n}-...-a_{n-1n})<\frac{n-1}{n}(r_1+...+r_{n-1})
$$Note $a_{1n}+a_{2n}+...+a_{n-1n}=c_{n}-a_{nn}$.
Thus
$$
(r_1+..+r_{n-1})<n(c_n-a_{nn})
$$Similarly, $$(c_1+...+c_{n-1})>n(r_n-a_{nn})$$
Summing the two inequalities up and manipulating, we get $c_n>r_n$ which motivates the construction. Consider $a_{nn}=\pi$ (just because it can be anything really). Let every other entry in the n-th column be $\frac{\pi+1}{n-1}$, every other entry in the n-th row be $\frac{\pi-1}{n-1}$. Let every entry in the $(n-1) \times (n-1)$ grid be $\frac{\pi}{n-1}$. Then, we have that every entry in that grid is strictly greater than the average of its column since $\frac{\pi}{n-1}>\frac{\pi+\frac{\pi-1}{n-1}}{n} \implies \pi>\pi-1$. We can check the other condition similarly.
This post has been edited 1 time. Last edited by de-Kirschbaum, Apr 13, 2024, 5:48 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
surpidism.
10 posts
#45
Y by
The answer is $(n-1)^2$. This can be achieved by the following construction:
\[\begin{matrix}
-1 & -1 & \cdots & -1 & 0 \\
0 & 0 & \cdots & 0 & 1 \\
\vdots & \vdots & \cdots & \vdots & \vdots \\
0 & 0 & \cdots & 0 & 1 \\
0 & 0 & \cdots & 0 & 1
\end{matrix}\]
Now we prove that we can't attain more than this.

Call a cell 'good' if entry in it is both strictly greater than the average of its column and strictly less than the average of its row, and remaining cells as 'bad'. Note that maximizing the number of good cells is equivalent to minimizing the number bad cells.
Observe that if an entry in a cell is the smallest in its column or the largest in its row, then it must be a bad cell. And each row and colum has a largest and smallest entry, respectively. Let $a$ be the number of cells that is both the largest in its row and smallest in its columns (these cells are counted twice), then number of bad cells $ \geq 2n - a $.

Claim: $max(a) = 1$
Proof: FTSOC, assume $max(a) > 1$. Then consider any two cells with entries $p$ and $q$ with such property. Clearly, $p$ and $q$ are in differetn rows and columns. Now consider the intersection fo rows and columns containing $p$ and$q$; $r$ be the intersection of row with $p$ and columns with $q$ and $s$ be the other intersection.
We get the inequalities; $ p > r > q$ and $ p < s < q$. Clearly a contradiction.

Hence, number of bad cells $ \geq 2n - 1$ which implies, maximum number of good cells $=  n^2 - (2n -1) = (n-1)^2$, as required. $\square$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ihatemath123
3441 posts
#46
Y by
The answer is $(n-1)^2$, obtained by making the top left square $0$, the rest of the top row $-1$, the rest of the left column $1$ and everything else $0$. All the cells that are not in the top row or leftmost column will satisfy the condition in the problem.

To prove the bound: assume WLOG that all the numbers are distinct. Suppose FTSOC there are two distinct cells $A$ and $C$ which are the largest in the column and smallest in the row. But then consider cells $B$ and $D$ such that $ABCD$ is a rectangle – we have $A > B > C$ and $C > D > A$ simultaneously, which is a contradiction.

So, there are at least $2n-1$ cells which are the largest in the column or the smallest in the row – none of these satisfy the condition in the problem, leaving us with at most $n^2 - 2n + 1$ cells which do.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
PEKKA
1839 posts
#47
Y by
The answer is $(n-1)^2.$
This works by making the top row $0,$ the rightmost column except the top-right square a really big number (call it $N$ for now) and every other entry some positive real a lot smaller than $N.$ Call this other entry $k.$
Notice that every cell filled with $k$ exceeds the average of its column and is under the average of its row, showing that $(n-1)^2$ works.
To see why any larger value fails, notice that by pigeonhole a larger value implies some column contains $n$ numbers that contribute to the total, which means all $n$ elements exceed the average of the $n$ elements, which is a contradiction.
The stuff in red is actually false. Will fix
This post has been edited 1 time. Last edited by PEKKA, Sep 1, 2024, 6:54 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
gladIasked
647 posts
#48
Y by
The answer is $\boxed{(n-1)^2}$.

We can achieve this with the following construction ($n=5$ case):
[asy]
size(5cm); // Default size based on your preference
unitsize(1cm);

for (int i = 0; i < 4; ++i) {
    for (int j = 1; j < 5; ++j) {
        draw(shift(i, j) * unitsquare);
        label("0", (i+0.5, j+0.5), fontsize(10pt));
    }
}
for (int i = 4; i < 5; ++i) {
    for (int j = 1; j < 5; ++j) {
        draw(shift(i, j) * unitsquare);
        label("1", (i+0.5, j+0.5), fontsize(10pt));
    }
}
for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 1; ++j) {
        draw(shift(i, j) * unitsquare);
        label("-1", (i+0.5, j+0.5), fontsize(10pt));
    }
}
draw(shift(4, 0) * unitsquare);
label("1434", (4+0.5, 0.5), fontsize(10pt));
[/asy]
Clearly, all sixteen of the $0$'s satisfy the problem's conditions.

Note that there must be exactly one number in each row that is the largest in the row. Similarly, there must be exactly one number in each column that is the smallest in the column. Also, let there be $x$ numbers that are the largest in their row and the smallest in their column. Thus, we must have at least $2n-x$ numbers (cells) that don't satisfy the problem's conditions.

It's easy to see that $x\le 1$; if $x>1$, then we can choose two such numbers $a$ and $b$ that are the largest in their row and the smallest in their column. Let $c$ be the number in $a$'s column and $b$'s row, and let $d$ be the number in $a$'s row and $b$'s column. Note that $a<c$, $a>d$, $b>c$, and $b<d$. These inequalities tell us that $a>b$ and $a<b$ simultaneously, a contradiction. Therefore, $x\le 1\implies 2n-x\ge 2n-1$.

Our upper bound on the number of cells satisfying the problem's conditions is clearly $n^2-(2n-1)=(n-1)^2$, so we're done. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
akliu
1780 posts
#49
Y by
In every row, there exists at least one number that is greater than the row average. Similarly, in every column, there exists at least one number that is less than the column average. Therefore, there exist at least $2n-1$ tiles that violate the conditions of the grid, giving us a bound of $c \leq (n-1)^2$. This is attainable; consider a grid in which the cells in the bottom row have value $-1$, the cells in the right column have value $1$, and the cell on the bottom right has value $0$.
Z K Y
N Quick Reply
G
H
=
a