fork download
  1. import java.util.*;
  2. import java.math.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args)
  7. {
  8. Scanner in = new Scanner(System.in);
  9. in.useDelimiter(""); //Чтение по одному символу.
  10.  
  11. //String a = new String();
  12. int a = (int)in.next().charAt(0); //Первый ключ
  13. int c1 = (int)in.next().charAt(0); //Пробел
  14. int b = (int)in.next().charAt(0); //Второй ключ
  15. int c2 = (int)in.next().charAt(0); //Пробел
  16.  
  17. while(in.hasNext()){
  18. c1 = (int)in.next().charAt(0);
  19. c2 = (int)in.next().charAt(0);
  20. System.out.print((char) Math.round((c1-b+256*c2)*1.0/a));
  21. }
  22. }
  23. }
Success #stdin #stdout 0.1s 2841600KB
stdin
PD*¦.¦.¬(B,@.
stdout
””“