fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. bool a[101][101][101]={0};
  4.  
  5. int main() {
  6. // your code goes here
  7. for(int i=1;i<=100;i++)
  8. {
  9. if(i%2 == 1)
  10. {
  11. a[i][0][0] = true;
  12. a[0][i][0] = true;
  13. a[0][0][i] = true;
  14. }
  15. }
  16. for(int i=1;i<=100;i++)
  17. {
  18. for(int j=1;j<=100;j++)
  19. {
  20. a[i][j][0] = a[i-1][j][0] && a[i][j-1][0] && a[i-1][j-1][0];
  21. if(a[i][j][0] == true)
  22. {
  23. a[i][j][0] = false;
  24. }
  25. else
  26. {
  27. a[i][j][0] = true;
  28. }
  29. a[i][0][j] = a[i-1][0][j] && a[i][0][j-1] && a[i-1][0][j-1];
  30. if(a[i][0][j] == true)
  31. {
  32. a[i][0][j] = false;
  33. }
  34. else
  35. {
  36. a[i][0][j] = true;
  37. }
  38. a[0][i][j] = a[0][i-1][j] && a[0][i][j-1] && a[0][i-1][j-1];
  39. if(a[0][i][j] == true)
  40. {
  41. a[0][i][j] = false;
  42. }
  43. else
  44. {
  45. a[0][i][j] = true;
  46. }
  47. }
  48. }
  49. for(int i=1;i<=100;i++)
  50. {
  51. for(int j=1;j<=100;j++)
  52. {
  53. for(int k=1;k<=100;k++)
  54. {
  55. a[i][j][k] = a[i-1][j][k]&&a[i][j-1][k]&&a[i][j][k-1]&&a[i-1][j-1][k]&&a[i-1][j][k-1]&&a[i][j-1][k-1]&&a[i-1][j-1][k-1];
  56. if(a[i][j][k] == true)
  57. {
  58. a[i][j][k] = false;
  59. }
  60. else
  61. {
  62. a[i][j][k] = true;
  63. }
  64. }
  65. }
  66. }
  67. int q;
  68. cin>>q;
  69. while(q--)
  70. {
  71. int x,y,z;
  72. cin>>x>>y>>z;
  73. (a[x][y][z] == true)?(cout<<"Ashima"<<endl):(cout<<"Aishwarya"<<endl);
  74. }
  75. return 0;
  76. }
Success #stdin #stdout 0s 4304KB
stdin
3
1 3 1
2 2 0
2 1 1
stdout
Ashima
Aishwarya
Ashima