Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //b
- #include <bits/stdc++.h>
- #define ll long long
- using namespace std;
- int main()
- {
- cin.tie(0);
- ios_base::sync_with_stdio(false);
- ll a, b, l, k=1;
- cin >> a >> b >> l;
- while (l > 0){
- if (k % 2 != 0){
- l = l-a;
- k++;
- }else{
- l = l-b;
- k++;
- }
- }
- if ((k-1) % 4 == 0){
- cout << "LEFT";
- }
- else if ((k-1)%4 == 1){
- cout << "BOTTOM";
- }
- else if ((k-1) % 4 == 2){
- cout << "RIGHT";
- }
- else if ((k-1) % 4 == 3){
- cout << "TOP";
- }
- return 0;
- }
- //c
- #include <bits/stdc++.h>
- #define ll long long
- using namespace std;
- int main()
- {
- cin.tie(0);
- ios_base::sync_with_stdio(false);
- int d, x, y, ans1, ans2, ans3;
- cin >> d >> x >> y;
- ans1 = (0-x)*(d-0)-(0-0)*(0-y);
- ans2 = (0-x)*(0-d)-(d-0)*(d-y);
- ans3 = (d-x)*(0-d)-(0-d)*(0-y);
- if ((ans1 >= 0 & ans2 >= 0 & ans3 >= 0) || (ans1 <= 0 & ans2 <= 0 & ans3 <= 0)){
- cout << 1;
- }else{
- cout << 0;
- }
- }
- //d
- #include <bits/stdc++.h>
- #define ll long long
- using namespace std;
- int main()
- {
- cin.tie(0);
- ios_base::sync_with_stdio(false);
- ll n, m, k, mod, c=0;
- cin >> n >> m >> k;
- vector<ll> arr(k);
- mod = n*m % k;
- for (int i = 0; i < k; i++){
- arr[i] = m*n/k;
- if (i < mod){
- arr[i]++;
- }
- }
- for (const auto& it : arr){
- cout << it << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement