diff --git a/algorithms/implementation/Save the prisoner!.cpp b/algorithms/implementation/Save the prisoner!.cpp new file mode 100644 index 0000000..425c617 --- /dev/null +++ b/algorithms/implementation/Save the prisoner!.cpp @@ -0,0 +1,24 @@ +#include +using namespace std; +int main() +{ + long int n,m,s,a; int t,i; + cin>>t; + for(i=0;i>n>>m>>s; + a=s+m-1; + if(a>n) + { + if(a%n==0) + { + cout<