Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Siddharth Jha
- #include<bits/stdc++.h>
- //#include<ext/pb_ds/assoc_container.hpp>
- //#include<ext/pb_ds/tree_policy.hpp>
- //#include <ext/pb_ds/trie_policy.hpp>
- //using namespace __gnu_pbds;
- using namespace std;
- //typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
- //typedef trie<string,null_type,trie_string_access_traits<>,pat_trie_tag,trie_prefix_search_node_update> pbtrie;
- #define ll long long int
- #define mod 1000000007
- #define inf 1e18
- #define pb push_back
- #define vi vector<ll>
- #define vs vector<string>
- #define pii pair<ll,ll>
- #define ump unordered_map
- #define mp make_pair
- #define pq_max priority_queue<ll>
- #define pq_min priority_queue<ll,vi,greater<ll> >
- #define all(n) n.begin(),n.end()
- #define ff first
- #define ss second
- #define mid(l,r) (l+(r-l)/2)
- #define bitc(n) __builtin_popcount(n)
- #define SET(a) memset( a, -1, sizeof a )
- #define CLR(a) memset( a, 0, sizeof a )
- #define Pi 3.141592653589793
- #define loop(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
- #define _fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
- #define iter(container,it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
- #define log(args...) {string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
- #define logarr(arr,a,b) for(int z=(a);z<=(b);z++) cout<<(arr[z])<<" ";cout<<endl;
- template <typename T> T gcd(T a, T b){if(a%b) return gcd(b,a%b);return b;}
- template <typename T> T lcm(T a, T b){return (a*(b/gcd(a,b)));}
- vs tokenizer(string str,char ch) {std::istringstream var((str)); vs v; string t; while(getline((var), t, (ch))) {v.pb(t);} return v;}
- void err(istream_iterator<string> it) {}
- template<typename T, typename... Args>
- void err(istream_iterator<string> it, T a, Args... args) {
- cout << *it << " = " << a << endl;
- err(++it, args...);
- }
- void solve() {
- // ll n; cin >> n;
- loop (n,1,100) {
- cout << n << ":- ";
- loop (i,1,n) {
- ll j = n-i;
- if ((i+j) == 2*(i^j) && (i+j) == n) {
- cout << "{"<< i << "," << j << "}, ";
- }
- }
- cout << "\n";
- }
- }
- int main(int argc, char const *argv[]){
- _fast
- //#ifndef ONLINE_JUDGE
- //freopen("input.txt", "r", stdin);
- //freopen("output.txt", "w", stdout);
- //#endif
- ll t; cin>>t;
- while(t--){
- solve();
- }
- return 0;
- }
- /*
- 1:-
- 2:-
- 3:-
- 4:- {1,3}, {3,1},
- 5:-
- 6:-
- 7:-
- 8:- {2,6}, {6,2},
- 9:-
- 10:-
- 11:-
- 12:-
- 13:-
- 14:-
- 15:-
- 16:- {4,12}, {12,4},
- 17:-
- 18:-
- 19:-
- 20:- {5,15}, {7,13}, {13,7}, {15,5},
- 21:-
- 22:-
- 23:-
- 24:-
- 25:-
- 26:-
- 27:-
- 28:-
- 29:-
- 30:-
- 31:-
- 32:- {8,24}, {24,8},
- 33:-
- 34:-
- 35:-
- 36:- {9,27}, {11,25}, {25,11}, {27,9},
- 37:-
- 38:-
- 39:-
- 40:- {10,30}, {14,26}, {26,14}, {30,10},
- 41:-
- 42:-
- 43:-
- 44:-
- 45:-
- 46:-
- 47:-
- 48:-
- 49:-
- 50:-
- 51:-
- 52:-
- 53:-
- 54:-
- 55:-
- 56:-
- 57:-
- 58:-
- 59:-
- 60:-
- 61:-
- 62:-
- 63:-
- 64:- {16,48}, {48,16},
- 65:-
- 66:-
- 67:-
- 68:- {17,51}, {19,49}, {49,19}, {51,17},
- 69:-
- 70:-
- 71:-
- 72:- {18,54}, {22,50}, {50,22}, {54,18},
- 73:-
- 74:-
- 75:-
- 76:-
- 77:-
- 78:-
- 79:-
- 80:- {20,60}, {28,52}, {52,28}, {60,20},
- 81:-
- 82:-
- 83:-
- 84:- {21,63}, {23,61}, {29,55}, {31,53}, {53,31}, {55,29}, {61,23}, {63,21},
- 85:-
- 86:-
- 87:-
- 88:-
- 89:-
- 90:-
- 91:-
- 92:-
- 93:-
- 94:-
- 95:-
- 96:-
- 97:-
- 98:-
- 99:-
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement