Ants on a Natural Log This is a good beginner challenge and a good time killer.

I only said a -natural- log because the title was too short, this has nothing to do with logarithms.

Given 2 variables:


The number of ants n.
The width of the log w. 


Output a log of width w with n ants (Example shown w=3, n=6)

|             |
| \O/ \O/ \O/ |
| -O- -O- -O- |
| /o\ /o\ /o\ |
|  ^   ^   ^  |
|             |
| \O/ \O/ \O/ |
| -O- -O- -O- |
| /o\ /o\ /o\ |
|  ^   ^   ^  |
|             |


A single ant looks like this:

\O/ # Upper-case O
-O- # Upper-case O
/o\ # Lower-case o
 ^  


A few ant laws:


Ants may not touch each other nor the edge of the log directly, they
prefer to touch spaces.
Each row of ants must be w wide, with n/w rows of ants.
Ants always need a log, the log width is greater than 0, guaranteed. 
Ants also... well, need ants, the number of ants is greater than 0, guaranteed.
Ants are also surprisingly well organized, they will fill a log from left to right, top to bottom; as if they were reading a book.


Ant-xamples

w=3, n=5

|             |
| \O/ \O/ \O/ |
| -O- -O- -O- |
| /o\ /o\ /o\ |
|  ^   ^   ^  |
|             |
| \O/ \O/     |
| -O- -O-     |
| /o\ /o\     |
|  ^   ^      |
|             |


w=1, n=1

|     |
| \O/ |
| -O- |
| /o\ |
|  ^  |
|     |


w=1, n=3

|     |
| \O/ |
| -O- |
| /o\ |
|  ^  |
|     |
| \O/ |
| -O- |
| /o\ |
|  ^  |
|     |
| \O/ |
| -O- |
| /o\ |
|  ^  |
|     |


This is code-golf, the person with the smallest bytecount wins.
PHP>=7.1, 150 Bytes

for([,$w,$n]=$argv;$i&lt;ceil($n/$w)*5+1;)echo str_pad("| ".str_repeat(["","\O/ ","-O- ","/o\ "," ^  "][$i%5],$n&lt;$w*ceil($i++/5)?$n%$w:$w),$w*4+2)."|\n";


Online Version