Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // dart solution to codeabbey challenge 72
- import 'dart:io';
- void main() {
- var INP1 = stdin.readLineSync().split(" ").map((elem) => int.parse(elem)).toList();
- var INP2 = stdin.readLineSync().split(" ").map((elem) => int.parse(elem)).toList();
- var RSP = [];
- var CON = "bcdfghjklmnprstvwxz";
- var VOW = "aeiou";
- var A = 445;
- var C = 700001;
- var M = 2097152;
- var XN = INP1[1];
- var LI = 0;
- for (var i = 0; i < INP1[0]; i++){
- var WORD = "";
- for (var j = 1; j <= INP2[i]; j++){
- XN = (A*XN + C) % M;
- if(j % 2 == 0){
- LI = XN % 5;
- WORD += VOW[LI];
- }else{
- LI = XN % 19;
- WORD += CON[LI];
- }
- }
- RSP.add(WORD);
- }
- print(RSP.join(" "));
- }
Add Comment
Please, Sign In to add comment