Sub Sum Test Algorithm