@@ -0,0 +1,556 @@
+package com.storm.hackerrank.algorithms.implementation;%0A%0Aimport java.util.Scanner;%0A%0Apublic class SaveThePrisoner %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int testCase = in.nextInt();%0A        for (int i = 0; i %3C testCase; i++) %7B%0A            int prisoners = in.nextInt();%0A            int sweets = in.nextInt();%0A            int start = in.nextInt();%0A            int poisoned = (sweets + start - 1) %25 prisoners;%0A            System.out.println(poisoned == 0 ? prisoners : poisoned);%0A        %7D%0A    %7D%0A%7D%0A

Save The Prisoner