restricted multiplication test