Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. //b
  2.  
  3. #include <bits/stdc++.h>
  4.  
  5. #define ll long long
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. cin.tie(0);
  12. ios_base::sync_with_stdio(false);
  13. ll a, b, l, k=1;
  14. cin >> a >> b >> l;
  15. while (l > 0){
  16. if (k % 2 != 0){
  17. l = l-a;
  18. k++;
  19. }else{
  20. l = l-b;
  21. k++;
  22. }
  23. }
  24. if ((k-1) % 4 == 0){
  25. cout << "LEFT";
  26. }
  27. else if ((k-1)%4 == 1){
  28. cout << "BOTTOM";
  29. }
  30. else if ((k-1) % 4 == 2){
  31. cout << "RIGHT";
  32. }
  33. else if ((k-1) % 4 == 3){
  34. cout << "TOP";
  35. }
  36. return 0;
  37. }
  38.  
  39. //c
  40.  
  41. #include <bits/stdc++.h>
  42.  
  43. #define ll long long
  44.  
  45. using namespace std;
  46.  
  47. int main()
  48. {
  49. cin.tie(0);
  50. ios_base::sync_with_stdio(false);
  51. int d, x, y, ans1, ans2, ans3;
  52. cin >> d >> x >> y;
  53. ans1 = (0-x)*(d-0)-(0-0)*(0-y);
  54. ans2 = (0-x)*(0-d)-(d-0)*(d-y);
  55. ans3 = (d-x)*(0-d)-(0-d)*(0-y);
  56. if ((ans1 >= 0 & ans2 >= 0 & ans3 >= 0) || (ans1 <= 0 & ans2 <= 0 & ans3 <= 0)){
  57. cout << 1;
  58. }else{
  59. cout << 0;
  60. }
  61. }
  62.  
  63. //d
  64.  
  65. #include <bits/stdc++.h>
  66.  
  67. #define ll long long
  68.  
  69. using namespace std;
  70.  
  71. int main()
  72. {
  73. cin.tie(0);
  74. ios_base::sync_with_stdio(false);
  75. ll n, m, k, mod, c=0;
  76. cin >> n >> m >> k;
  77. vector<ll> arr(k);
  78. mod = n*m % k;
  79. for (int i = 0; i < k; i++){
  80. arr[i] = m*n/k;
  81. if (i < mod){
  82. arr[i]++;
  83. }
  84. }
  85. for (const auto& it : arr){
  86. cout << it << " ";
  87. }
  88. return 0;
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement