#!/bin/bash

f(){
printf -vv %$2s
eval echo ${v// /$1}
}

for testcase in "{0,1} 2" "{0,1} 5" "{1,0} 2"; do
	f $testcase
done