Case #1: 18 Case #2: 20 Case #3: 40 Case #4: 4 Case #5: 4600 Case #6: 1061 Case #7: 22793 Case #8: 272595 Case #9: 325239 Case #10: 63789877 Case #11: 443563560 Case #12: 1020301 Case #13: 261720 Case #14: 1828416768 Case #15: 971822 Case #16: 10003 Case #17: 302600 Case #18: 10697 Case #19: 1001000000 Case #20: 77385 Case #21: 1 Case #22: 1111 Case #23: 616496 Case #24: 1111000 Case #25: 27775 Case #26: 100098609 Case #27: 1099951829 Case #28: 614485101 Case #29: 500999999999 Case #30: 999999999996 Case #31: 10992761 Case #32: 1081900908