The minimal cost for test case 1 is 6. There is no reliable net possible for test case 2.