Skip to main content
Post Reopened by JohnBGoode, G B, naffetS, Seggan, rydwolf
changed scoring criterion (because it was ambiguous)
Source Link

Find the max number of Xs you can fit onto a rectangular tic-tac-toe board of length l and height h without ever having 3 consecutive Xs in a row diagonally, horizontally, or vertically.

This is a challenge so the fastestshortest code at l = 9 and h = 9 wins.!

Input

A single line containing values l and h, representing the length and height of the tic-tac-toe board, separated by a space.

Constraints

1 ≤ l ≤ 2,147,483,647 1 ≤ h ≤ 2,147,483,647 

Output

A single number representing the number of Xs that can fit on the tic-tac-toe board without three in a row

Sample Inputs and Outputs

Input -> Output 2 2 -> 4 3 3 -> 6 2 3 -> 4 4 4 -> 9 

Explanation

4 Xs can fit on a 2x2 tic-tac-toe board without having 3 Xs in a row anywhere

6 Xs can fit on a 3x3 tic-tac-toe board without having 3 Xs in a row anywhere

4 Xs can fit on a 2x3 tic-tac-toe board without having 3 Xs in a row anywhere

9 Xs can fit on a 4x4 tic-tac-toe board without having 3 Xs in a row anywhere

Credits

Lukas Zenick for creating the problem

Extra Data

https://docs.google.com/spreadsheets/d/1qJvlxdGm8TocR3sh3leRIpqdzmN3bB_z8N-VrEKSCwI/edit

TIC TAC 2x2 TIC TAC 3x3

Find the max number of Xs you can fit onto a rectangular tic-tac-toe board of length l and height h without ever having 3 consecutive Xs in a row diagonally, horizontally, or vertically.

This is a challenge so the fastest code at l = 9 and h = 9 wins.

Input

A single line containing values l and h, representing the length and height of the tic-tac-toe board, separated by a space.

Constraints

1 ≤ l ≤ 2,147,483,647 1 ≤ h ≤ 2,147,483,647 

Output

A single number representing the number of Xs that can fit on the tic-tac-toe board without three in a row

Sample Inputs and Outputs

Input -> Output 2 2 -> 4 3 3 -> 6 2 3 -> 4 4 4 -> 9 

Explanation

4 Xs can fit on a 2x2 tic-tac-toe board without having 3 Xs in a row anywhere

6 Xs can fit on a 3x3 tic-tac-toe board without having 3 Xs in a row anywhere

4 Xs can fit on a 2x3 tic-tac-toe board without having 3 Xs in a row anywhere

9 Xs can fit on a 4x4 tic-tac-toe board without having 3 Xs in a row anywhere

Credits

Lukas Zenick for creating the problem

Extra Data

https://docs.google.com/spreadsheets/d/1qJvlxdGm8TocR3sh3leRIpqdzmN3bB_z8N-VrEKSCwI/edit

TIC TAC 2x2 TIC TAC 3x3

Find the max number of Xs you can fit onto a rectangular tic-tac-toe board of length l and height h without ever having 3 consecutive Xs in a row diagonally, horizontally, or vertically.

This is a challenge so shortest code wins!

Input

A single line containing values l and h, representing the length and height of the tic-tac-toe board, separated by a space.

Constraints

1 ≤ l ≤ 2,147,483,647 1 ≤ h ≤ 2,147,483,647 

Output

A single number representing the number of Xs that can fit on the tic-tac-toe board without three in a row

Sample Inputs and Outputs

Input -> Output 2 2 -> 4 3 3 -> 6 2 3 -> 4 4 4 -> 9 

Explanation

4 Xs can fit on a 2x2 tic-tac-toe board without having 3 Xs in a row anywhere

6 Xs can fit on a 3x3 tic-tac-toe board without having 3 Xs in a row anywhere

4 Xs can fit on a 2x3 tic-tac-toe board without having 3 Xs in a row anywhere

9 Xs can fit on a 4x4 tic-tac-toe board without having 3 Xs in a row anywhere

Credits

Lukas Zenick for creating the problem

Extra Data

https://docs.google.com/spreadsheets/d/1qJvlxdGm8TocR3sh3leRIpqdzmN3bB_z8N-VrEKSCwI/edit

TIC TAC 2x2 TIC TAC 3x3

Left closed in review as "Needs details or clarity" by lyxal, rydwolf, Wheat Wizard
Left closed in review as "Original close reason(s) were not resolved" by rydwolf, caird coinheringaahing
Update winning criterion
Added to review
Source Link
JohnBGoode
  • 339
  • 1
  • 6

Find the max number of Xs you can fit onto a rectangular tic-tac-toe board of length l and height h without ever having 3 consecutive Xs in a row diagonally, horizontally, or vertically.

This is a challenge so the fastest code at l = 9 and h = 9 wins.

Input

A single line containing values l and h, representing the length and height of the tic-tac-toe board, separated by a space.

Constraints

1 ≤ l ≤ 2,147,483,647 1 ≤ h ≤ 2,147,483,647 

Output

A single number representing the number of Xs that can fit on the tic-tac-toe board without three in a row

Sample Inputs and Outputs

Input -> Output 2 2 -> 4 3 3 -> 6 2 3 -> 4 4 4 -> 9 

Explanation

4 Xs can fit on a 2x2 tic-tac-toe board without having 3 Xs in a row anywhere

6 Xs can fit on a 3x3 tic-tac-toe board without having 3 Xs in a row anywhere

4 Xs can fit on a 2x3 tic-tac-toe board without having 3 Xs in a row anywhere

9 Xs can fit on a 4x4 tic-tac-toe board without having 3 Xs in a row anywhere

Credits

Lukas Zenick for creating the problem

Extra Data

https://docs.google.com/spreadsheets/d/1qJvlxdGm8TocR3sh3leRIpqdzmN3bB_z8N-VrEKSCwI/edit

TIC TAC 2x2 TIC TAC 3x3

Find the max number of Xs you can fit onto a rectangular tic-tac-toe board of length l and height h without ever having 3 consecutive Xs in a row diagonally, horizontally, or vertically.

Input

A single line containing values l and h, representing the length and height of the tic-tac-toe board, separated by a space.

Constraints

1 ≤ l ≤ 2,147,483,647 1 ≤ h ≤ 2,147,483,647 

Output

A single number representing the number of Xs that can fit on the tic-tac-toe board without three in a row

Sample Inputs and Outputs

Input -> Output 2 2 -> 4 3 3 -> 6 2 3 -> 4 4 4 -> 9 

Explanation

4 Xs can fit on a 2x2 tic-tac-toe board without having 3 Xs in a row anywhere

6 Xs can fit on a 3x3 tic-tac-toe board without having 3 Xs in a row anywhere

4 Xs can fit on a 2x3 tic-tac-toe board without having 3 Xs in a row anywhere

9 Xs can fit on a 4x4 tic-tac-toe board without having 3 Xs in a row anywhere

Credits

Lukas Zenick for creating the problem

Extra Data

https://docs.google.com/spreadsheets/d/1qJvlxdGm8TocR3sh3leRIpqdzmN3bB_z8N-VrEKSCwI/edit

TIC TAC 2x2 TIC TAC 3x3

Find the max number of Xs you can fit onto a rectangular tic-tac-toe board of length l and height h without ever having 3 consecutive Xs in a row diagonally, horizontally, or vertically.

This is a challenge so the fastest code at l = 9 and h = 9 wins.

Input

A single line containing values l and h, representing the length and height of the tic-tac-toe board, separated by a space.

Constraints

1 ≤ l ≤ 2,147,483,647 1 ≤ h ≤ 2,147,483,647 

Output

A single number representing the number of Xs that can fit on the tic-tac-toe board without three in a row

Sample Inputs and Outputs

Input -> Output 2 2 -> 4 3 3 -> 6 2 3 -> 4 4 4 -> 9 

Explanation

4 Xs can fit on a 2x2 tic-tac-toe board without having 3 Xs in a row anywhere

6 Xs can fit on a 3x3 tic-tac-toe board without having 3 Xs in a row anywhere

4 Xs can fit on a 2x3 tic-tac-toe board without having 3 Xs in a row anywhere

9 Xs can fit on a 4x4 tic-tac-toe board without having 3 Xs in a row anywhere

Credits

Lukas Zenick for creating the problem

Extra Data

https://docs.google.com/spreadsheets/d/1qJvlxdGm8TocR3sh3leRIpqdzmN3bB_z8N-VrEKSCwI/edit

TIC TAC 2x2 TIC TAC 3x3

Post Closed as "Not suitable for this site" by pajonk, pxeger, mousetail, Dominic van Essen, caird coinheringaahing
Became Hot Network Question
added 4 characters in body
Source Link
Kevin Cruijssen
  • 136.3k
  • 14
  • 155
  • 394

Find the max number of Xs you can fit onto a rectangular tic-tac-toe board of length ll and height hh without ever having 3 consecutive Xs in a row diagonally, horizontally, or vertically.

Input

A single line containing values l and h, representing the length and height of the tic-tac-toe board, separated by a space.

Constraints

1 ≤ l ≤ 2,147,483,647 1 ≤ h ≤ 2,147,483,647 

Output

A single number representing the number of Xs that can fit on the tic-tac-toe board without three in a row

Sample Inputs and Outputs

Input -> Output 2 2 -> 4 3 3 -> 6 2 3 -> 4 4 4 -> 9 

Explanation

4 Xs can fit on a 2x2 tic-tac-toe board without having 3 Xs in a row anywhere

6 Xs can fit on a 3x3 tic-tac-toe board without having 3 Xs in a row anywhere

4 Xs can fit on a 2x3 tic-tac-toe board without having 3 Xs in a row anywhere

9 Xs can fit on a 4x4 tic-tac-toe board without having 3 Xs in a row anywhere

Credits

Lukas Zenick for creating the problem

Extra Data

https://docs.google.com/spreadsheets/d/1qJvlxdGm8TocR3sh3leRIpqdzmN3bB_z8N-VrEKSCwI/edit

TIC TAC 2x2 TIC TAC 3x3

Find the max number of Xs you can fit onto a rectangular tic-tac-toe board of length l and height h without ever having 3 consecutive Xs in a row diagonally, horizontally, or vertically.

Input

A single line containing values l and h, representing the length and height of the tic-tac-toe board, separated by a space.

Constraints

1 ≤ l ≤ 2,147,483,647 1 ≤ h ≤ 2,147,483,647 

Output

A single number representing the number of Xs that can fit on the tic-tac-toe board without three in a row

Sample Inputs and Outputs

Input -> Output 2 2 -> 4 3 3 -> 6 2 3 -> 4 4 4 -> 9 

Explanation

4 Xs can fit on a 2x2 tic-tac-toe board without having 3 Xs in a row anywhere

6 Xs can fit on a 3x3 tic-tac-toe board without having 3 Xs in a row anywhere

4 Xs can fit on a 2x3 tic-tac-toe board without having 3 Xs in a row anywhere

9 Xs can fit on a 4x4 tic-tac-toe board without having 3 Xs in a row anywhere

Credits

Lukas Zenick for creating the problem

Extra Data

https://docs.google.com/spreadsheets/d/1qJvlxdGm8TocR3sh3leRIpqdzmN3bB_z8N-VrEKSCwI/edit

TIC TAC 2x2 TIC TAC 3x3

Find the max number of Xs you can fit onto a rectangular tic-tac-toe board of length l and height h without ever having 3 consecutive Xs in a row diagonally, horizontally, or vertically.

Input

A single line containing values l and h, representing the length and height of the tic-tac-toe board, separated by a space.

Constraints

1 ≤ l ≤ 2,147,483,647 1 ≤ h ≤ 2,147,483,647 

Output

A single number representing the number of Xs that can fit on the tic-tac-toe board without three in a row

Sample Inputs and Outputs

Input -> Output 2 2 -> 4 3 3 -> 6 2 3 -> 4 4 4 -> 9 

Explanation

4 Xs can fit on a 2x2 tic-tac-toe board without having 3 Xs in a row anywhere

6 Xs can fit on a 3x3 tic-tac-toe board without having 3 Xs in a row anywhere

4 Xs can fit on a 2x3 tic-tac-toe board without having 3 Xs in a row anywhere

9 Xs can fit on a 4x4 tic-tac-toe board without having 3 Xs in a row anywhere

Credits

Lukas Zenick for creating the problem

Extra Data

https://docs.google.com/spreadsheets/d/1qJvlxdGm8TocR3sh3leRIpqdzmN3bB_z8N-VrEKSCwI/edit

TIC TAC 2x2 TIC TAC 3x3

Tweeted twitter.com/StackCodeGolf/status/1585330425899130880
Extra data
Source Link
JohnBGoode
  • 339
  • 1
  • 6
Loading
Credits
Source Link
JohnBGoode
  • 339
  • 1
  • 6
Loading
4x4 test case
Source Link
JohnBGoode
  • 339
  • 1
  • 6
Loading
Updated I/O
Source Link
JohnBGoode
  • 339
  • 1
  • 6
Loading
Made it more specific on what a row is
Source Link
JohnBGoode
  • 339
  • 1
  • 6
Loading
Rectangular test sample
Source Link
JohnBGoode
  • 339
  • 1
  • 6
Loading
Source Link
JohnBGoode
  • 339
  • 1
  • 6
Loading