Advertisement
rafid_shad

cf

Jun 26th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.93 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. //*****************Data type**********************//
  5. typedef long long ll;
  6. typedef long long int lli;
  7. typedef unsigned long long  ull;
  8. typedef unsigned long long int ulli;
  9.  
  10. //*****************Map****************************//
  11. typedef map<int, int> MII;
  12. typedef map<int, string> MIS;
  13. typedef map<int, char> MIC;
  14. typedef map<string, int> MSI;
  15. typedef map<char, int> MCI;
  16.  
  17. //****************Pair****************************//
  18. typedef pair<int, int> PII;
  19. typedef pair<string, string> PSS;
  20. typedef pair<char, char> PCC;
  21. typedef pair<int, string> PIS;
  22. typedef pair<int, char> PIC;
  23.  
  24. //*****************Vector************************//
  25. typedef vector<int> VI;
  26. typedef vector<string> VS;
  27. typedef vector<double> VD;
  28. typedef vector<lli> VLLI;
  29. typedef vector<VI> VVI;
  30. typedef vector<PII> VPI;
  31.  
  32. //-------------------------------------------------------------------------------//
  33. #define pp1(A)              printf("%d\n",A)
  34. #define pp2(A,B)            printf("%d %d\n",A,B)
  35. #define pp3(A,B,C)          printf("%d %d %d\n",A,B,C)
  36.  
  37. #define ss1(A)              scanf("%d", &A)
  38. #define ss2(A,B)            scanf("%d,%d",&A,&B)
  39. #define ss3(A,B,C)          scanf("%d,%d,%d",&A,&B,&C)
  40.  
  41. //--------------------------------------------------------------------------------//
  42. #define nosync              ios_base::sync_with_stdio(false), cin.tie(NULL)
  43. #define pf                  push_front
  44. #define pb                  push_back
  45. #define pop                 pop_back()
  46. #define mk                  make_pair
  47. #define PF                  first
  48. #define PS                  second
  49. #define sq(a)               (a)*(a)
  50. #define ALL(a)              a.begin(), a.end()
  51. #define Erase(V,I)          V.erase(V.begin()+I)
  52. #define Insert(V,I,M)       V.insert(V.begin()+I,M)
  53.  
  54. //********************************************************************************//
  55. #define FOR(i,x,y)          for(int i=x;i<y;i++)
  56. #define RFOR(i,x,y)         for(int i=x;i>=y;i--)
  57. #define scanVI(V, N)        for(int i=0; i<N; i++){ int X; ss1(X); V.pb(X); }
  58. #define scanAI(A, N)        for(int i=0; i<N; i++){ ss1(A[i]); }
  59. #define printVI(V, N)       for(int i=0; i<N; i++){ cout<<V[i]<<endl; }
  60. #define printVSI(V, N)      for(int i=0; i<N; i++){ cout<<V[i]<<" "; }
  61. #define printAI(A, N)       for(int i=0; i<N; i++){ cout<<A[i]<<endl; }
  62. #define printASI(A, N)      for(int i=0; i<N; i++){ cout<<A[i]<<" "; }
  63.  
  64. //---------------------------------*START*-----------------------------------------//
  65. int sum(int x)
  66. {
  67.     if(x>=1)
  68.     {
  69.         int r=x%10;
  70.         //cout<<r<<endl;
  71.         int d=x/10;
  72.         //cout<<"ok"<<endl;
  73.         //int r=x%10;
  74.         return r+sum(d);
  75.     }
  76.  
  77. }
  78.  
  79. int main()
  80. {
  81.    int a;
  82.    cin>>a;
  83.    int temp=a;
  84.    //cout<<temp%10<<endl;
  85.    while(1)
  86.   {
  87.        int rs=sum(temp);
  88.        if(rs%4==0)
  89.        {
  90.            cout<<temp<<endl;
  91.            break;
  92.  
  93.        }
  94.        temp++;
  95.   }
  96.   return 0;
  97.  
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement