[Question]
  [
Suppose a new [fairy chess piece](https://en.wikipedia.org/wiki/Fairy_chess_piece) named the Wazir is introduced to chess. Wazirs can move from a position (*x*, *y*) to:  
 (*x*+1, *y*)  
 (*x*, *y*+1)  
 (*x*-1, *y*)  
 (*x*, *y*-1)
That is, they move orthogonally like the rook, but only one step at a time like the king. How many such wazirs can be placed on an N×N chessboard so that no two wazirs can attack each other?
 On a 1×1 board, there can be only 1 such piece.  
 On a 2×2 board, there can be 2 such pieces.  
 On a 3×3 board, there can be 5 such pieces.
Given N, return the number of wazirs that can be placed on an N×N chessboard.
This is [OEIS sequence A000982](https://oeis.org/A000982).
### More test cases
`7` → `25`
`8` → `32`
`100` → `5000`
  
[Answer]
# [Whitespace](https://web.archive.org/web/20150618184706/http://compsoc.dur.ac.uk/whitespace/tutorial.php), 45 bytes
```
   
	
		   
			 
 	  
   	
	      	 
	 	 	
 	
```
[Try it online!](https://tio.run/##K8/ILEktLkhMTv3/X0FBgYuTi5MTTAMpLgUgkwvIAwoqgAFQjBNIcAJl/v83BQA "Whitespace – Try It Online")
By the way, here is a proof that the ⌈n²/2⌉ formula is correct.
* **We can always place at least ⌈n²/2⌉ wazirs**: just lay them out in a checkerboard pattern! Assuming the top-left tile is white, there are ⌈n²/2⌉ white tiles and ⌊n²/2⌋ black tiles on the *n × n* board. And if we place wazirs on the white tiles, no two of them are attacking each other, as every wazir only “sees” black tiles.
Here’s how we place 13 wazirs on a 5 × 5 board (each W is a wazir).
　　　　　　　　　　[![13 wazirs on a 5 × 5 board](https://i.stack.imgur.com/qkqQJ.png)](https://i.stack.imgur.com/qkqQJ.png)
* **We can’t do any better**: let’s arbitrarily tile the checkerboard with 2 × 1 domino pieces, optionally using a 1 × 1 piece for the final corner of an odd-length chessboard, like so:
　　　　　　　　　　[![domino cover of a 5 × 5 board](https://i.stack.imgur.com/pXhxf.png)](https://i.stack.imgur.com/pXhxf.png)
We need ⌈n²/2⌉ dominoes to cover the chessboard. Clearly, putting two wazirs on one domino makes it so that they can attack one another! So each domino can only contain at most one wazir, meaning we can’t *possibly* place more than ⌈n²/2⌉ wazirs on the board.
[Answer]
# [Oasis](https://github.com/Adriandmen/Oasis), 3 bytes
```
k>v
```
[Try it online!](https://tio.run/##y08sziz@/z/bruz///@GBgYA "Oasis – Try It Online")
square - increment - integer halve
[Answer]
# [Prolog (SWI)](http://www.swi-prolog.org), ~~22~~ 19 bytes
Saved 3 bytes thanks to *Kevin Cruijssen*
```
X*Y:-Y is(X*X+1)/2.
```
[Try it online!](https://tio.run/##KyjKz8lP1y0uz/z/P0Ir0ko3UiGzWCNCK0LbUFPfSO//f3OtCD0A "Prolog (SWI) – Try It Online")
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), ~~9~~ ~~7~~ 6 bytes
Now uses [Mr. Xcoder's formula.](https://chat.stackexchange.com/transcript/message/40310179#40310179)
This is an anonymous prefix tacit function which takes N as argument.
```
⌈2÷⍨×⍨
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///3zkxNzWn@FHbhEc9HUaHtz/qXXF4OpD4/18BDCDSCoZcKFwjVK4xKtcclWuByjU0MAAA "APL (Dyalog Unicode) – Try It Online")
`×⍨` square N (lit. multiplication selfie, i.e. multiply by self)
`2÷⍨` divide by 2
`⌈` ceiling (round up)
[Answer]
# JS (ES6) / C# polyglot, 11 bytes
```
n=>n*n+1>>1
```
### Test cases
```
let f =
n=>n*n+1>>1
console.log(f(7))
console.log(f(8))
console.log(f(100))
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 3 bytes
Straight implementation of the formula given by [A000982](https://oeis.org/A000982)
```
n;î
```
[Try it online!](https://tio.run/##MzBNTDJM/V9TVvk/z/rwuv@VSof3Wykc3q@k89@Qy4jLmMuEy5TLjMucy4LLksvQAIgMAA "05AB1E – Try It Online")
**Explanation**
```
n      # square
 ;     # divide by 2
  î    # round up
```
[Answer]
# [dc](https://www.gnu.org/software/bc/manual/dc-1.05/html_mono/dc.html), 6 bytes
```
2^2~+p
```
`2^`: square; 
`2~`: divide by 2, pushing the quotient then the remainder; 
`+p`: add the remainder to the quotient & print.
[Try it online!](https://tio.run/##S0n@b/7fKM6oTrvg/38A "dc – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 17 bytes
1 byte thanks to @ovs.
```
lambda x:x*x+1>>1
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUaHCqkKrQtvQzs7wf0FRZl6JRpqGoaYmF4xthMQ2RmKbaGr@BwA "Python 2 – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~23~~ ~~18~~ 17 bytes
* Saved a byte thanks to [Tahg](https://codegolf.stackexchange.com/users/74459/tahg); golfing `n/2+n%2` to `n+1>>1`.
```
f(n){n=n*n+1>>1;}
```
[Try it online!](https://tio.run/##S9ZNT07@/z9NI0@zOs82TytP29DOztC69n9uYmaeRpZmdVp@kUaWraF1lo2hgXWWtrZmQVFmXkmahpJqSkyekk4aUI0mUDkA "C (gcc) – Try It Online")
# [C (gcc)](https://gcc.gnu.org/), 22 bytes (not using undefined behavior)
```
f(n){return n*n+1>>1;}
```
[Try it online!](https://tio.run/##S9ZNT07@/z9NI0@zuii1pLQoTyFPK0/b0M7O0Lr2f25iZp5GlmZ1Wn6RRpatoXWWjaGBdZa2tmZBUWZeSZqGkmpKTJ6SThpQjSZQOQA "C (gcc) – Try It Online")
Some people really do not like exploiting a certain compiler's undefined bahavior when using specific compiler flags. Doing so does save bytes, though.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 6 bytes
```
^₂/₂⌉₁
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r/P@5RU5M@ED/q6XzU1Pj/v/n/KAA "Brachylog – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), 19 bytes
```
lambda x:-(-x*x//2)
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUaHCSldDt0KrQl/fSPN/QVFmXolGmoahpiYXjG2ExDZGYptoav4HAA "Python 3 – Try It Online")
```
lambda x:-(-x*x//2)  # Unnamed function
lambda x:            # Given input x:
            x*x      # Square
           -         # Negate
               //2   # Halve and Floor (equivalent of Ceil)
         -(       )  # Negate again (floor -> ceil)
```
-1 byte thanks to Mr. Xcoder
[Answer]
# x86\_64 machine language (Linux), ~~9~~ 8 bytes
```
0:       97                      xchg   %eax,%edi
1:       f7 e8                   imul   %eax
3:       ff c0                   inc    %eax
5:       d1 f8                   sar    %eax
7:       c3                      retq
```
To [Try it online!](https://tio.run/##FUrdDoIgFL7nKc5sbRzNpuuimtqTcMMOYCzDJrSxmq8e4cX3/1E9EqW0s46mt9K9D8rOx/uN0ex8ALrLBUozFCJezyKaDH3JakSkRkTVZp8znYqOWRfgKa3j@GUAZl741tih7cD2bZO5qhC2DeC15M3wYq@EKw7AtysvkSMa5Baxy6@VrSn9yExy9Kn@6KjJB0mPPw "C (gcc) – Try It Online"), compile and run the following C program.
```
#include<stdio.h>
const char *f="\x97\xf7\xe8\xff\xc0\xd1\xf8\xc3";
int main() {
  for(int i=1; i<10; i++) {
    printf("%d\n", ((int(*)())f)(i));
  }
}
```
[Answer]
# [J](http://jsoftware.com/), 8 bytes
Anonymous tacit prefix function.
```
2>.@%~*:
```
[Try it online!](https://tio.run/##y/r/P9nWyshOz0G1TssKyFEw5EpWMAJiYyA2B2ILIDY0MAAA "J – Try It Online")
`*:` square
`>.` ceiling (round up)  
`@` after  
`2`…`%~` dividing by two
[Answer]
# [Actually](https://github.com/Mego/Seriously), 3 bytes
```
²½K
```
**[Try it online!](https://tio.run/##S0wuKU3Myan8///QpkN7vf//twAA "Actually – Try It Online")**
[Answer]
# Mathematica, 12 bytes
```
⌈#^2/2⌉&
```
[Answer]
# [R](https://www.r-project.org/), ~~22~~ 21 bytes
```
cat((scan()^2+1)%/%2)
```
[Try it online!](https://tio.run/##K/r/PzmxREOjODkxT0MzzkjbUFNVX9VI87@hgpGCsYKJgqmCmYK5goWCpYKhwX8A "R – Try It Online")
Square, increment, integer divide. Easy peasy.
Input from stdin; it can take space or newline separated input and it will compute the max wazirs for each input boardsize. Output to stdout.
*-1 byte thanks to plannapus*
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 6 bytes
```
.E**.5
```
**[Try it online!](https://tio.run/##K6gsyfj/X89VS0vP9P9/cwA "Pyth – Try It Online")**
[Answer]
# [Pyke](https://github.com/muddyfish/PYKE), 3 bytes
```
Xhe
```
**[Try it here!](http://pyke.catbus.co.uk/?code=Xhe&input=7&warnings=0&hex=0)**
## How?
```
X   - Square.
 h  - Increment.
  e - Floor halve.
```
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), ~~14~~ 12 bytes
-2 bytes thanks to Emigna
```
n=>(n*n+1)/2
```
[Try it online!](https://tio.run/##hco9C8IwEIDhPb/ixsSPii4K2i6Ck04ODuIQzrQc1AvkTlGkvz3Gzc13eKcHZYoxhYy9F4GneRtRr4TwiHSFgycGK5qIu/MFfOrEFQKl40s03KrdnXFDrBMoa6CFOnPdWB7xeO5mi7z@xdvIEvtQnRJp2BMH29qlc3/N6msGM@QP "C# (.NET Core) – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/), 16 bytes
```
$_=0|$_*$_/2+.5
```
[Try it online!](https://tio.run/##K0gtyjH9/18l3tagRiVeSyVe30hbDyhg8S@/oCQzP6/4v66vqZ6BocF/3QIA "Perl 5 – Try It Online")
[Answer]
# [MATL](https://github.com/lmendo/MATL), 5 bytes
```
UH/Xk
```
[Try it online!](https://tio.run/##y00syfn/P9RDPyL7/38LAA "MATL – Try It Online")
[Answer]
# [Cubix](https://github.com/ETHproductions/cubix), 11 bytes
```
Iu*:^\)2,O@
```
Heheh, `:^\)`
[Try it online!](https://tio.run/##Sy5Nyqz4/9@zVMsqLkbTSMff4f9/UwA "Cubix – Try It Online")
Expands to the following cube:
```
    I u
    * :
^ \ ) 2 , O @ .
. . . . . . . .
    . .
    . .
```
Which is the same algorithm that many use.
* `^Iu` : read in input as int and change directions
* `:*` : dup top of stack, multiply
* `\)` : change direction, increment
* `2,` : push 2, integer divide
* `O@` : print output as int, end program.
[Answer]
# [Pyke](https://github.com/muddyfish/PYKE), 3 bytes
```
Xhe
```
[Try it here!](http://pyke.catbus.co.uk/?code=Xhe&input=8&warnings=1&hex=0)
```
X   -   input ** 2
 h  -  ^ + 1
  e - floor_half(^)
```
[Answer]
# [Ohm v2](https://github.com/MiningPotatoes/Ohm), 3 bytes
```
²½ı
```
[Try it online!](https://tio.run/##y8/INfr//9CmQ3uPbPz/3xwA "Ohm v2 – Try It Online")
`²` squares, `½` halves, `ı` ceils.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3 bytes
-1 thanks to Mr. Xcoder.
Based on [my APL solution](https://codegolf.stackexchange.com/a/144234/43319).
```
²HĊ
```
[Try it online!](https://tio.run/##y0rNyan8///QJo8jXf///zc0MAAA "Jelly – Try It Online")
`²` Square
`H` **H**alve
`Ċ` **C**eiling (round up)
[Answer]
# [Japt](https://github.com/ETHproductions/japt/), 4 bytes
Been sitting on these since the challenge was closed.
```
²Ä z
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.5&code=ssQgeg==&input=OQ==)
**Explanation:** Square, add 1, floor divide by 2
---
## Alternative
```
²ÄÁ1
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.5&code=ssTBMQ==&input=OQ==)
**Explanation:** Square, add 1, bit-shift right by 1.
[Answer]
# [,,,](https://github.com/totallyhuman/commata), 7 bytes
```
2*1+1»
```
[Try it online!](https://tio.run/##S87PzU0sSfz/30jLUNvw0O7///@bAwA ",,, – Try It Online")
Yay, commata works for something!
Fudge, I didn't implement ceiling...
[Answer]
# [Gaia](https://github.com/splcurran/Gaia), 3 bytes
```
sḥ⌉
```
[Try it online!](https://tio.run/##S0/MTPz/v/jhjqWPejr//zcHAA "Gaia – Try It Online")
`s` squares, `ḥ` halves, `⌉` ceils.
[Answer]
# [Commentator](https://github.com/SatansSon/Commentator), 19 bytes
```
//{-//-}! {-#  -}<!
```
[Try it online!](https://tio.run/##S87PzU3NK0ksyS/6/19fv1pXX1@3VlGhWldZQUG31kbx////pgA "Commentator – Try It Online")
Who needs golfing languages? I've got confusing languages!
Ungolfed version:
```
5//{-8}//{5-}
print(10!= 5)
x={-1,3,4} # Smiley :-}
print(5<!=10)*/ # Weird comparision.
```
[Try it online!](https://tio.run/##S87PzU3NK0ksyS/6/99UX79a16IWSJrq1nIVFGXmlWgYGijaKphqclXYVusa6hjrmNQqKCsE52bmpFYqWMFVmdoo2hoaaGrpAyXDUzOLUhSS83MLEosyizPz8/T@A40GAA "Commentator – Try It Online")
How does it work? I'll explain, with input 5
```
//                         - Take input.                           Tape: [5 0 0]
  {-//-}!                  - Square the input.                     Tape: [25 0 0]
  {-                         - Move one along the tape
    //                       - Copy the input to the tape.         Tape: [5 5 0]
      -}                     - Move one back along the tape
        !                    - Take the product of the tape.       Tape: [25 5 0]
         <space>           - Increment the tape head.              Tape: [26 5 0]
                 {-#  -}<! - Halve the tape head (floor division). Tape: [13 2 0]
                 {-          - Move one along the tape
                   #         - Set the tape head to 2.             Tape: [26 2 0]
                      -}     - Move one back along the tape
                        <!   - Reduce the tape by floor division.  Tape: [13 2 0]
```
[Answer]
# [OCaml](http://www.ocaml.org/), 19 bytes
```
let f n=(n*n+1)/2;;
```
[Try it online!](https://tio.run/##y09OzM35/z8ntUQhTSHPViNPK0/bUFPfyNr6f0FRZl5JPBAraKQpmGsCRQA "OCaml – Try It Online")
I'm a bit bummed the name got changed from "camels" to "wazirs" before I managed to write this, but I figured I'd post it anyway.
]