text:
Build a Markdown bomb
I'm sure most of us have heard of zip bombs and similar decompression bomb tricks, where a maliciously crafted input creates a massively disproportionate output.  We even had a question on here to do that to a compiler at one point.
Well, it occurs to me that Markdown is a compression format of sorts, replacing bulky HTML tags with "compressed" MD tokens.  Therefore, might it be possible to build a compression bomb in Markdown?
Challenge rules:

The submission should be a piece of markdown text, between 50 and 256 characters in length.  (Imposing a minimum to head off some smart-aleck posting a 3-character response or similar.)

The submission will be processed by StackExchange's Markdown processor as implemented in this site.

Your score will be the ratio of character count in the resulting HTML to the character count of your Markdown text.

Highest score wins.

The Formatting Sandbox may come in handy for people to test before they post an answer.

We might need a standard interpreter / viewer / checker system. People are getting different byte counts for the same code because some tags are / are not showing up.

This is going to devolve into mathjax/latex actual busy beaver code

@isaacg: I'll be impressed if you can come up with something that's worse than linear after trimming indentation.

@Joshua See this answer: https://codegolf.stackexchange.com/a/172523/20080

Should Mathjax actually be allowed? It's not Markdown.

Should we count the rendered HTML or the source HTML? Language highlighting and MathJax are done client-side, not server-side.

Warning: Testing some large answers to this challenge may exhaust your RAM.

@curiousdannii I did say "the markdown interpreter as implemented in this site."  Some SE sites have MathJax support, but I think this isn't one of them, and I've noticed that none of the MathJax examples actually show the rendered output.

@MasonWheeler This list says this site does support Mathjax. But it still doesn't make sense to me for mathjax to be considered markdown just because it can be combined with it. Edit: now I see below that you also don't think it counts. So cool :)

The "rendered or source" issue and whether MathJax is allowed really needs to be clarified. You can't just say "ok this is probably invalid but nice".

Voting to close as unclear. Unfortunately, StackExchange markup rendering is not a consistent interpreter, as it will change over time, and there will be no way to verify old answers once it does, because you cannot link to an old "interpreter".

@Timtech It's weird that OP accepts the highest voted instead of the highest score answer, but "score" != "votes tally". Not a pop-con.

@MasonWheeler You should fix this some way soon or it will be closed. It has 4 close votes already.

@user202729 My bad, looking back I don't know how I got the impression that this was a popularity contest.

Blockquotes, 137,469/256 = 536.99
6,908 characters, 511 new lines, 130,050 spaces
Markdown sure handles nested block-quotes oddly.  Each > character gets turned into

 so a solid 1 to 25 ratio. But wait! When rendering the HTML it also adds two spaces per nesting! Having this try to render causes my browser some grief, and I will keep it in the code-cage for now. Feel free to unlock it yourself!
The code input consists of 255 > followed by & as the last character doesn't transform, but it does get escaped. Thanks BWO ! as the last character which gives the last blockquote the spoiler class with an empty p tag inside. Thanks bta, 11 extra characters
Input:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>!
Output HTML:
...

...

Here is what it looks like in the editor view!

Plotting the results as the number of > increase as suggested by LambdaBeta:

Try plotting the results as you increase the '>' count. I wonder if the renderer will also add the formatting spaces...

The funny thing here is, that the blockquotes nicely overflow the article column at least in the editing preview.

If you add ! before the ampersand, then the last level of blockquote will get  class="spoiler" added to it.  Add it to any other level and it shortens the output, though.

removing one greater than sign loses 1k characters! :0

I'm so ashamed I didn't think of this

@SvenWritesCode - True.  You can also replace the trailing & with ! to get the same effect.

Now this is "arrow code" if I've ever seen it.

Nice. This is quadratic growth because the j-th quote adds O(j) new characters, so we get big-O of 1+2+...+n = O(n^2). You can see this from the picture where the triangle's height is the number of quotes n and its width is O(n), so its area is O(n^2). The other non-Mathjax answers seem to be only linear growth (the billion-laughts MathJax one is exponential).

@usul The shorthand links answer is also quadratic growth; the length of the URL is multiplied by the number of references to it.

MathJax, 529\$\,\$252\$\,\$640ish / 256 ≈ 2\$\,\$067\$\,\$393
A good old thousand-laughs-style code
$$\def\a{}\def\b{\a\a\a\a\a\a\a\a\a\a\a\a\a}\def\c{\b\b\b\b\b\b\b\b\b\b\b}\def\d{\c\c\c\c\c\c\c\c}\d\d\d\d\d\d\d\d$$
multiplies the gross inefficiency of representing exotic characters in MathJax by a considerable factor.
The StackExchange MathJax configuration limitation of 10\$\,\$000 macro expansions is being honored, while the limitations of the client’s browser, which are highly likely to cause problems expanding the macros, are not. (My browser is uncooperative as well, so the figure is an estimate.)

For anyone else wondering: https://en.wikipedia.org/wiki/Billion_laughs_attack

See also: https://github.com/mathjax/MathJax/issues/43

@user202729 my code causes something like 8865 macro expansions, out of 10000 permitted by MathJax as configured on StackExchange. If not for that restriction, less tildes and more nesting levels would produce way more output.

This is a cool find, but it's not Markdown and MathJax is not supported on this site, so it's kind of outside the stated parameters of the rules.

$are^{you^{sure}}$ it’s not supported? The page titled “Markdown Editing Help” at https://codegolf.stackexchange.com/editing-help explicitly mentions LaTeX.

It would be a nice exercise to see what ratio of definition lengths would yield the longest result. How many ~ in \a, how many \a in \b, and so on (and whether to stop at \d, or keep going).

@Arthur do you think the numbers chosen are random? :−)

@RomanOdaisky Not at all. You've probably done the calculation yourself, and reached this conclusion. I'm just saying, as a math teacher and enthusiast, that it seems like it would be a cool exercise.

Hmm. It's easy to make much larger expansion in (La)TeX proper, but all fun seems to be disallowed in MathJax: count registers, conditionals, \expandafter, even \edef.

@RomanOdaisky if you embed a simplified version of the code in your post to demonstrate that the theory works in the specified environment (i.e. "here"), I suspect the debate of "whether or not it's supported" will be a bit easier to resolve.

@KamilDrakari Your wish is my command $\def\a{}\def\b{\a\a}\def\c{\b\b}\def\d{\c\c}\d\d$

Shorthand links: 68,960 / 256 = 269.375
ASCII only: 10,114 / 256 = 39.508
[][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1][][1]
[1]:ftp://^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Output is a sequence of elements that each look like:

After the fixed overhead for creating the URL reference, each 5-character link expands into 42+strlen(url) characters output.  Craft the URL to have the maximum number of characters that need escaping, and this grows to 47+3*strlen(url) characters per link.  A little experimentation showed that the optimal output involved 26 links, with 114 carets per link.
Update:
If you interpret the "256 character" limit to include Unicode characters, you can squeeze out more chaos.  Replacing the carets with the Unicode bathtub character (, codepoint U+1F6C1) results in 47+18*strlen(url) output characters per input character for a total of 54,574 68,960 (thanks to jimmy23013's even-shorter link notation).
Unicode input:
[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1]
[1]:ftp://

Output is a series of:
1,

Welcome to PPCG! This is a very clever answer!

You can use [1],[1],[1]... for the links. 2. " has more characters than %5E in the non-Unicode version.

15888/50 = 317.76: Abuse of MathJaX
This is the code:
$$&$$$$&$$$$&$$$$&$$$$&$$$$&$$$$&$$$$&$$$$&$$$$&$$

This is what it looks like:
$$&$$$$&$$$$&$$$$&$$$$&$$$$&$$$$&$$$$&$$$$&$$$$&$$
The resulting HTML is:

<span class="MathJax" id="MathJax-Element-618-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &amp;</mtext></merror></math>" role="presentation"><nobr aria-hidden="true">Misplaced &</nobr><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &</mtext></merror></math>

<span class="MathJax" id="MathJax-Element-619-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &amp;</mtext></merror></math>" role="presentation"><nobr aria-hidden="true">Misplaced &</nobr><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &</mtext></merror></math>

<span class="MathJax" id="MathJax-Element-620-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &amp;</mtext></merror></math>" role="presentation"><nobr aria-hidden="true">Misplaced &</nobr><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &</mtext></merror></math>

<span class="MathJax" id="MathJax-Element-621-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &amp;</mtext></merror></math>" role="presentation"><nobr aria-hidden="true">Misplaced &</nobr><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &</mtext></merror></math>

<span class="MathJax" id="MathJax-Element-622-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &amp;</mtext></merror></math>" role="presentation"><nobr aria-hidden="true">Misplaced &</nobr><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &</mtext></merror></math>

<span class="MathJax" id="MathJax-Element-623-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &amp;</mtext></merror></math>" role="presentation"><nobr aria-hidden="true">Misplaced &</nobr><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &</mtext></merror></math>

<span class="MathJax" id="MathJax-Element-624-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &amp;</mtext></merror></math>" role="presentation"><nobr aria-hidden="true">Misplaced &</nobr><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &</mtext></merror></math>

<span class="MathJax" id="MathJax-Element-625-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &amp;</mtext></merror></math>" role="presentation"><nobr aria-hidden="true">Misplaced &</nobr><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &</mtext></merror></math>

<span class="MathJax" id="MathJax-Element-626-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &amp;</mtext></merror></math>" role="presentation"><nobr aria-hidden="true">Misplaced &</nobr><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &</mtext></merror></math>

<span class="MathJax" id="MathJax-Element-627-Frame" tabindex="0" style="text-align: center; position: relative;" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &amp;</mtext></merror></math>" role="presentation"><nobr aria-hidden="true">Misplaced &</nobr><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><merror><mtext>Misplaced &</mtext></merror></math>

Don't forget your MathJax folks.
Caveat: The MathJaX only shows the error during editing, so you have to view it in the editor. This is still a markdown implementation on this site, so should be valid. Once posted the Misplaced & warnings turn into normal &'s.

Syntax highlighting, 6376 6464/256 ≈ 25.25
+0.34375 thanks to Ismael Miguel (using a tab instead of 4 spaces)!
This uses the shortest (unfortunately spaces seem to matter) annotation to get syntax-highlighting lang-c, opens a code block and fills it with & and 0:

    &0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0

We start with & because it expands to & and use 0 next, alternating these constantly creates new  elements with a class attribute. Unfortunately we can't use only & or &<&<... since they stay in the same pun-

It produces:

&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0

And rendered by your browser it results in:
&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0

If you look at the source code for this page, the HTML is just
&0&0& ... 0&0&0&
 where ... is more of the same. The span tags aren't there at all. That's a score of 739/256 = 2.887

@EngineerToast: What browser? I'm using Firefox 62 and they show up, I noticed with another answer that I get another score, so I guess this depends on the browser..

Well... That's going to be a problem. I'll ask OP to standardize.

@EngineerToast That's caused by this.

Instead of 4 spaces, use a single tab. It works too!

190/50 = 3.8: Italics
As it turns out, your 3-character worry is true. *q* generates q giving a ratio of 10/3. Two carriage returns give
...
\n\n (the two carriage returns aren't necessary, but do appear to be produced) and a resulting ratio of 9/2. Total ratio, 19/5.
*q*

*q*

*q*

*q*

*q*

*q*

*q*

*q*

*q*

*q*

Resulting html:

q

q

q

q

q

q

q

q

q

q

In action:
q
q
q
q
q
q
q
q
q
q

Using > q to use
 instead of  is better. (note: you do it to every other line, otherwise its just one tag)

@LambdaBeta I didn't even think about Blockquote. Yeah, that one exploded.

222/53 = <4.2: Nasty escapes in an image inclusion.
> ![&](https://&)

![&](https://&)
> ![&](https://&)

Results in:

Resulting HTML should be approximately:

This abuses image inclusion and having to escape things.
It used to be much better, but apparently SE's markdown is sufficiently non-standard to ruin it.
My previous submission (which wasn't how SE rendered it) was:
428/50 = 8.56: Nasty escapes in an image inclusion.
![&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&](&)
Resulting HTML should be approximately:

This abuses the fact that most markdown editors will replace the ampersands in the alt text with doubly-escaped ampersands in order for it to show up correctly. Meanwhile a single ampersand is tossed into the src section so that the parser will actually see it as an image.

Would ε be translated to ε or ε?

I don't know. As far as I can tell it doesn't actually work - debugging it a bit now. I used & because in theory for alt-text to show up correctly it has to be escaped twice (&). This works in most markdowns, but doesn't seem to produce any output at all in SE...

Couldn't you compress this with [1]:https://& on a line, and then use ![&][1] more times?

Does it really have to be https? http would give you less unexpanded characters. Or ftp if that works.

MathJax: 13,579 / 52 = 261.13
\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$

Just creates a bunch of empty in-line MathJax:
\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$
HTML Code (can inspect on the empty space above):

<span class="MathJax" id="MathJax-Element-1064-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" />" role="presentation" style="position: relative;"><nobr aria-hidden="true"></nobr><math xmlns="http://www.w3.org/1998/Math/MathML"></math><span class="MathJax" id="MathJax-Element-1065-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" />" role="presentation" style="position: relative;"><nobr aria-hidden="true"></nobr><math xmlns="http://www.w3.org/1998/Math/MathML"></math><span class="MathJax" id="MathJax-Element-1066-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" />" role="presentation" style="position: relative;"><nobr aria-hidden="true"></nobr><math xmlns="http://www.w3.org/1998/Math/MathML"></math><span class="MathJax" id="MathJax-Element-1067-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" />" role="presentation" style="position: relative;"><nobr aria-hidden="true"></nobr><math xmlns="http://www.w3.org/1998/Math/MathML"></math><span class="MathJax" id="MathJax-Element-1068-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" />" role="presentation" style="position: relative;"><nobr aria-hidden="true"></nobr><math xmlns="http://www.w3.org/1998/Math/MathML"></math><span class="MathJax" id="MathJax-Element-1069-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" />" role="presentation" style="position: relative;"><nobr aria-hidden="true"></nobr><math xmlns="http://www.w3.org/1998/Math/MathML"></math><span class="MathJax" id="MathJax-Element-1070-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" />" role="presentation" style="position: relative;"><nobr aria-hidden="true"></nobr><math xmlns="http://www.w3.org/1998/Math/MathML"></math><span class="MathJax" id="MathJax-Element-1071-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" />" role="presentation" style="position: relative;"><nobr aria-hidden="true"></nobr><math xmlns="http://www.w3.org/1998/Math/MathML"></math><span class="MathJax" id="MathJax-Element-1072-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" />" role="presentation" style="position: relative;"><nobr aria-hidden="true"></nobr><math xmlns="http://www.w3.org/1998/Math/MathML"></math><span class="MathJax" id="MathJax-Element-1073-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" />" role="presentation" style="position: relative;"><nobr aria-hidden="true"></nobr><math xmlns="http://www.w3.org/1998/Math/MathML"></math><span class="MathJax" id="MathJax-Element-1074-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" />" role="presentation" style="position: relative;"><nobr aria-hidden="true"></nobr><math xmlns="http://www.w3.org/1998/Math/MathML"></math><span class="MathJax" id="MathJax-Element-1075-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" />" role="presentation" style="position: relative;"><nobr aria-hidden="true"></nobr><math xmlns="http://www.w3.org/1998/Math/MathML"></math><span class="MathJax" id="MathJax-Element-1076-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML" />" role="presentation" style="position: relative;"><nobr aria-hidden="true"></nobr><math xmlns="http://www.w3.org/1998/Math/MathML"></math>

You can get more with errors. Take a look at my answer.

4830 / 256 = 18.87
[1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1](http://localhost:8080/welcome-to-my-fantastic-amazing-homepage-and-why-not-share-it-to-your-facebook-right-now.html)

An idea based on HTML autocorrect. Not quite high score though.

421 / 56 = 7.518
>&

&
>&

&
>&

&
>&

&
>&

&
>&

&
>&

Which produces the following HTML on SE:

&

&

&

&

&

&

&

&

&

&

&

&

&

... and the following output:

&

&

&

&

&

&

&

&

&

&

&

&

&

11190 / 255 = ~43.88
I was inspired by this top answer, but am too dumb to beat it and reached the max character count so, I guess I'll have to be satisfied with what I have ¯\_(ツ)_/¯. There's actually two spaces after the last blockquote, but the formatting does not show it.
> - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - >
HTML:

the code itself looks like a blockquote


text:
A sorcerer's spellbook
Edit: I haven't played D&D before so when I initially made this question I didn't properly research it. I apologize for this, and I'm making a few edits that might invalidate answers to stay as true as possible to the dnd 5e rules. Sorry.

A D&D fan from a recent Hot Network Question seems to have some trouble working out whether a sorcerer's chosen spells line up with the possibilities - and I think we should help!
Introduction
(all of this is already described in the previously mentioned question)
A sorcerer knows two level 1 spells from start (level 1): [1, 1]

Every time a sorcerer gains a level (except for levels 12, 14, 16, 18, 19 and 20) they learn a new spell (mandatory).
Additionally, when leveling up one can choose (optional) to replace one of the spells with another.

The spells learned and replaced must be a valid spell slot level which is half your sorcerer's level rounded up. See this table:
Sorcerer level  Highest spell level possible
1               1
2               1
3               2
4               2
5               3
6               3
7               4
8               4
9               5
10              5
11              6
12              6
13              7
14              7
15              8
16              8
17              9
18              9
19              9
20              9

This means at level 3 one can have the spell levels [1, 1, 2, 2] like this:
Level 1: [1, 1] (initial)
Level 2: [1, 1, 1 (new)]
Level 3: [1, 1, 2 (replaced), 2 (new)]

It is not required to pick the highest level spells you have access to.
The spell levels [1, 1, 1, 1] are perfectly valid for a level 3.
Lastly, remember that replacing a spell is an optional option for every level. This means that some levels could skip the replace, while others make use of it.
The challenge
Make a program or function that takes an integer (level) between 1 and 20.
It should also take an array of integers (spell levels) with values ranging from 1 to 9 in any order (9 is the maximum spell level).
The output of the program should be a truthy/falsy value validating if the chosen spell levels are valid for a sorcerer of the given level.
Test cases
Level: 1
Spells: [1, 1]
Output: true

Level: 8
Spells: [1, 1, 2, 3, 3, 5]
Ouput: false

Reason: A level 8 can't ever have access to a level 5 spell.

Level: 5
Spells: [1, 1, 1, 2, 2, 2, 3]
Output: false

Reason: A level 5 can't have access to 7 spells

Level: 11
Spells: [3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6]
Output: false

Reason: Too many spell upgrades.
        The highest valid selection for level 11 is
        [3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6]

This is code-golf - fewest bytes wins!

Can we take the spell list sorted how we want it?

What is the maximum spell level for each class level?

@Nitrodon I presume 19?

@Nitrodon, presumably it's 9 given that the array input can only contain "values ranging from 1 to 9" but the maximum spell level we need to handle should be stated more explicitly in the spec. And it could do with a couple more test cases. Nice challenge, otherwise.

"It should also take an array of integers (spell levels) with values ranging from 1 to 9 (in any order)" - what about levels 10-19? 2. "However at level 4 the spell levels [2,2,3,3] would not be possible as it requires more replacing than a sorcerer of that level would have access to." - isn't the fact that the list is length 4 rather than 5 a more fundamental reason here? (I assume [1,3,2,2,3] is possible for a level 4 by going from the level 3 [1,1,2(replaced),2(new)] to [1,3(replaced),2,2,3(new)]?)

Do you mean the maximum spell level is 9, such that upon becoming level n there is an option to upgrade any spell to any level up to min(9,n-1) and upon becoming level n, excluding those listed, a spell is (always?*) acquired up to min(9,n-1)? 2. I would think [1,2,2,3,3] would be possible at level 4 (see the parenthesised part at the end of my previous comment). * That is - 3. are acquisitions of spells at the levels not listed mandatory or optional?

Is it possible to have more test cases? The test cases seem a bit light in regards to the complexity of the question.

I'm looking at the table from the linked answer where it says that the maximum for level 4 is [2, 2, 2, 2, 1]. I'm confused as to why it can't be [3, 3, 2, 2, 1]? What you would do is take [2, 2, 1, 1], adding a spell of level 3 and upgrading the last spell to level 3.

@CameronAavik At level 4, you don't have access to level 3 spells. So you gain a new spell, but it may only be of level 1 or 2.

The question states that "they learn a new spell that must be below their current level". If they are level 4 how come they can't access a level 3 spell?

That's probably a bad wording, if the OP wants to follow D&D rules. If OP wants to follow D&D, then the wording must be changed. If the OP wants to make their own rule, then my answer is invalid.

This challenge currently ignores the levels at which sorcerers actually get the higher-level spell slots. A level 10 sorcerer in DnD cannot cast a level 9 spell. Is this intentional?

It would be good to have some test cases for the higher levels, when the spells are not given every level.

Java (JDK), 99 bytes
s->l->{var r=s.length!=l+1-l/12*(l-10)/2-l/19;for(var z:s)r|=z>(++l>30?9:l+(2<<l/25)>>2);return!r;}

Try it online!
Credits

Port of Arnauld's JavaScript answer.
However, the l+1-l/12*(l-10)/2-l/19 part is a shortening in Java for (l<12?l:l>16?14:l+11>>1)+1 which can't be done in JavaScript because it doesn't round to the floor integer.

Previous answer:
Java (JDK 10), 191 bytes
L->S->{int m[]=new int[9],z=0,Z=0,l=0;for(m[0]++;l++<L;z+=--m[z]<1?1:0)m[Z=~-l/2-l/19]+=l<12?2:l>17?1:1+l%2;l=0;for(int s:S){if(--s>Z)l++;Z-=--m[Z>0?Z:0]<1?1:0;}for(int i:m)l|=i;return l==0;}

Try it online!

Input requirement: the spell list must be ordered from greatest spell levels to the lowest one.

Explanations
L->S->{                                        // Curried-lambda with 2 parameters: sorcerer-level and spell list
 int m[]=new int[9],                           // Declare variables: m is the max level  of each spell.
     z=0,                                      // z is the minimum spell level of the maximized spell list.
     Z=0,                                      // Z is the maximum spell level for the current level.
     l=0;                                      // l is first a level counter, then a reused variable
 for(m[0]++;l++<L;z+=--m[z]<1?1:0)             // for each level, compute the maximized known spells.
  m[Z=~-l/2-l/19]+=l<12?2:l>17?1:1+l%2;        //
                                               // Now m is the row for level L in the table below.
 l=0;                                          // l now becomes an error indicator
 for(int s:S){                                 // This loop checks if the spell-list matches the spells allowed for that level.
  if(--s>Z)l++;                                // Spell-levels are 1-based, my array is 0-based so decrease s.
  Z-=--m[Z>0?Z:0]<1?1:0;                       // Remove a max level if we've expleted all the spells, avoiding exception.
 }                                             //
 for(int i:m)l|=i;                             // Make sure there are no more values in m.
 return l==0;                                  // Return true if no miscount were encountered.
}

Table 1: Maximized spell distribution for each sorcerer-level, used from Axoren's answer on the linked question.

Credits

Saved 14 bytes thanks to Kevin Cruijssen.

return l<1&java.util.Arrays.equals(m,new int[9]); can be z=0;for(int i:m)z+=i;return l+z==0; instead. Or if the values in m can never be negative at the end, the ==0 can be <1.

@KevinCruijssen Thanks! And that leaved room to fix a bug with too many spells in the list.

Ah, for(int i:m)l|=i; is even smarter! Nice one.

I'm sure the last two loops can be combined, I just don't know how right now.

If I pass in L=20 and S=[5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9] which is the maximum as per the table, I get false instead of true.

@CameronAavik You probably passed it with numbers ordered ascending (new int[]{5,6,6,6,7,7,7,8,8,8,9,9,9,9,9}). If I input them descending (new int[]{9,9,9,9,9,8,8,8,7,7,7,6,6,6,5}, as written in the input requirement I wrote below the golf), it works. I added the test case to show that it indeed works.

I'm being cited in a CodeGolf answer. I never thought I'd see the day.

Charcoal, 51 bytes
Ｎθ≔⁺✂⭆”)⊟⊞<⁴H”×ＩκＩιθ⎇‹θ¹²⊕⊗θ⁺⁶⁺θ⊘⁺‹θ¹⁹θ¹0θ¬ΣＥＳ›ι§θκ

Try it online! Link is to verbose version of code. Takes spell levels in ascending order as a string. Explanation:
Ｎθ

Input the level.
≔⁺✂⭆”)⊟⊞<⁴H”×ＩκＩιθ⎇‹θ¹²⊕⊗θ⁺⁶⁺θ⊘⁺‹θ¹⁹θ¹0θ

Perform run-length decoding on the string 0544443335 resulting in the string 11111222233334444555566677788899999. This string is then sliced starting at the level (1-indexed) and ending at the doubled level (if less than 12) or 6+1.5*, rounded up, except for level 19, which is rounded down. A 0 is suffixed to ensure that there are not too many spells.
¬ΣＥＳ›ι§θκ

Compare the spell levels against the substring and prints a - if none of them are excessive.

I think that this fails for lengths less than they must be, as I think spell acquisition is mandatory at the levels not listed; I have asked for clarification though.

Also seems to fail for 11113 at level 4 which is the result of no optional upgrades, taking 1 at level 2, 1 at level 3 and 3, at level 4.

@JonathanAllan Your maximum spell level is the ceiling of half of your character level (or 9, as that's the maximum possible). Maybe the question didn't make that clear.

(Basically I've followed the answers in the linked question as to what the possible spell levels are.)

I dont want to try to understand and reconcile two specifications, the OP has confirmed min(9,n-1) in comments. Maybe query this there...

Python 3, 98 bytes
v=lambda L,S:(max(S)*2-2<L)&v(L-1,[1]+sorted(S)[:(chr(L*3)in'$*069<')-2])if L>1else(1,1)==tuple(S)

Try it Online!
Ungolfed:
def v(L, S):
    # recursion base case
    if L <= 1:
        return tuple(S) == (1, 1)
    # if the highest level skill is not valid for the level, then return False.
    if max(S)*2 - 2 < L:
        return False
    # hacky way to determine if the level gets a new skill
    has_new_skill = chr(L*3) in '$*069<'
    sorted_skills = sorted(S)
    # this step removes the highest skill and adds a level 1 skill (replacement)
    # if there is a new skill, then it removes the second highest skill as well
    new_skills = [1] + sorted_skills[:has_new_skill - 2]
    return v(L-1, new_skills)

edit: corrected solution to use correct D&D rules

I +1'ed, though print(v(20, [6,6,6,6,7,7,7,8,8,8,9,9,9,9,9])) # False prints true. It should print false.

@OlivierGrégoire I am using OP's rules for what skill levels are valid in the supplied code. See the note at the bottom of the post which shows the modification to make to use the real DnD rules.

Oh, my bad. Sorry. The output is correct with that change.

Well, it's settled: it's the D&D rule that needs to be applied, not the min(9,n-1) one.

JavaScript (ES6),  79  78 bytes
Takes input as (level)(array). Returns \$0\$ or \$1\$.
l=>a=>!a.some(x=>x>(j--,++l>30?9:l+(2<<l/25)>>2),j=l<12?l:l>16?14:l+11>>1)&!~j

Try it online!
Test code
Below is a link to some test code that takes the sorcerer level as input and returns an array of maximum spell levels, using the same logic as the above function.
Try it online!
How?
Reference table
 Sorcerer level | # of spells | Maximum spell levels
----------------+-------------+-------------------------------
        1       |      2      | 1,1
        2       |      3      | 1,1,1
        3       |      4      | 1,1,2,2
        4       |      5      | 1,2,2,2,2
        5       |      6      | 2,2,2,2,3,3
        6       |      7      | 2,2,2,3,3,3,3
        7       |      8      | 2,2,3,3,3,3,4,4
        8       |      9      | 2,3,3,3,3,4,4,4,4
        9       |     10      | 3,3,3,3,4,4,4,4,5,5
       10       |     11      | 3,3,3,4,4,4,4,5,5,5,5
       11       |     12      | 3,3,4,4,4,4,5,5,5,5,6,6
       12       |     12      | 3,4,4,4,4,5,5,5,5,6,6,6
       13       |     13      | 4,4,4,4,5,5,5,5,6,6,6,7,7
       14       |     13      | 4,4,4,5,5,5,5,6,6,6,7,7,7
       15       |     14      | 4,4,5,5,5,5,6,6,6,7,7,7,8,8
       16       |     14      | 4,5,5,5,5,6,6,6,7,7,7,8,8,8
       17       |     15      | 5,5,5,5,6,6,6,7,7,7,8,8,8,9,9
       18       |     15      | 5,5,5,6,6,6,7,7,7,8,8,8,9,9,9
       19       |     15      | 5,5,6,6,6,7,7,7,8,8,8,9,9,9,9
       20       |     15      | 5,6,6,6,7,7,7,8,8,8,9,9,9,9,9

Number of spells
For a sorcerer of level \$L\$, the number of spells \$N_L\$ is given by:
$$N_L=\begin{cases}
L+1&\text{if }L<12\\
\lfloor(L+13)/2\rfloor&\text{if }12\le L\le 16\\
15&\text{if }L>16
\end{cases}$$
In the code, the variable \$j\$ is initialized to \$N_L-1\$ and decremented at each iteration while walking through the input array. Therefore, we expect it to be equal to \$-1\$ at the end of the process.
Maximum spell levels
Given a sorcerer level \$L\$ and a spell index \$1\le i \le N_L\$, the maximum level \$M_{L,i}\$ of the \$i\$-th spell is given by:
$$M_{L,i}=\begin{cases}
\lfloor(L+i+2)/4\rfloor&\text{if }L+i<25\\
\lfloor(L+i+4)/4\rfloor&\text{if }25\le L+i\le 30\\
9&\text{if }L+i>30
\end{cases}$$
Each value \$x\$ of the input array \$a\$ is compared with this upper bound.

Groovy, 155 bytes
def f(int[]a, int b){l=[1]
b.times{n->l[0]=++n%2?n/2+1:n/2
if(n<18&(n<12|n%2>0))l.add(l[0])
l.sort()}
for(i=0;i<a.size();)if(a[i]>l[i++])return false
true}

Generates the best possible spellbook, then checks that the spellbook passed into the method is not better.
Ungolfed, with implicit types made explicit:
boolean spellChecker(int[] a, int b) {
    // l will be our best possible spellbook
    List<BigDecimal> l = [1]
    b.times { n ->
        n++ // iterate from 1 to b, not 0 to b-1
        l[0] = n % 2 != 0 ? n / 2 + 1 : n / 2 // update the lowest value to the best permitted
        if (n < 18 & (n < 12 | n % 2 > 0))
            l.add(l[0]) // if permitted, add another best spell
        l.sort() // ensure 0th position is always worst, ready for updating next loop
    }
    for (int i = 0; i < a.size(); i++)
        if (a[i] > l[i]) // if the submitted spell is of a higher level
            return false // also rejects when l[i] is undefined. (too many spells)
    return true
}

Try it online!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Removing points from a triangular array without losing triangles
I have a combinatorics problem that I'd like to put on the OEIS—the problem is that I don't have enough terms. This code challenge is to help me compute more terms, and the winner will be the user with the submission containing the greatest number of terms.

The Problem
Suppose I give you a triangular array of light bulbs with side length \$n\$:
     o
    o o
   o o o
  o o o o
 o o o o o
o o o o o o
1 2  ...  n

I'm going to turn on three lightbulbs that form an "upright" equilateral triangle as in the following example:
     o
    o x
   o o o
  o o o o
 o x o o x
o o o o o o

Before I turn on the lights, your job is to remove as many lightbulbs as possible from the array—without losing the ability to deduce the triangle of bulbs that has been turned on. To be clear, if a lightbulb has been removed, it is not lit up when its position is turned on.
For example, if you removed the following bulbs (marked by .) you would only see the following two lights turn on (marked by x), which is enough uniquely deduce the third (unlit) position:
     .              .
    . o            . x
   . . o          . . o
  o o o .   =>   o o o .
 o o o o .      o x o o . <- the third unlit position
o . . . o o    o . . . o o

Let a(n) be the maximum number of bulbs that can be removed without introducing any ambiguities.

Example
With a naive algorithm, I have checked values up to a triangle with side length 7, as seen below:
                                                                      .
                                                      .              . o
                                        .            . o            o . o
                           .           . .          . . o          . o o .
              .           . .         . o o        o o o .        o o . o .
 .           . .         . o o       o o . o      o o o o .      o . o . o o
. .         . o o       . o o o     o . . o o    o . . . o o    o . o . o o o

a(2) = 3    a(3) = 4    a(4) = 5    a(5) = 7     a(6) = 9       a(7) = 11

Scoring
The submission that computes the sequence [a(2), a(3), ..., a(n)] for the largest n wins. If two submissions have identical sequences, then the one that was posted earlier wins.
Although not necessary for the submission, it would be instructive to me if you post a construction of the resulting triangluar arrays, as in the example above.

Isn't this a code-challenge rather than fastest code?

I think you should pick a time limit (say, 60s) so the contest isn't about how long someone spent running their code.

Nice problem. What do you mean by "upright" triangle?

Python 3, n=8
import itertools
from ortools.sat.python import cp_model

def solve(n):
    model = cp_model.CpModel()
    solver = cp_model.CpSolver()
    cells = {
        (y, x): model.NewBoolVar(str((y, x)))
        for y in range(n) for x in range(y + 1)}
    triangles = [
            {cells[v] for v in ((y1, x1), (y2, x1), (y2, x1 + y2 - y1))}
            for (y1, x1) in cells.keys() for y2 in range(y1 + 1, n)]
    for t1, t2 in itertools.combinations(triangles, 2):
        model.AddBoolOr(t1.symmetric_difference(t2))
    model.Minimize(sum(cells.values()))
    solver.Solve(model)
    return len(cells) - round(solver.ObjectiveValue())

for n in itertools.count(2):
    print('a(%d) = %d' % (n, solve(n)))

Uses Google OR-Tools' CP-SAT solver.
After running for ~30 seconds, it outputs the following:
a(2) = 3
a(3) = 4
a(4) = 5
a(5) = 7
a(6) = 9
a(7) = 11
a(8) = 13

I didn't event try to wait for n=9 as it would probably take hours (the number of constraints grows like \$n^6\$). After less than 30 minutes of computation I found out that a(9)=15. I'm leaving my score as n=8 because at the moment the time constraints are unclear, but half an hour is probably too long.
How it works
Take two distinct equilateral triangles \$T_1\$ and \$T_2\$. To avoid ambiguity, there should be at least one bulb on a vertex belonging to exactly one of \$T_1\$ and \$T_2\$.
Thus the question may be rephrased as a SAT problem, with one constraint for every pair of triangles.
PS:
I would very much like to include an example for n=8, but I'm having issues with the SAT solver which apparently wants to keep the solutions all for itself.

I decide to port the solution to Mathematica, which is unfortunately slower.

Getting the solutions from @Delfad0r's program
I extended @Delfad0r's program to output solutions.
It also gives intermediate results, so you get output like this:
Solving n = 8:
a(8) >= 9
a(8) >= 10
a(8) >= 11
a(8) >= 12
a(8) >= 13
       o
      . o
     . o o
    . o o .
   o o . o o
  o o o o . .
 o . . o o o .
o . . o . o o o
a(8) = 13

Solving n = 9:
a(9) >= 10
a(9) >= 13
a(9) >= 14
a(9) >= 15
        o
       o o
      o . .
     o . o o
    . o . o o
   . o o o o o
  o o o . o . .
 o o o . . . o o
. o o o o o o . .
a(9) = 15

This computation took several hours.
If you get impatient and press Ctrl-C after some possibly non-optimal solution was found, the program will show that solution. So it doesn't take long to get this:
                   .
                  o o
                 . o o
                . o o o
               o o . o o
              o . o o o .
             o . o . o o o
            . o o o o o . o
           o . . o o o o o o
          o o o o o o o o o .
         o o . o o o o . o o o
        o o o o o o . o . o o o
       o . o o . o o o o o o o o
      o o o . o o o o o . o o o o
     o o o . o o o o o o o o . . o
    o o o o o o o o o o o . o . . o
   o o o o . o o o o . o o o o o . o
  o o o o o o o o . o o . . o o o o .
 o o o o . o o . o . o o o o o o . o o
o o . o o . o o o o . o o o . o o o o o
a(20) >= 42

Here is the extended program:
import itertools
from ortools.sat.python import cp_model

class ReportPrinter(cp_model.CpSolverSolutionCallback):

    def __init__(self, n, total):
        cp_model.CpSolverSolutionCallback.__init__(self)
        self.__n = n
        self.__total = total

    def on_solution_callback(self):
        print('a(%d) >= %d' %
              (self.__n, self.__total-self.ObjectiveValue()) )

def solve(n):
    model = cp_model.CpModel()
    solver = cp_model.CpSolver()
    cells = {
        (y, x): model.NewBoolVar(str((y, x)))
        for y in range(n) for x in range(y + 1)}
    triangles = [
            {cells[v] for v in ((y1, x1), (y2, x1), (y2, x1 + y2 - y1))}
            for (y1, x1) in cells.keys() for y2 in range(y1 + 1, n)]
    for t1, t2 in itertools.combinations(triangles, 2):
        model.AddBoolOr(t1.symmetric_difference(t2))
    model.Minimize(sum(cells.values()))
    print('Solving n = %d:' % n)
    status = solver.SolveWithSolutionCallback(model, ReportPrinter(n,len(cells)))
    if status == cp_model.OPTIMAL:
        rel = '='
    elif status == cp_model.FEASIBLE:
        rel = '>='
    else:
        print('No result for a(%d)\n' % n)
        return
    for y in range(n):
        print(' '*(n-y-1), end='')
        for x in range(y+1):
            print('.o'[solver.Value(cells[(y,x)])],end=' ')
        print()
    print('a(%d) %s %d' % (n, rel, len(cells) - solver.ObjectiveValue()))
    print()

for n in itertools.count(2):
    solve(n)

Python 3
Based strongly on Delfad0r's answer, mostly follows the same logic progression by checking triangle pairs and validating the configuration if it contains no triangle pairs that fail this validation. Since I didn't use any libraries besides itertools and copy, I have full control over saving the examples encountered throughout the program.
examples = dict() # stores examples by key pair of n to a tuple with the triangle and number of lights turned off

for n in range(3, 8):
    tri = [] # model of the triangle, to be filled with booleans representing lights
    tri_points = [] # list of tuples representing points of the triangle
    for i in range(n):
        tri.append([True]*(i + 1))
        for j in range(i+1):
            tri_points.append((i, j))

    t_set = [] # list of all possible triangles from tri, represented by lists of points
    for i in range(n):
        for j in range(len(tri[i])):
            for k in range(1, n - i):
                t_set.append([(i, j), (i + k, j), (i + k, j + k)])

    from itertools import combinations
    import copy

    # validates whether or not a triangle of n lights can have i lights turned off, and saves an example to examples if validated
    def tri_validate(x):
        candidate_list = list(combinations(tri_points, x))
        tri_pairs = list(combinations(t_set, 2))
        for candidate in candidate_list:
            temp_tri = copy.deepcopy(tri)
            valid = False
            for point in candidate:
                (row, col) = point
                temp_tri[row][col] = False
            for pair in tri_pairs:
                valid = False
                (tri1, tri2) = pair
                for point in tri1:
                    if not valid:
                        if point not in tri2:
                            (row, col) = point
                            if temp_tri[row][col]:
                                valid = True
                for point in tri2:
                    if not valid:
                        if point not in tri1:
                            (row, col) = point
                            if temp_tri[row][col]:
                                valid = True
                if not valid:
                    break
            if valid:
                examples[n] = (temp_tri, x)
                return True
        return False

    # iterates up to the point that validation fails, then moves on to the next n
    for i in range(len(tri_points)):
        if tri_validate(i + 1):
            continue
        break

Problem is, it's not very efficient. It runs really fast up to n=5, but starts to slow down significantly past that point. At n=6, it takes around a minute to run, and it's much slower at n=7. I imagine there are a lot of efficiency fixes that can be made with this program, but it's a quickly made rough draft of a good solution with a lot more flexibility to check out the inner workings of this method. I'll be incrementally working on this over time.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
You failed everything!
Your goal is simple: to fail everything. More precisely, you should write the shortest code that triggers a compilation/interpretation error, or a runtime error.
What does not count

Failing with symbols that are not covered by the language syntax and are meant to appear only in string literals, comments and other ways to include non-executable data in the code, or are not meant to appear in the code at all
Warnings and notices that don't prevent successful compilation or execution
Overflow related errors: infinite loops, recursion limits reaching, stack overflows, out-of-memory errors and so on

This is code-golf, so the shortest code in bytes wins!
By the way, this is probably the only challenge where non-esoterical languages can beat esoterical ones ;-)

What's wrong with overflow errors?

Also, almost every answer is going to be a boring one or zero byte syntax error...

@JoKing the focus is on making a program that is totally erroneous, not just implementing a wrong behaviour or striving from finite resources.

@bodqhrohro The way code golf works is that people post the shortest answer they can find that follows the rules. Whatever you think the focus is meant to be, the winningest answers are blank programs or one-characters syntax errors, so that's what people will post.

What do you mean by "symbols that are not covered by the language syntax"? Is a symbol only valid in string literal considered "not covered by the language syntax"?

@tsh yes, such symbols don't count.

Polyglot, 0 bytes
This is a list of languages where an empty program gives an error.

C/C++/Objective-C: Any compiler will complain not having a main, and emit a link error.

C (gcc), C (tcc), C (clang), C++ (gcc), C++ (clang), Objective-C (gcc), Objective-C (clang)
shortC

Java: It's an error to not have a class to run.

Java (JDK), Java (OpenJDK)
Kotlin
Scala

C#: Requires a static Main method.

.NET Core, Mono, Visual C#

Pascal: Not having a BEGIN to begin with is an error.

Pascal, Object Pascal

Visual Basic: Unlike other Basics, VB requires to have a Sub Main to run.

.NET Core, Mono, VBC

Other languages that require some kind of main to compile and run.

B
D
Dart
Fortran (gfortran)
Go
Vala
(Add language here)

Languages that require specific syntax elements to run correctly.

ArnoldC
Shakespeare Programming Language
Whitespace
Taxi
(Add language here)

Languages that specifically reject empty files.

Chapel
(Add language here)

Languages that segfault or otherwise show erroneous behavior with empty files. Some of these might be actually a bug in the compiler/interpreter.

Backhand: Tries to access the first instruction and throws an error.
Check is similarly bugged with empty code.
ecpp segfaults when an empty program is given.
Seed always gives error if the code isn't two integers with a space between them.
(Add language here)

plenty of javas error too as "File xxx.java does not have public class xxx" or something like that

Hey my own esolang falls under the last category, I should probably fix that

60% of all coding languages, 1 byte
+ or - or / or * or % or any valid token etc.
To complement Bubbler's answer.

Ah, so the only two answers needed.

Polyglot, 1 byte
a

This gives undefined identifier error in many interpreted languages.

Python
Javascript
APL
J
(Add language here)

Polyglot, 1 byte
+

This gives syntax error in many languages.

(Add language here)

Polyglot, 1 byte
'

This gives open string literal error in many languages.

(Add language here)

Polyglot, 1 byte
[

This gives open bracket error in many languages. (Feel free to change to ( or { if some languages specifically error with it.)

(Add language here)

Racket / Scheme / Lisp / Others?: 1 byte
) Will give an error for mismatched parentheses

Ahead, 1 byte
/

Tries to do 0/0. Reference implementation on TIO will fail with:
Exception in thread "main" java.lang.ArithmeticException: / by zero
        at ajc2.ahead.Head.doCell(Head.kt:148)
        at ajc2.ahead.Head.step(Head.kt:31)
        at ajc2.ahead.Runner.go(Runner.kt:6)
        at ajc2.ahead.MainKt.main(Main.kt:13)

Try it online!

Attache, 1 byte
/

Try it online!
Crashes with:
AttacheUnimplementedError: (1:1) / is not defined for `NilClass`


text:
Counting Squares
We've all seen the pictures captioned "How many squares are in this image? 98% will not get this right!" Well, here's your chance to laugh at that 98%.
Input
A rectangular block made of only 2 characters. In a general form, this is defined by m lines, each containing n characters.
Example:
0000xxx
00x00xx
00000xx
xxxxx0x

This can be represented as a newline-separated string, an array of strings, or a 2D array of characters. Any other input types should be suggested in the comments.
Output
The output will be an integer representing the total amount of squares represented individually by both characters (in pseudocode, num_squares(char1) + num_squares(char2))
A square is defined as a set of instances of the same character that fully outline a geometric square of side length at least 2. These squares need not be filled by the character that outlines it. The following examples illustrate this concept:
x0
0x    // no squares

xxx
x0x
xxx   // 1 square of side length 3

0000
0xx0
0xx0
0000  // 1 square of side length 2, 1 square of side length 4

Scoring
Your program will be scored by 2 criteria, in descending order of importance:

Number of characters in your code block that aren't part of a square, as defined above (you should aim to minimize this!) (Note: characters inside of a square are not automatically considered as part of that square) (Note 2: newlines do not count toward this score)
Number of bytes (you should aim to minimize this!)

The second criterion will act as a tie breaker for the first.
Challenge Rules

For the sake of flexibility, you may choose to use any 2 alphanumeric characters to replace the 0 and x from my examples, as long as they are not the same character.
Each line in the input rectangle must have the same length, and must not contain any character other than the 2 specified for your answer to the challenge (besides the newline character, if applicable)
Trivial squares (1x1 squares denoted by a single character) do not count toward the output. They suck.
Your program does not have to handle empty input, but it should handle cases where no squares are possible (when one of the dimensions of the input rectangle is 1)
You may also choose to specify that you are handling diagonally aligned squares if you relish the challenge. This would be added to the output specified in the challenge specs.

Example of this concept:
Input:

00x00
0x0x0
x000x
0x0x0
00x00

Output: 6 (1 diagonally aligned square of side length 3, 5 diagonally aligned squares of side length 2)

Test Cases
The following are some basic test cases that your program should match. The value in parentheses is the output should you choose to count diagonally aligned squares.
Input:

xxxx
x00x
x0xx
xxxx

Output: 2 (2)

Input:

x00000xxx0

Output: 0 (0)

Input:

xxx0x0x000xx0xx0
0x000x00x0x0xx00
00xx0xx00xx0000x
x0x0x0x0x00x0xxx
00xx0xxx00xxx0x0

Output: 0 (5)

Input:

0000
0000
0000
0000
0000
0000

Output: 26 (34)

Input:

xxx00
xx000

Output: 2 (2)

General rules

Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code.
Adding an explanation for your answer is highly recommended.
Any questions/corrections/advice for me? Comment below! This is my first question, so I'm excited to learn as much from it as possible.

How does the number of squares in your code affect your score (I feel like having squares should reduce your score)? This should also be tagged [tag:code-challenge] instead of code-golf because the scoring isn't just length.

Scoring criteria is now primarily based on squares and ties are broken by byte count. Thanks for the feedback!

Does that mean that some very lengthy code with $N$ squares beats any shorter code with less than $N$ squares?

Not necessarily. The scoring metric counts the number of characters that make squares. So theoretically, you could have a 3x3 filled square that makes 5 squares, but that would be scored lower than a single 4x4 square, regardless of what's in it, since the number of characters in the first case is 9, versus the 12 in the second case.
I thought about making the scoring metric number of squares like the program specs, but that could be very easily abused by blocks of the same character, I didn't like that as much.

I get where you're coming from though on the concern about code length, and that's where the tie breaker comes in. If it helps, I got my motivation for this concept from W W's question not long ago. Edit: I see the loophole, and am in the process of closing it up. It's fixed if the scoring for the former criterion becomes a minimization of characters not in a square, like the question I linked. Thanks for pointing that out :)

I would recommend taking out the diagonal part because having optional parts to challenges typically does not work well here...

I saw a golf not too long ago that was very positively received, where the response was an entirely optional choice between 3 input/output configurations. My thought is, I wouldn't like it as a core piece of the challenge, but I still want to see someone try it :)

When scoring are we to include diagonal squares? Also, what do we do to score non-rectangular code?

Diagonal squares are not counted for scoring. I'd say nonrectangular code is fine, squares remain defined the same as in the specs. The rectangular specification for the input is mostly for simplicity's sake.

FYI it is useful to notify people by using @ (e.g. "@TCFP").

A Lenguage entry will score 0 by being written entirely in newline characters.

@HyperNeutrino this is actually a optional challenge I can get behind.  I think it is presented well, and doesn't add any score modifiers or anything.

Admittedly, I'm not as knowledgeable of esoteric languages like that. It's necessary to have a newline to even count something as a square to begin with, so I don't think it should count toward anyone's score.

@NathanMerrill Hm, possibly. I'm just wondering if certain languages or approaches will be able to abuse this to beat other languages that couldn't use this side-challenge as an advantage. Probably not much of a problem though since those languages would likely win anyway.

@HyperNeutrino that's true. Whenever you provide multiple routes to solve something, languages get to choose which route they want.  Whether or not that's good for a challenge should be taken case-by-case by vote IMO

Perl, 0 characters not in squares (25430 bytes)
##((((((((((((((((((((((((((((((((((((((((((((((
##($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$(
##($rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$(
##($r,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,r$(
##($r,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,r$(
##($r,$cccccccccccccccccccccccccccccccccccc$,r$(
##($r,$c,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,c$,r$(
##($r,$c,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,c$,r$(
##($r,$c,@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@,c$,r$(
##($r,$c,@a))))))))))))))))))))))))))))a@,c$,r$(
##($r,$c,@a)==========================)a@,c$,r$(
##($r,$c,@a)=@@@@@@@@@@@@@@@@@@@@@@@@=)a@,c$,r$(
##($r,$c,@a)=@AAAAAAAAAAAAAAAAAAAAAA@=)a@,c$,r$(
##($r,$c,@a)=@ARRRRRRRRRRRRRRRRRRRRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGGGGGGGGGGGGGGGGGGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGVVVVVVVVVVVVVVVVGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGV;;;;;;;;;;;;;;VGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGV;<<<<<<<<<<<<;VGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGV;<<<<<<<<<<<<;VGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGV;<<''''''''<<;VGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGV;<<''''''''<<;VGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGV;<<'';;;;''<<;VGRA@=)a@,c$,r$(
  ($r,$c,@a)=@ARGV;<<'';##;''<<;VGRA@=)a@,c$,r$(
  ($r,$c,@a)=@ARGV;<<'';##;''<<;VGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGV;<<'';;;;''<<;VGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGV;<<''''''''<<;VGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGV;<<''''''''<<;VGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGV;<<<<<<<<<<<<;VGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGV;<<<<<<<<<<<<;VGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGV;;;;;;;;;;;;;;VGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGVVVVVVVVVVVVVVVVGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARGGGGGGGGGGGGGGGGGGRA@=)a@,c$,r$(
##($r,$c,@a)=@ARRRRRRRRRRRRRRRRRRRRA@=)a@,c$,r$(
##($r,$c,@a)=@AAAAAAAAAAAAAAAAAAAAAA@=)a@,c$,r$(
##($r,$c,@a)=@@@@@@@@@@@@@@@@@@@@@@@@=)a@,c$,r$(
##($r,$c,@a)==========================)a@,c$,r$(
##($r,$c,@a))))))))))))))))))))))))))))a@,c$,r$(
##($r,$c,@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@,c$,r$(
##($r,$c,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,c$,r$(
##($r,$c,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,c$,r$(
##($r,$cccccccccccccccccccccccccccccccccccc$,r$(
##($r,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,r$(
##($r,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,r$(
##($rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$(
##($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$(
##((((((((((((((((((((((((((((((((((((((((((((((

##ffffffffffffffffffffffffffffffffffffffffff
##foooooooooooooooooooooooooooooooooooooooof
##forrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrof
##for$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rof
##for$yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy$rof
##for$y((((((((((((((((((((((((((((((((y$rof
##for$y(000000000000000000000000000000(y$rof
##for$y(0............................0(y$rof
##for$y(0............................0(y$rof
##for$y(0..$$$$$$$$$$$$$$$$$$$$$$$$..0(y$rof
##for$y(0..$rrrrrrrrrrrrrrrrrrrrrr$..0(y$rof
##for$y(0..$r--------------------r$..0(y$rof
##for$y(0..$r-111111111111111111-r$..0(y$rof
##for$y(0..$r-1))))))))))))))))1-r$..0(y$rof
##for$y(0..$r-1){{{{{{{{{{{{{{)1-r$..0(y$rof
##for$y(0..$r-1){<<<<<<<<<<<<{)1-r$..0(y$rof
##for$y(0..$r-1){<<<<<<<<<<<<{)1-r$..0(y$rof
##for$y(0..$r-1){<<''''''''<<{)1-r$..0(y$rof
##for$y(0..$r-1){<<''''''''<<{)1-r$..0(y$rof
##for$y(0..$r-1){<<'';;;;''<<{)1-r$..0(y$rof
  for$y(0..$r-1){<<'';##;''<<{)1-r$..0(y$rof
  for$y(0..$r-1){<<'';##;''<<{)1-r$..0(y$rof
##for$y(0..$r-1){<<'';;;;''<<{)1-r$..0(y$rof
##for$y(0..$r-1){<<''''''''<<{)1-r$..0(y$rof
##for$y(0..$r-1){<<''''''''<<{)1-r$..0(y$rof
##for$y(0..$r-1){<<<<<<<<<<<<{)1-r$..0(y$rof
##for$y(0..$r-1){<<<<<<<<<<<<{)1-r$..0(y$rof
##for$y(0..$r-1){{{{{{{{{{{{{{)1-r$..0(y$rof
##for$y(0..$r-1))))))))))))))))1-r$..0(y$rof
##for$y(0..$r-111111111111111111-r$..0(y$rof
##for$y(0..$r--------------------r$..0(y$rof
##for$y(0..$rrrrrrrrrrrrrrrrrrrrrr$..0(y$rof
##for$y(0..$$$$$$$$$$$$$$$$$$$$$$$$..0(y$rof
##for$y(0............................0(y$rof
##for$y(0............................0(y$rof
##for$y(000000000000000000000000000000(y$rof
##for$y((((((((((((((((((((((((((((((((y$rof
##for$yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy$rof
##for$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rof
##forrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrof
##foooooooooooooooooooooooooooooooooooooooof
##ffffffffffffffffffffffffffffffffffffffffff

##ffffffffffffffffffffffffffffffffffffffffff
##foooooooooooooooooooooooooooooooooooooooof
##forrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrof
##for$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rof
##for$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$rof
##for$x((((((((((((((((((((((((((((((((x$rof
##for$x(000000000000000000000000000000(x$rof
##for$x(0............................0(x$rof
##for$x(0............................0(x$rof
##for$x(0..$$$$$$$$$$$$$$$$$$$$$$$$..0(x$rof
##for$x(0..$cccccccccccccccccccccc$..0(x$rof
##for$x(0..$c--------------------c$..0(x$rof
##for$x(0..$c-111111111111111111-c$..0(x$rof
##for$x(0..$c-1))))))))))))))))1-c$..0(x$rof
##for$x(0..$c-1){{{{{{{{{{{{{{)1-c$..0(x$rof
##for$x(0..$c-1){<<<<<<<<<<<<{)1-c$..0(x$rof
##for$x(0..$c-1){<<<<<<<<<<<<{)1-c$..0(x$rof
##for$x(0..$c-1){<<''''''''<<{)1-c$..0(x$rof
##for$x(0..$c-1){<<''''''''<<{)1-c$..0(x$rof
##for$x(0..$c-1){<<'';;;;''<<{)1-c$..0(x$rof
  for$x(0..$c-1){<<'';##;''<<{)1-c$..0(x$rof
  for$x(0..$c-1){<<'';##;''<<{)1-c$..0(x$rof
##for$x(0..$c-1){<<'';;;;''<<{)1-c$..0(x$rof
##for$x(0..$c-1){<<''''''''<<{)1-c$..0(x$rof
##for$x(0..$c-1){<<''''''''<<{)1-c$..0(x$rof
##for$x(0..$c-1){<<<<<<<<<<<<{)1-c$..0(x$rof
##for$x(0..$c-1){<<<<<<<<<<<<{)1-c$..0(x$rof
##for$x(0..$c-1){{{{{{{{{{{{{{)1-c$..0(x$rof
##for$x(0..$c-1))))))))))))))))1-c$..0(x$rof
##for$x(0..$c-111111111111111111-c$..0(x$rof
##for$x(0..$c--------------------c$..0(x$rof
##for$x(0..$cccccccccccccccccccccc$..0(x$rof
##for$x(0..$$$$$$$$$$$$$$$$$$$$$$$$..0(x$rof
##for$x(0............................0(x$rof
##for$x(0............................0(x$rof
##for$x(000000000000000000000000000000(x$rof
##for$x((((((((((((((((((((((((((((((((x$rof
##for$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$rof
##for$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rof
##forrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrof
##foooooooooooooooooooooooooooooooooooooooof
##ffffffffffffffffffffffffffffffffffffffffff

##ffffffffffffffffffffffffffffffffffffffffffffffff
##foooooooooooooooooooooooooooooooooooooooooooooof
##forrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrof
##for$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rof
##for$ssssssssssssssssssssssssssssssssssssssss$rof
##for$s((((((((((((((((((((((((((((((((((((((s$rof
##for$s(111111111111111111111111111111111111(s$rof
##for$s(1..................................1(s$rof
##for$s(1..................................1(s$rof
##for$s(1..$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$..1(s$rof
##for$s(1..$cccccccccccccccccccccccccccc$..1(s$rof
##for$s(1..$c--------------------------c$..1(s$rof
##for$s(1..$c-$$$$$$$$$$$$$$$$$$$$$$$$-c$..1(s$rof
##for$s(1..$c-$xxxxxxxxxxxxxxxxxxxxxx$-c$..1(s$rof
##for$s(1..$c-$x--------------------x$-c$..1(s$rof
##for$s(1..$c-$x-111111111111111111-x$-c$..1(s$rof
##for$s(1..$c-$x-1))))))))))))))))1-x$-c$..1(s$rof
##for$s(1..$c-$x-1){{{{{{{{{{{{{{)1-x$-c$..1(s$rof
##for$s(1..$c-$x-1){<<<<<<<<<<<<{)1-x$-c$..1(s$rof
##for$s(1..$c-$x-1){<<<<<<<<<<<<{)1-x$-c$..1(s$rof
##for$s(1..$c-$x-1){<<''''''''<<{)1-x$-c$..1(s$rof
##for$s(1..$c-$x-1){<<''''''''<<{)1-x$-c$..1(s$rof
##for$s(1..$c-$x-1){<<'';;;;''<<{)1-x$-c$..1(s$rof
  for$s(1..$c-$x-1){<<'';##;''<<{)1-x$-c$..1(s$rof
  for$s(1..$c-$x-1){<<'';##;''<<{)1-x$-c$..1(s$rof
##for$s(1..$c-$x-1){<<'';;;;''<<{)1-x$-c$..1(s$rof
##for$s(1..$c-$x-1){<<''''''''<<{)1-x$-c$..1(s$rof
##for$s(1..$c-$x-1){<<''''''''<<{)1-x$-c$..1(s$rof
##for$s(1..$c-$x-1){<<<<<<<<<<<<{)1-x$-c$..1(s$rof
##for$s(1..$c-$x-1){<<<<<<<<<<<<{)1-x$-c$..1(s$rof
##for$s(1..$c-$x-1){{{{{{{{{{{{{{)1-x$-c$..1(s$rof
##for$s(1..$c-$x-1))))))))))))))))1-x$-c$..1(s$rof
##for$s(1..$c-$x-111111111111111111-x$-c$..1(s$rof
##for$s(1..$c-$x--------------------x$-c$..1(s$rof
##for$s(1..$c-$xxxxxxxxxxxxxxxxxxxxxx$-c$..1(s$rof
##for$s(1..$c-$$$$$$$$$$$$$$$$$$$$$$$$-c$..1(s$rof
##for$s(1..$c--------------------------c$..1(s$rof
##for$s(1..$cccccccccccccccccccccccccccc$..1(s$rof
##for$s(1..$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$..1(s$rof
##for$s(1..................................1(s$rof
##for$s(1..................................1(s$rof
##for$s(111111111111111111111111111111111111(s$rof
##for$s((((((((((((((((((((((((((((((((((((((s$rof
##for$ssssssssssssssssssssssssssssssssssssssss$rof
##for$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rof
##forrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrof
##foooooooooooooooooooooooooooooooooooooooooooooof
##ffffffffffffffffffffffffffffffffffffffffffffffff

##$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
##$mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm$
##$m========================================================m$
##$m=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=m$
##$m=$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$=m$
##$m=$a[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[a$=m$
##$m=$a[$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$[a$=m$
##$m=$a[$oooooooooooooooooooooooooooooooooooooooooooooo$[a$=m$
##$m=$a[$o============================================o$[a$=m$
##$m=$a[$o=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=o$[a$=m$
##$m=$a[$o=$cccccccccccccccccccccccccccccccccccccccc$=o$[a$=m$
##$m=$a[$o=$c**************************************c$=o$[a$=m$
##$m=$a[$o=$c*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*c$=o$[a$=m$
##$m=$a[$o=$c*$yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy$*c$=o$[a$=m$
##$m=$a[$o=$c*$y++++++++++++++++++++++++++++++++y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$xxxxxxxxxxxxxxxxxxxxxxxxxxxx$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x]]]]]]]]]]]]]]]]]]]]]]]]]]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];;;;;;;;;;;;;;;;;;;;;;;;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$$$$$$$$$$$$$$$$$$$$$$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$kkkkkkkkkkkkkkkkkkkk$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k==================k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0000000000000000=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0;;;;;;;;;;;;;;0=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0;<<<<<<<<<<<<;0=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0;<<<<<<<<<<<<;0=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0;<<''''''''<<;0=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0;<<''''''''<<;0=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0;<<'';;;;''<<;0=k$;]x$+y$*c$=o$[a$=m$
  $m=$a[$o=$c*$y+$x];$k=0;<<'';##;''<<;0=k$;]x$+y$*c$=o$[a$=m$
  $m=$a[$o=$c*$y+$x];$k=0;<<'';##;''<<;0=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0;<<'';;;;''<<;0=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0;<<''''''''<<;0=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0;<<''''''''<<;0=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0;<<<<<<<<<<<<;0=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0;<<<<<<<<<<<<;0=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0;;;;;;;;;;;;;;0=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k=0000000000000000=k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$k==================k$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$kkkkkkkkkkkkkkkkkkkk$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];$$$$$$$$$$$$$$$$$$$$$$;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x];;;;;;;;;;;;;;;;;;;;;;;;]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$x]]]]]]]]]]]]]]]]]]]]]]]]]]x$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$xxxxxxxxxxxxxxxxxxxxxxxxxxxx$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+y$*c$=o$[a$=m$
##$m=$a[$o=$c*$y++++++++++++++++++++++++++++++++y$*c$=o$[a$=m$
##$m=$a[$o=$c*$yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy$*c$=o$[a$=m$
##$m=$a[$o=$c*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*c$=o$[a$=m$
##$m=$a[$o=$c**************************************c$=o$[a$=m$
##$m=$a[$o=$cccccccccccccccccccccccccccccccccccccccc$=o$[a$=m$
##$m=$a[$o=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=o$[a$=m$
##$m=$a[$o============================================o$[a$=m$
##$m=$a[$oooooooooooooooooooooooooooooooooooooooooooooo$[a$=m$
##$m=$a[$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$[a$=m$
##$m=$a[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[a$=m$
##$m=$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$=m$
##$m=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=m$
##$m========================================================m$
##$mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm$
##$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

##ffffffffffffffffffffffffffffffffffffff
##foooooooooooooooooooooooooooooooooooof
##forrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrof
##for$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rof
##for$tttttttttttttttttttttttttttttt$rof
##for$t((((((((((((((((((((((((((((t$rof
##for$t(11111111111111111111111111(t$rof
##for$t(1........................1(t$rof
##for$t(1........................1(t$rof
##for$t(1..$$$$$$$$$$$$$$$$$$$$..1(t$rof
##for$t(1..$ssssssssssssssssss$..1(t$rof
##for$t(1..$s))))))))))))))))s$..1(t$rof
##for$t(1..$s){{{{{{{{{{{{{{)s$..1(t$rof
##for$t(1..$s){<<<<<<<<<<<<{)s$..1(t$rof
##for$t(1..$s){<<<<<<<<<<<<{)s$..1(t$rof
##for$t(1..$s){<<''''''''<<{)s$..1(t$rof
##for$t(1..$s){<<''''''''<<{)s$..1(t$rof
##for$t(1..$s){<<'';;;;''<<{)s$..1(t$rof
  for$t(1..$s){<<'';##;''<<{)s$..1(t$rof
  for$t(1..$s){<<'';##;''<<{)s$..1(t$rof
##for$t(1..$s){<<'';;;;''<<{)s$..1(t$rof
##for$t(1..$s){<<''''''''<<{)s$..1(t$rof
##for$t(1..$s){<<''''''''<<{)s$..1(t$rof
##for$t(1..$s){<<<<<<<<<<<<{)s$..1(t$rof
##for$t(1..$s){<<<<<<<<<<<<{)s$..1(t$rof
##for$t(1..$s){{{{{{{{{{{{{{)s$..1(t$rof
##for$t(1..$s))))))))))))))))s$..1(t$rof
##for$t(1..$ssssssssssssssssss$..1(t$rof
##for$t(1..$$$$$$$$$$$$$$$$$$$$..1(t$rof
##for$t(1........................1(t$rof
##for$t(1........................1(t$rof
##for$t(11111111111111111111111111(t$rof
##for$t((((((((((((((((((((((((((((t$rof
##for$tttttttttttttttttttttttttttttt$rof
##for$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rof
##forrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrof
##foooooooooooooooooooooooooooooooooooof
##ffffffffffffffffffffffffffffffffffffff

##ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
##foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooof
##forrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrof
##for((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((rof
##for($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$(rof
##for($tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt$(rof
##for($t,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,t$(rof
##for($t,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,t$(rof
##for($t,$cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc$,t$(rof
##for($t,$c**********************************************************c$,t$(rof
##for($t,$c*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*c$,t$(rof
##for($t,$c*$tttttttttttttttttttttttttttttttttttttttttttttttttttttt$*c$,t$(rof
##for($t,$c*$t,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,t$*c$,t$(rof
##for($t,$c*$t,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,t$*c$,t$(rof
##for($t,$c*$t,$tttttttttttttttttttttttttttttttttttttttttttttttt$,t$*c$,t$(rof
##for($t,$c*$t,$t++++++++++++++++++++++++++++++++++++++++++++++t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$cccccccccccccccccccccccccccccccccccccccccc$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c****************************************c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$ssssssssssssssssssssssssssssssssssss$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$cccccccccccccccccccccccccccccc$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c****************************c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$$$$$$$$$$$$$$$$$$$$$$$$$$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$tttttttttttttttttttttttt$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t++++++++++++++++++++++t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$$$$$$$$$$$$$$$$$$$$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$ssssssssssssssssss$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s))))))))))))))))s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s){{{{{{{{{{{{{{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s){<<<<<<<<<<<<{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s){<<<<<<<<<<<<{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s){<<''''''''<<{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s){<<''''''''<<{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s){<<'';;;;''<<{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
  for($t,$c*$t,$t+$c*$s,$c*$t+$s){<<'';##;''<<{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
  for($t,$c*$t,$t+$c*$s,$c*$t+$s){<<'';##;''<<{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s){<<'';;;;''<<{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s){<<''''''''<<{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s){<<''''''''<<{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s){<<<<<<<<<<<<{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s){<<<<<<<<<<<<{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s){{{{{{{{{{{{{{)s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$s))))))))))))))))s$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$ssssssssssssssssss$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t+$$$$$$$$$$$$$$$$$$$$+t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$t++++++++++++++++++++++t$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$tttttttttttttttttttttttt$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c*$$$$$$$$$$$$$$$$$$$$$$$$$$*c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$c****************************c$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$cccccccccccccccccccccccccccccc$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$s,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,s$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$ssssssssssssssssssssssssssssssssssss$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$c****************************************c$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$cccccccccccccccccccccccccccccccccccccccccc$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+t$,t$*c$,t$(rof
##for($t,$c*$t,$t++++++++++++++++++++++++++++++++++++++++++++++t$,t$*c$,t$(rof
##for($t,$c*$t,$tttttttttttttttttttttttttttttttttttttttttttttttt$,t$*c$,t$(rof
##for($t,$c*$t,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,t$*c$,t$(rof
##for($t,$c*$t,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,t$*c$,t$(rof
##for($t,$c*$tttttttttttttttttttttttttttttttttttttttttttttttttttttt$*c$,t$(rof
##for($t,$c*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*c$,t$(rof
##for($t,$c**********************************************************c$,t$(rof
##for($t,$cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc$,t$(rof
##for($t,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,t$(rof
##for($t,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,t$(rof
##for($tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt$(rof
##for($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$(rof
##for((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((rof
##forrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrof
##foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooof
##ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

##$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
##$kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk$
##$k++++++++++++++++++++++++++++++++++++++++++++k$
##$k+==========================================+k$
##$k+=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=+k$
##$k+=$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$=+k$
##$k+=$a[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[a$=+k$
##$k+=$a[$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$[a$=+k$
##$k+=$a[$oooooooooooooooooooooooooooooooo$[a$=+k$
##$k+=$a[$o++++++++++++++++++++++++++++++o$[a$=+k$
##$k+=$a[$o+$$$$$$$$$$$$$$$$$$$$$$$$$$$$+o$[a$=+k$
##$k+=$a[$o+$__________________________$+o$[a$=+k$
##$k+=$a[$o+$_]]]]]]]]]]]]]]]]]]]]]]]]_$+o$[a$=+k$
##$k+=$a[$o+$_]eeeeeeeeeeeeeeeeeeeeee]_$+o$[a$=+k$
##$k+=$a[$o+$_]eqqqqqqqqqqqqqqqqqqqqe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$$$$$$$$$$$$$$$$$$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$mmmmmmmmmmmmmmmm$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$m;;;;;;;;;;;;;;m$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$m;<<<<<<<<<<<<;m$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$m;<<<<<<<<<<<<;m$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$m;<<''''''''<<;m$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$m;<<''''''''<<;m$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$m;<<'';;;;''<<;m$qe]_$+o$[a$=+k$
  $k+=$a[$o+$_]eq$m;<<'';##;''<<;m$qe]_$+o$[a$=+k$
  $k+=$a[$o+$_]eq$m;<<'';##;''<<;m$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$m;<<'';;;;''<<;m$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$m;<<''''''''<<;m$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$m;<<''''''''<<;m$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$m;<<<<<<<<<<<<;m$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$m;<<<<<<<<<<<<;m$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$m;;;;;;;;;;;;;;m$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$mmmmmmmmmmmmmmmm$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eq$$$$$$$$$$$$$$$$$$qe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eqqqqqqqqqqqqqqqqqqqqe]_$+o$[a$=+k$
##$k+=$a[$o+$_]eeeeeeeeeeeeeeeeeeeeee]_$+o$[a$=+k$
##$k+=$a[$o+$_]]]]]]]]]]]]]]]]]]]]]]]]_$+o$[a$=+k$
##$k+=$a[$o+$__________________________$+o$[a$=+k$
##$k+=$a[$o+$$$$$$$$$$$$$$$$$$$$$$$$$$$$+o$[a$=+k$
##$k+=$a[$o++++++++++++++++++++++++++++++o$[a$=+k$
##$k+=$a[$oooooooooooooooooooooooooooooooo$[a$=+k$
##$k+=$a[$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$[a$=+k$
##$k+=$a[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[a$=+k$
##$k+=$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$=+k$
##$k+=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=+k$
##$k+==========================================+k$
##$k++++++++++++++++++++++++++++++++++++++++++++k$
##$kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk$
##$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

##}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
##}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
##}}$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}}
##}}$nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn$}}
##}}$n++++++++++++++++++++++++++++++++++n$}}
##}}$n+================================+n$}}
##}}$n+=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=+n$}}
##}}$n+=$kkkkkkkkkkkkkkkkkkkkkkkkkkkk$=+n$}}
##}}$n+=$k==========================k$=+n$}}
##}}$n+=$k==========================k$=+n$}}
##}}$n+=$k==4444444444444444444444==k$=+n$}}
##}}$n+=$k==4********************4==k$=+n$}}
##}}$n+=$k==4*$$$$$$$$$$$$$$$$$$*4==k$=+n$}}
##}}$n+=$k==4*$ssssssssssssssss$*4==k$=+n$}}
##}}$n+=$k==4*$s;;;;;;;;;;;;;;s$*4==k$=+n$}}
##}}$n+=$k==4*$s;<<<<<<<<<<<<;s$*4==k$=+n$}}
##}}$n+=$k==4*$s;<<<<<<<<<<<<;s$*4==k$=+n$}}
##}}$n+=$k==4*$s;<<''''''''<<;s$*4==k$=+n$}}
##}}$n+=$k==4*$s;<<''''''''<<;s$*4==k$=+n$}}
##}}$n+=$k==4*$s;<<'';;;;''<<;s$*4==k$=+n$}}
  }}$n+=$k==4*$s;<<'';##;''<<;s$*4==k$=+n$}}
  }}$n+=$k==4*$s;<<'';##;''<<;s$*4==k$=+n$}}
##}}$n+=$k==4*$s;<<'';;;;''<<;s$*4==k$=+n$}}
##}}$n+=$k==4*$s;<<''''''''<<;s$*4==k$=+n$}}
##}}$n+=$k==4*$s;<<''''''''<<;s$*4==k$=+n$}}
##}}$n+=$k==4*$s;<<<<<<<<<<<<;s$*4==k$=+n$}}
##}}$n+=$k==4*$s;<<<<<<<<<<<<;s$*4==k$=+n$}}
##}}$n+=$k==4*$s;;;;;;;;;;;;;;s$*4==k$=+n$}}
##}}$n+=$k==4*$ssssssssssssssss$*4==k$=+n$}}
##}}$n+=$k==4*$$$$$$$$$$$$$$$$$$*4==k$=+n$}}
##}}$n+=$k==4********************4==k$=+n$}}
##}}$n+=$k==4444444444444444444444==k$=+n$}}
##}}$n+=$k==========================k$=+n$}}
##}}$n+=$k==========================k$=+n$}}
##}}$n+=$kkkkkkkkkkkkkkkkkkkkkkkkkkkk$=+n$}}
##}}$n+=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=+n$}}
##}}$n+================================+n$}}
##}}$n++++++++++++++++++++++++++++++++++n$}}
##}}$nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn$}}
##}}$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}}
##}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
##}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

##}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
##}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
##}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
##}}}pppppppppppppppppppppppppppp}}}
##}}}prrrrrrrrrrrrrrrrrrrrrrrrrrp}}}
##}}}priiiiiiiiiiiiiiiiiiiiiiiirp}}}
##}}}prinnnnnnnnnnnnnnnnnnnnnnirp}}}
##}}}printtttttttttttttttttttnirp}}}
##}}}print$$$$$$$$$$$$$$$$$$tnirp}}}
##}}}print$nnnnnnnnnnnnnnnn$tnirp}}}
##}}}print$n;;;;;;;;;;;;;;n$tnirp}}}
##}}}print$n;<<<<<<<<<<<<;n$tnirp}}}
##}}}print$n;<<<<<<<<<<<<;n$tnirp}}}
##}}}print$n;<<''''''''<<;n$tnirp}}}
##}}}print$n;<<''''''''<<;n$tnirp}}}
##}}}print$n;<<'';;;;''<<;n$tnirp}}}
  }}}print$n;<<'';##;''<<;n$tnirp}}}
  }}}print$n;<<'';##;''<<;n$tnirp}}}
##}}}print$n;<<'';;;;''<<;n$tnirp}}}
##}}}print$n;<<''''''''<<;n$tnirp}}}
##}}}print$n;<<''''''''<<;n$tnirp}}}
##}}}print$n;<<<<<<<<<<<<;n$tnirp}}}
##}}}print$n;<<<<<<<<<<<<;n$tnirp}}}
##}}}print$n;;;;;;;;;;;;;;n$tnirp}}}
##}}}print$nnnnnnnnnnnnnnnn$tnirp}}}
##}}}print$$$$$$$$$$$$$$$$$$tnirp}}}
##}}}printtttttttttttttttttttnirp}}}
##}}}prinnnnnnnnnnnnnnnnnnnnnnirp}}}
##}}}priiiiiiiiiiiiiiiiiiiiiiiirp}}}
##}}}prrrrrrrrrrrrrrrrrrrrrrrrrrp}}}
##}}}pppppppppppppppppppppppppppp}}}
##}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
##}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
##}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

As you can see, every single character is part of a square. The top half of each big square is commented out by line comments, and the bottom half (including the second non-commented line) is escaped by a big here-document beginning in the middle of the square (<<'';#) and ending at the empty line after the big square.
This program was automatically generated from the following program:
($r,$c,@a)=@ARGV;
for$y(0..$r-1){
for$x(0..$c-1){
for$s(1..$c-$x-1){
$m=$a[$o=$c*$y+$x];$k=0;
for$t(1..$s){
for($t,$c*$t,$t+$c*$s,$c*$t+$s){
$k+=$a[$o+$_]eq$m;
}}$n+=$k==4*$s;
}}}print$n;

Which is a program to solve the same challenge, but (very lightly) golfed for bytes and short line lengths, not for score.
It takes as inputs first the height and width of the rectangle, then the individual characters of the rectangle separated by spaces. Example usage: To solve the rectangle
xxxyy
xxyyy
xyyxx

you call the program like this: perl theprogram.pl 3 5 x x x y y x x y y y x y y x x
Anyway, by squaring the code like this, it should be possible to get down to score 0 or 2 with any programming language that has a one-line solution and a line comment character, by transforming the one-liner
one-liner

like this:
##ooooooooooooooooooooo
##onnnnnnnnnnnnnnnnnnno
##oneeeeeeeeeeeeeeeeeno
##one---------------eno
##one-lllllllllllll-eno
##one-liiiiiiiiiiil-eno
##one-linnnnnnnnnil-eno
##one-lineeeeeeenil-eno
##one-linerrrrrenil-eno
##one-liner###renil-eno
  one-liner###renil-eno
##one-liner###renil-eno
##one-linerrrrrenil-eno
##one-lineeeeeeenil-eno
##one-linnnnnnnnnil-eno
##one-liiiiiiiiiiil-eno
##one-lllllllllllll-eno
##one---------------eno
##oneeeeeeeeeeeeeeeeeno
##onnnnnnnnnnnnnnnnnnno
##ooooooooooooooooooooo

The only characters not part of a square are the two spaces. Depending on the language, there may also be ways to use clever multiline strings or comments (like Perl's here-docs) or some sort of redundant code to make those two space characters into a square.
As for getting the byte count low, my solution has a bunch of immediate improvements, and I'm sure there are also lots of other ways to refine this technique, but I don't have the patience for that; I just wanted to provide a demonstration so you guys can go wild with it.

Kudos for getting the first 0 score answer!

Welcome to PPCG! Nice answer. A TIO link would be a welcome addition.

Jelly,  20 1917 1908  1905 bytes, Score  20  0

ẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆ
ẆZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZẆ
ẆZṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡZẆ
ẆZṡLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLṡZẆ
ẆZṡLƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊLṡZẆ
ẆZṡLƊ€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ƊLṡZẆ
ẆZṡLƊ€ẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZZZZZZZZZZZZZZZZZZZZZZZZZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZUUUUUUUUUUUUUUUUUUUUUUUZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$$$$$$$$$$$$$$$$$$$$$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬƬƬƬƬƬƬƬƬƬƬƬƬƬƬƬƬƬƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢḢḢḢḢḢḢḢḢḢḢḢḢḢḢḢḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€€€€€€€€€€€€€€€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎẎẎẎẎẎẎẎẎẎẎẎẎ€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEEEEEEEEEEEẎ€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEƲƲƲƲƲƲƲƲƲEẎ€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEƲ€€€€€€€ƲEẎ€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEƲ€SSSSS€ƲEẎ€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEƲ€SqqqS€ƲEẎ€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEƲ€SqqqS€ƲEẎ€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEƲ€SqqqS€ƲEẎ€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEƲ€SSSSS€ƲEẎ€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEƲ€€€€€€€ƲEẎ€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEƲƲƲƲƲƲƲƲƲEẎ€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEEEEEEEEEEEẎ€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎẎẎẎẎẎẎẎẎẎẎẎẎ€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢ€€€€€€€€€€€€€€€ḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬḢḢḢḢḢḢḢḢḢḢḢḢḢḢḢḢḢƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$ƬƬƬƬƬƬƬƬƬƬƬƬƬƬƬƬƬƬƬ$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZU$$$$$$$$$$$$$$$$$$$$$UZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZUUUUUUUUUUUUUUUUUUUUUUUZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇZZZZZZZZZZZZZZZZZZZZZZZZZƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇƇṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖṖẎ€ƊLṡZẆ
ẆZṡLƊ€ẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎẎ€ƊLṡZẆ
ẆZṡLƊ€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ƊLṡZẆ
ẆZṡLƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊƊLṡZẆ
ẆZṡLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLṡZẆ
ẆZṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡṡZẆ
ẆZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZẆ
ẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆẆ
⁽⁽ĿĿ
⁽⁽ĿĿ
A full program taking a list of lists of . and + characters. (Works for any characters, even more than 2).
Try it online!
Any attempt to reduce score by introducing characters seems to just increase the score more. I guess the way to win this challenge is to find the right Lenguage!
Since Magma posted a very nice Perl solution scoring \$0\$ I decided to attempt similar using my \$20\$ byte solution:
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEƲ€S

But Jelly has no comment character, so a little extra creativity is required...
Jelly programs consist of "Links" - code separated by newline characters, pilcrow characters (¶ - interpreted as the same byte as newlines) or valid code-page characters lacking a defined behaviour (at present q is an example). The latter actually count as a Link each rather than a pure separator. Program execution starts at the bottom-right most Link, the "Main Link" (here ⁽⁽ĿĿ).
We can call any other Link as a single-argument function (a "monad") by it's \$1\$-indexed position in the rest of the Links of the program using the "quick" Ŀ. These Links are indexable in a modular fashion; so if there are \$n\$ of them then the \$n^\text{th}\$ is the same as the \$0^\text{th}\$ and the \$-m^\text{th}\$ is the same as the \$(-m\mod n)^\text{th}\$.
So the program above starts by executing ⁽⁽ĿĿ, where ⁽⁽Ŀ is a representation of \$-27150\$ so ⁽⁽ĿĿ calls the \$-27150^\text{th}\$ Link which, since there are \$60\$ Links (due to the extra lines and the central nine qs), is the \$30 ^\text{th}\$ Link, ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEƲ€S, to the left of the middle row of the \$3\$-by-\$3\$ square of qs. This is called with an argument of the program input:
ẆZṡLƊ€ẎṖƇZU$ƬḢ€ẎEƲ€S - Link: list of lists of characters, lines
Ẇ                    - contiguous slices (i.e [[line1], [line2], ..., [lineN], [line1, line2], [line2, line3], ..., [lineN-1, lineN], [line1, line2, line3], ...., [lineN-2, lineN-1, lineN], ..., ..., lines])
     €               - for each (slice):
    Ɗ                -   last three links as a monad:
 Z                   -     transpose - i.e. get the columns of the slice
   L                 -     length - i.e. get the number of lines in the slice
  ṡ                  -     overlapping slices of given length - i.e. get slices of columns of same length as lines in the original slice ...filled squares of all sizes (including 1-by-1)
      Ẏ              - tighten - from a list of list of squares of each size to a single list of all squares
        Ƈ            - filter keep if this is truthy:
       Ṗ             -   pop (truthy for all but the 1-by-1 squares)
                  €  - for each (filled square)
                 Ʋ   -   last four links as a monad:
            Ƭ        -     collect up until results are no longer unique:
           $         -       last two links as a monad:
         Z           -         transpose  }
          U          -         upend      } - together a quarter rotation
             Ḣ€      -     head each - i.e. first row of each rotation
               Ẏ     -     tighten - i.e. get the entire perimeter (with repeated corners)
                E    -     all equal? (1 if so, 0 otherwise)
                   S - sum

I don't think this actually has a score of 0 since ¶ is really just a proxy for a newline. The program really looks more like this

@dylnan - the OP talks about characters, not bytes - but the 9 ¶s could be replaced with 9 qs or (s or whatever anyway (like I've said in the blurb).

...hmm doesn't seem to work with q like I thought it would :/

Changing the character changes which line ⁽⁽ĿĿ evaluates

Oh, each q counts as a link, so this works (-27150 % 60 = 30) and saves 3 bytes :)

Woah, nice I didn't expect that to happen. Is that because q is an unused byte? It works with u too which is also unused. nevermind

MATL, 18 16 14 10 characters not in squares (92 103 111 127 bytes)
!!!ffqqqqQQQ%OOOOGGGxx44---@@&&lllxxTT  ~~~ ++||7 ss--~~~ssvvss
!!!ffqqqqQQQ"OOOOGGGxx44---@@&&lllxxTTYa~~~Z++||7Mss--~~~ssvvss

Input is a character matrix with characters + and -. Doesn't count diagonal squares.
Try it online!
Or verify all examples and test cases.

I'm counting the newline as an out-of-square-character. Wating for OP clarification

Commented on the main thread, made the edit: newlines do not count toward your score :)