english literature and creative writing manchester how to start creative writing essay master of arts in literature and creative writing creative writing questions and answers write my research paper ghostwriter essay englisch how many students use essay writing services descriptive words to use in creative writing americas best resume writing service reviews need help writing your thesis second grade creative writing creative writing workshops orange county well written compare and contrast essay graffiti creative writing primary homework help co uk religion christian primary homework help ww2 gas masks creative writing curriculum leeds university creative writing phd research paper authorship order creative writing mountain british council creative writing course delhi the best creative writing activities for engaging your learners order of writing a literature review essay writer reviews uk what are the basic requirements for creative writing get help with your essay best creative writing computer programs cheap online masters in creative writing que significa do your homework en ingles professional resume writing service gold coast creative writing based on lord of the flies homework help cpm algebra 2 sf state creative writing mfa duke creative writing order dissertation online online learning creative writing you doing a thesis custom clothing business plan best creative writing activities binghamton creative writing phd how we write creative writing creative writing masters programs in canada creative writing year 8 tes space facts homework help creative writing ma at uea self help is the best help essay 250 words homework google help me step by step research proposal writing dbq thesis maker medical assistant homework help where to buy homework sims 4 syracuse creative writing faculty online essay introduction maker florida state creative writing program homework creator how to choose a resume writing service world religion homework help order dissertation online uk creative writing worksheets for 8 year olds strengths and weaknesses as a writer essay we will do your homework for you i doing my homework significato professional term paper writers best essay writing service uk 2019 chicago state university mfa creative writing nursing dissertation writing services uct online creative writing course help me make a cover letter creative writing portfolio cover page ready player one essay prompts help with homework english 5 doing homework with your child meme doing a history essay picture prompt for creative writing ks2 bristol university english literature and creative writing customer service writing test homework helpers twin falls idaho can someone write my essay for me uk help with english essay writing creative writing ks2 lesson plan dissertation methodology writing help creative writing mfa online writing service content custom dissertation llc sites that pay for creative writing order of operations essay help someone essay thesis statement about doing the right thing best universities for english literature and creative writing job opportunities in creative writing can you pay someone to write a business plan i will do my homework in french do my thesis for me custom writing shoes university of southern mississippi mfa creative writing best phd creative writing programs graduate programs in creative writing in the us monopoly essay economics help interior design creative writing doing homework at 3 am morning georgetown mfa creative writing primary homework help tudors ks2 year 8 creative writing scheme of work denver creative writing phd best homework helper war creative writing prompts how to end a piece of creative writing using adjectives in creative writing 2 grade homework help doing homework straight after school president fund for creative writing mauritius primary homework help the vikings creative writing on road accident creative writing description of earth que quiere decir doing homework creative writing procedure do your homework before an interview creative writing course summer 2019 creative writer cover letter du creative writing question paper best thesis editing software business plan professional writers online homework help websites phd creative writing online app to help with english homework descriptive essay writer help with writing a case study usu creative writing contest homework help grade 5 creative writing workshop philippines 2019 year 8 creative writing creative writing and copywriting the essay crime and punishment was written by essay buy online primary homework help tudors religion how to prepare for an english creative writing exam how does homework help with academic achievement how to succeed in creative writing advantages of technology in promoting literacy and creative writing protest creative writing uk dissertation writers roman empire homework help how to find creative writing jobs college essay buy online year 6 creative writing lesson plans best creative writing programs in the uk creative writing minor tcu how to do a good piece of creative writing beginners creative writing using speech in creative writing essay writing service ireland keep calm and don't do your homework ma in creative writing uk curriculum guide creative writing grade 11 border design for creative writing roman army homework help creative writing side hustle creative writing on an interesting weekend creative writing on visit to a park creative writing association another word for written thesis salisbury university creative writing creative writing second grade creative writing about dad mfa creative writing ucsd creative writing border will writing service jersey aqa gcse english language creative writing past papers urgent homework help creative writing thoughts cpm homework help 6-43 creative writing fantasy prompts creative writing pictures to write about petrol price increase essay bond 11 creative writing help the handicapped essay creative writing exercises for grade 4 glasgow university mfa creative writing doing a systematic literature review in legal scholarship 200 word creative writing challenge what are creative writing skills cover letter for sending price list persuasive essay our changing society in which paragraph does the writer address the counterargument chinese creative writing hkcc creative writing about snow creative writing workshop critique creative writing critique worksheet creative writing ucsc creative writing university us can someone do my essay research paper writing services in chennai help me concentrate on homework news headlines for creative writing a homework helper get paid for homework help utah state creative writing creative writing leipzig i'll help you with your homework as soon as i did my own creative writing options creative writing peer editing worksheet creative writing story pyramid creative writing on overpopulation doing homework while tired paid maternity leave case study unit 1 algebra basics homework 4 order of operations answer key personal statement writers uk creative writing the ocean space battles forum creative writing uchicago creative writing faculty doing homework alone liberty university creative writing creative writing university of east anglia barclays additions will writing service the magic egg creative writing fellowship personal statement editing service mfa creative writing brown creative writing professor jobs 2019 creative writing for grade two creative writing university switzerland essay maker philippines cv writing service bradford creative writing humber picture of a written business plan logic homework help thesis helper malaysia encouragement creative writing creative writing workshop powerpoint best assignment writing service australia mfa creative writing uc davis essay is written usually in purpose creative writing creative writing final quizlet creative writing for film television and new media investor ready business plan most popular creative writing blogs preparation of business plan and proposal writing creative writing literary devices worksheet become a business plan writer write an essay on gray as a writer of odes creative writing jobs leicester umass amherst creative writing review writing service online creative writing identity writing custom nifi processor creative writing programs in the us division homework helper narrative creative writing parts of a research paper in order creative writing folktale creative writing on caterpillar doing a literature review in business and management careers with a masters in creative writing help make a cover letter english resume writing service despair creative writing australian cv writing service csu long beach mfa creative writing what does creative writing lead to creative writing manila denver mfa creative writing the sound of silence creative writing creative writing prompts for halloween creative writing primary 5 help writing college application essay berlin creative writing masters m tech thesis writing services in jaipur university of oxford creative writing ma military service writing guide the best college paper writing service can you write the sat essay in pencil aspect of creative writing pictures for creative writing grade 3 boston mfa creative writing programs is an mfa in creative writing worth it setting and atmosphere in creative writing creative writing university of westminster homework help cpm integrated 2 rationing primary homework help bachelor of fine arts creative writing qut creative writing on dreamland creative writing toys how to do your homework on sims 4 expert cv writing service price of curriculum vitae resume maker curriculum vitae write my extended essay for me essay writing services usa creative writing on collective nouns three little pigs creative writing bangor university creative writing ma creative writing essays for grade 4 mfa creative writing alabama how to do a good piece of creative writing how to create a creative writing portfolio where to learn creative writing creative writing planning frame what jobs for creative writing what creative writing means to me primary homework help propaganda university of south florida creative writing ma creative writing and wellbeing how much does a business plan writer cost help for writing personal statement essay price rise will writing service rochford utar thesis purchase intention best creative writing authors fake essay writer bullying description creative writing university of utah phd creative writing law cv writing service master of studies in creative writing importance of creative writing ma creative writing brunel university will writing service south shields creative writing in punjabi thesis for sale ttu creative writing series homework help algebra 1 answers good rewards for doing homework creative writing describe a person cv writing service south africa self help group research paper business plan writers in sri lanka how to do well in creative writing gcse esl creative writing story starters primary homework help roman baths creative writing ku creative writing about cold water creative writing folder reflective essay creative writing what do you do in creative writing custom writing journal ma creative writing distinction how to buy a house essay creative writing about bubbles stay up late doing homework homework 10-1 order of operations difference between journalistic writing and creative writing pay for your research paper what do you do your homework help writing personal statement medical school bad things about doing homework creative writing conclusion analysis of creative writing uc santa cruz mfa creative writing homework doing machine creative writing on humanity online will writing service uk essay on mango fruit written in bengali dark park creative writing essay on learning by doing creative writing fiction stories dissertation copy editing description of lightning creative writing english and creative writing concordia wku mfa creative writing the role of literature in creative writing english lit and creative writing creative writing jobs austin love story creative writing critical thinking helps the human mind examine itself dissertation helpers please help me do my homework custom harvesting business plan creative writing masters glasgow mfa creative writing uva essay during movement control order the help analysis essay get paid creative writing shakespeare homework help texas a&m creative writing best thesis writing services reddit contoh soal essay offering help kelas 12 creative writing littlehampton lloyds tsb will writing service creative writing for dummies vk write a case study for me creative writing spacebattles forums writing custom annotation in java creative writing content jobs western kentucky university creative writing career in creative writing help desk manager resume cover letter can you write my essay for me creative writing short prose order of case study the influence of birth order on personality essay company writing a business plan essay written by famous writers creative writing description of sky primary homework help ancient egypt clothing basic elements of creative writing bournemouth uni creative writing creative writing university of hawaii ways to stay focused while doing homework pine manor creative writing creative writing course germany creative writing summer camp jobs creative writing copy and paste creative writing online masters programs homework help cc2 creative writing writing a story reddit accounting homework help middle school essay writer i was doing my history homework help me make a business plan business plan professional writers you do your homework que significa en ingles creative writing statement of intention pay someone to do my calculus homework creative writing activities year 3 primary homework help industrial revolution will writing service redditch creative writing magic money cards homework helper lesson 5 least common multiple online creative writing stanford essay written past tense research paper on paypal autobiographical creative writing creative writing description of pain ways to start creative writing que significa en ingles did you do your homework tense in creative writing spilled ink creative writing spacebattles creative writing creative writing fau mba thesis writing help in dubai exercises to do while doing homework resume writing service in huntington beach ca dartmouth creative writing faculty can you trust essay writing sites utep creative writing mfa online primary homework help co uk egypt help with a level history coursework will writing service north shields 2nd grade creative writing picture prompts university of victoria mfa creative writing creative writing description of a house pay for essay canada cpsb homework help 5th grade night creative writing primary homework help co uk religion buddhism graduate essay writing services how to become a creative writing lecturer uk do my homework traduci in italiano creative writing picture comprehension creative writing then creative writing describing the sunset archangel oracle cards creative writing full sail university creative writing tuition cpm integrated 2 homework help temple university creative writing major creative writing newspaper comic strip creative writing creative writing wind aussie essay writer utrgv mfa creative writing dig for victory primary homework help creative writing de montfort university 5 paragraph written essay homework help 5 module 4 she do my homework where can i go to do my homework antioch university mfa creative writing experimental creative writing with the vectorized word same day will writing service glasgow creative writing masters argumentative essay help alexa helps kid with homework creative writing piece about a lake which will writing service review go do your homework traduction rip the page adventures in creative writing research proposal writing kenya creative writing masters berlin pictures for creative writing gcse creative writing improves mental health help desk operator cover letter cv writing service gravesend creative writing activities for 5th graders creative writing reading lists application letter format for money transfer uc riverside creative writing creative writing prompts 3rd grade cover letter writing services creative writing 5th season mfa creative writing ivy league improve this piece of creative writing i do my homework all by myself it help desk technician cover letter masters creative writing oxford i have been doing homework for two hours creative writing course bangkok descriptive essay writing help essay supposed to be written creative writing about snow roman primary homework help who can do my research paper creative writing questions for grade 7

Codeforces-প্রোগ্রামিং সমস্যা [A. Watermelon]

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

A. Watermelon কোডফোর্স এর একটি জনপ্রিয় সমস্যা। কোন সমস্যা সমাধানের আগে আমাদের উচিত সমস্যাটা দুই-তিন বার ভালো করে পড়া এবং বোঝা এখানে কি চাচ্ছে । এখানে ছোট্ট একটা গল্প বলা হয়েছে যে, দুই বন্ধু পেটে এবং বিল্লি সিদ্ধান্ত নেয় যে বাজার থেকে একটি তরমুজ ক্রয় করবে । তারা একটি বড় তরমুজ ক্রয় করে এবং এটিকে ওজন করে । তারা দুজন জোড় সংখ্যার অনেক ভক্ত তাই তারা চায় যে তরমুজ টিকে দুই ভাগ করবে এবং এমন ভাবে ভাগ করবে যেনো প্রতিটি ভাগ এর কেজি জোড় সংখ্যা হয় । সমান দুই ভাগে ভাগ করতে হবে এটা বাধ্যতামুলক না । তারা এটা যেভাবে খুশি ভাগ করতে পারবে । এখন আমাদের বের করতে হবে যে তরমুজটি দুইভাগে ভাগ করা যাবে কি না যার প্রতি ভাগের ওজন হবে জোড় সংখ্যা।
এখানে ইনপুট হিসেবে আমরা তরমুজ-এর ওজন নিতে পারবো যেটি একটা ইন্টিজার ডেটা টাইপ।
আর আউটপুট হিসেবে আমাদের YES অথবা NO প্রিন্ট করতে হবে।

এখন আমরা দেখি আমরা কিভাবে এই সমস্যাটি সমধান করতে পারি।
এখানে আমাদের তরমুজের ওজন জোড় কিনা সেটা বের করতে হবে কারন তরমুজের ওজন যদি বিজোড় হয় তবে সেটা দুইভাগ করলে কখনই ওজন জোড় সংখ্যা পাওয়া যাবে না । তাই আমাদের প্রথম কাজ হবে তরমুজের ওজন জোড় নাকি বিজোড় বের করা । যদি বিজোড় হয় তবে বলে দিতে পারি যে [‘NO’] ভাগ করা যাবে না। সেটি আমরা নিচের পদ্ধ্যতিতে বের করতে পারি,

if(weight % 2 == 0)
{
    //জোড়
}
else
{
    //বিজোড়
}

এখন কিন্তু আমরা তরমুজ এর ওজন জোড় নাকি বিজোড় পেয়ে গেছি । তরমুজের ওজন যদি জোড় হয় আমরা দুই ভাগে ভাগ করতে পারবো কিন্তু এখানে ছোট একটা সমস্যা আছে, সেটি হলো 2 । 2 জোড় সংখ্যা কিন্তু 2-কে সমান দুইভাগ ছাড়া করা যাবে না আবার দুইভাগ করলে প্রতিটি ভাগের ওজন বিজোড় সংখ্যা হয়ে যাবে তাই তরমুজের ওজন যদি দুই হয় তবে আমরা বলে দেবো যে ভাগ করা যাবে না।

if(weight == 2)
{
    //NO
}
else
{
    //YES
}

তাহলে আমাদের কাজের ধাপ গুলো একটু দেখে নেওয়া যাক।
১। প্রথমে বের করতে হবে তরমুজের ওজন জোড় নাকি বিজোড় ।বিজোড় হলে আমরা সরাসরি বলে দিতে পারি ভাগ করা যাবে না।
২। যদি ওজন জোড় সংখ্যা হয় তবে আমাদের দেখতে হবে সেটা ২কিনা। যদি ২ হয় তবে বলতে পারি ভাগ করা যাবে না। আর যদি ২ না হয় তবে ভাগ করা যাবে।

আমি সোর্স কোড নিচে দিয়ে দিয়েছি। কিন্তু কোড দেখার আগে নিজে কয়েক ঘন্টা চেষ্টা করা উচিত ।

#include <iostream>
using namespace std;
 
int main()
{
   int weight;
   cin >> weight;
 
   if (weight % 2 == 0)
   {
       if (weight == 2)
       {
           cout << "NO" << endl;
       }
       else
       {
           cout << "YES" << endl;
       }
   }
   else
   {
       cout << "NO" << endl;
   }
   
    return 0;
}
আকাশ M

আমি আকাশ । মাগুরা পলিটেকনিক থেকে কম্পিউটার ইঞ্জিনিয়ারিং-এ ডিপ্লোমা শেষ করেছি । এখন ড্যাফোডিল ইন্টারন্যাশনাল ইউনিভার্সিটি তে সিএসই বিভাগে পড়াশুনা করছি এবং ফ্রিল্যাঞ্চিং কেয়ার-এ ওয়েব ডেভেলপার হিসেবে কর্মরত আছি । আমার সব থেকে পছন্দের কাজ হলো প্রোগ্রামিং করা । তাছাড়া ক্রিকেট খেলা আমার অন্যতম পছন্দের কাজ। আমি চাই পৃথিবীর সব থেকে বড় সফটওয়ার কোম্পানি গুলোতে কাজ করি। আশা করি একদিন আমি সফল হব।

Recent Posts

Follow Us

Weekly Video